comparison os2/dw.c @ 1233:365f92e85771

Fix for dw_font_text_extents_get() on OS/2 not honoring the font set with dw_pixmap_set_font(). Also cleaned up a number of warnings generated by VisualAge. Informationals won't be fixed.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 16 Oct 2011 20:03:36 +0000
parents d865c29fc06a
children c191a562c14a
comparison
equal deleted inserted replaced
1232:db21c0081387 1233:365f92e85771
3026 case WM_BUTTON3DOWN | 0x2000: 3026 case WM_BUTTON3DOWN | 0x2000:
3027 case WM_BUTTON1UP | 0x2000: 3027 case WM_BUTTON1UP | 0x2000:
3028 case WM_BUTTON2UP | 0x2000: 3028 case WM_BUTTON2UP | 0x2000:
3029 case WM_BUTTON3UP | 0x2000: 3029 case WM_BUTTON3UP | 0x2000:
3030 if(hwndTaskBar) 3030 if(hwndTaskBar)
3031 result = _run_event(hwndTaskBar, msg & ~0x2000, mp1, mp2); 3031 result = (int)_run_event(hwndTaskBar, msg & ~0x2000, mp1, mp2);
3032 break; 3032 break;
3033 case WM_USER+2: 3033 case WM_USER+2:
3034 _clear_emphasis(); 3034 _clear_emphasis();
3035 if(dw_window_get_data((HWND)mp2, "_dw_popup")) 3035 if(dw_window_get_data((HWND)mp2, "_dw_popup"))
3036 _free_menu_data((HWND)mp2); 3036 _free_menu_data((HWND)mp2);
4118 int size = 9; 4118 int size = 9;
4119 4119
4120 /* Fill in the family name if possible */ 4120 /* Fill in the family name if possible */
4121 if(currfont) 4121 if(currfont)
4122 { 4122 {
4123 char *name = strchr(currfont, "."); 4123 char *name = strchr(currfont, '.');
4124 if(name) 4124 if(name)
4125 { 4125 {
4126 int newsize = atoi(currfont); 4126 int newsize = atoi(currfont);
4127 if(newsize > 0) 4127 if(newsize > 0)
4128 size = newsize; 4128 size = newsize;
4515 4515
4516 WinSetWindowPtr(newbox->hwnd, QWP_USER, newbox); 4516 WinSetWindowPtr(newbox->hwnd, QWP_USER, newbox);
4517 dw_window_set_color(newbox->hwnd, DW_CLR_PALEGRAY, DW_CLR_PALEGRAY); 4517 dw_window_set_color(newbox->hwnd, DW_CLR_PALEGRAY, DW_CLR_PALEGRAY);
4518 dw_window_set_color(newbox->grouphwnd, DW_CLR_BLACK, DW_CLR_PALEGRAY); 4518 dw_window_set_color(newbox->grouphwnd, DW_CLR_BLACK, DW_CLR_PALEGRAY);
4519 dw_window_set_font(newbox->grouphwnd, DefaultFont); 4519 dw_window_set_font(newbox->grouphwnd, DefaultFont);
4520 dw_window_set_data(newbox->hwnd, "_dw_buddy", newbox->grouphwnd); 4520 dw_window_set_data(newbox->hwnd, "_dw_buddy", (void *)newbox->grouphwnd);
4521 return newbox->hwnd; 4521 return newbox->hwnd;
4522 } 4522 }
4523 4523
4524 /* 4524 /*
4525 * Create a new MDI Frame to be packed. 4525 * Create a new MDI Frame to be packed.
5001 NULLHANDLE, 5001 NULLHANDLE,
5002 HWND_TOP, 5002 HWND_TOP,
5003 id, 5003 id,
5004 NULL, 5004 NULL,
5005 NULL); 5005 NULL);
5006 WinSendMsg(tmp, MLM_FORMAT, MLFIE_NOTRANS, 0); 5006 WinSendMsg(tmp, MLM_FORMAT, (MPARAM)MLFIE_NOTRANS, 0);
5007 blah->oldproc = WinSubclassWindow(tmp, _mleproc); 5007 blah->oldproc = WinSubclassWindow(tmp, _mleproc);
5008 WinSetWindowPtr(tmp, QWP_USER, blah); 5008 WinSetWindowPtr(tmp, QWP_USER, blah);
5009 dw_window_set_font(tmp, DefaultFont); 5009 dw_window_set_font(tmp, DefaultFont);
5010 return tmp; 5010 return tmp;
5011 } 5011 }
8529 { 8529 {
8530 hps = _set_colors(handle); 8530 hps = _set_colors(handle);
8531 } 8531 }
8532 else if(pixmap) 8532 else if(pixmap)
8533 { 8533 {
8534 HPS pixmaphps = WinGetPS(pixmap->handle); 8534 HPS pixmaphps = WinGetPS(pixmap->font ? pixmap->font : pixmap->handle);
8535 8535
8536 hps = _set_hps(pixmap->hps); 8536 hps = _set_hps(pixmap->hps);
8537 _CopyFontSettings(pixmaphps, hps); 8537 _CopyFontSettings(pixmaphps, hps);
8538 WinReleasePS(pixmaphps); 8538 WinReleasePS(pixmaphps);
8539 } 8539 }
10051 * -1 on error. 10051 * -1 on error.
10052 */ 10052 */
10053 int API dw_exec(char *program, int type, char **params) 10053 int API dw_exec(char *program, int type, char **params)
10054 { 10054 {
10055 type = type; /* keep compiler happy */ 10055 type = type; /* keep compiler happy */
10056 return spawnvp(P_NOWAIT, program, (const char **)params); 10056 return spawnvp(P_NOWAIT, program, params);
10057 } 10057 }
10058 10058
10059 /* 10059 /*
10060 * Loads a web browser pointed at the given URL. 10060 * Loads a web browser pointed at the given URL.
10061 * Parameters: 10061 * Parameters:
10296 print->startpage = 1; 10296 print->startpage = 1;
10297 print->endpage = pages; 10297 print->endpage = pages;
10298 print->flags = flags; 10298 print->flags = flags;
10299 10299
10300 /* Check to see how much space we need for the printer list */ 10300 /* Check to see how much space we need for the printer list */
10301 splerr = SplEnumPrinter(NULL, 0, fsType, NULL, NULL, &cRes, &cTotal, &cbNeeded ,NULL); 10301 splerr = SplEnumPrinter(NULL, 0, fsType, NULL, 0, &cRes, &cTotal, &cbNeeded ,NULL);
10302 10302
10303 if(splerr == ERROR_MORE_DATA || splerr == NERR_BufTooSmall) 10303 if(splerr == ERROR_MORE_DATA || splerr == NERR_BufTooSmall)
10304 { 10304 {
10305 /* Allocate memory for the buffer using the count of bytes that were returned in cbNeeded. */ 10305 /* Allocate memory for the buffer using the count of bytes that were returned in cbNeeded. */
10306 DosAllocMem(&pBuf, cbNeeded, PAG_READ|PAG_WRITE|PAG_COMMIT); 10306 DosAllocMem(&pBuf, cbNeeded, PAG_READ|PAG_WRITE|PAG_COMMIT);