comparison os2/dw.c @ 1341:184b3aedc2ff

Added PMPrintf support to dw_debug() on OS/2. Also cleaned up tons of warnings generated by new versions of gcc on OS/2.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 14 Nov 2011 17:14:54 +0000
parents c6d6788e207f
children b4a23eab81fa
comparison
equal deleted inserted replaced
1340:890890c31ba6 1341:184b3aedc2ff
48 void _handle_splitbar_resize(HWND hwnd, float percent, int type, int x, int y); 48 void _handle_splitbar_resize(HWND hwnd, float percent, int type, int x, int y);
49 int _load_bitmap_file(char *file, HWND handle, HBITMAP *hbm, HDC *hdc, HPS *hps, unsigned long *width, unsigned long *height); 49 int _load_bitmap_file(char *file, HWND handle, HBITMAP *hbm, HDC *hdc, HPS *hps, unsigned long *width, unsigned long *height);
50 void _dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname); 50 void _dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname);
51 void _dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname); 51 void _dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname);
52 void _free_menu_data(HWND menu); 52 void _free_menu_data(HWND menu);
53 ULONG (* _System _PmPrintfString)(char *String) = 0;
53 54
54 char ClassName[] = "dynamicwindows"; 55 char ClassName[] = "dynamicwindows";
55 char SplitbarClassName[] = "dwsplitbar"; 56 char SplitbarClassName[] = "dwsplitbar";
56 char ScrollClassName[] = "dwscroll"; 57 char ScrollClassName[] = "dwscroll";
57 char *DefaultFont = "9.WarpSans"; 58 char *DefaultFont = "9.WarpSans";
65 HWND hwndTrayServer = NULLHANDLE, hwndTaskBar = NULLHANDLE; 66 HWND hwndTrayServer = NULLHANDLE, hwndTaskBar = NULLHANDLE;
66 ; 67 ;
67 PRECORDCORE pCoreEmph = NULL; 68 PRECORDCORE pCoreEmph = NULL;
68 ULONG aulBuffer[4]; 69 ULONG aulBuffer[4];
69 HWND lasthcnr = 0, lastitem = 0, popup = 0, desktop; 70 HWND lasthcnr = 0, lastitem = 0, popup = 0, desktop;
70 HMOD wpconfig = 0; 71 HMOD wpconfig = 0, pmprintf = 0;
71 72
72 unsigned long _colors[] = { 73 unsigned long _colors[] = {
73 CLR_BLACK, 74 CLR_BLACK,
74 CLR_DARKRED, 75 CLR_DARKRED,
75 CLR_DARKGREEN, 76 CLR_DARKGREEN,
291 henum = WinBeginEnumWindows(handle); 292 henum = WinBeginEnumWindows(handle);
292 while((child = WinGetNextWindow(henum)) != NULLHANDLE) 293 while((child = WinGetNextWindow(henum)) != NULLHANDLE)
293 { 294 {
294 char tmpbuf[100]; 295 char tmpbuf[100];
295 296
296 WinQueryClassName(child, 99, tmpbuf); 297 WinQueryClassName(child, 99, (PCH)tmpbuf);
297 298
298 if(strncmp(tmpbuf, "#6", 3)==0) /* Entryfield */ 299 if(strncmp(tmpbuf, "#6", 3)==0) /* Entryfield */
299 { 300 {
300 entry = child; 301 entry = child;
301 break; 302 break;
316 henum = WinBeginEnumWindows(handle); 317 henum = WinBeginEnumWindows(handle);
317 while((child = WinGetNextWindow(henum)) != NULLHANDLE) 318 while((child = WinGetNextWindow(henum)) != NULLHANDLE)
318 { 319 {
319 char tmpbuf[100]; 320 char tmpbuf[100];
320 321
321 WinQueryClassName(child, 99, tmpbuf); 322 WinQueryClassName(child, 99, (PCH)tmpbuf);
322 323
323 if(strncmp(tmpbuf, "#3", 3)==0 && dw) /* Button */ 324 if(strncmp(tmpbuf, "#3", 3)==0 && dw) /* Button */
324 WinSetOwner(child, dw); 325 WinSetOwner(child, dw);
325 else if(strncmp(tmpbuf, "dynamicwindows", 14) == 0) 326 else if(strncmp(tmpbuf, "dynamicwindows", 14) == 0)
326 dw = child; 327 dw = child;
395 if(ptr) 396 if(ptr)
396 { 397 {
397 WindowData *wd = (WindowData *)ptr; 398 WindowData *wd = (WindowData *)ptr;
398 char tmpbuf[100]; 399 char tmpbuf[100];
399 400
400 WinQueryClassName(handle, 99, tmpbuf); 401 WinQueryClassName(handle, 99, (PCH)tmpbuf);
401 402
402 if(strncmp(tmpbuf, "ColorSelectClass", 17)!=0) 403 if(strncmp(tmpbuf, "ColorSelectClass", 17)!=0)
403 { 404 {
404 /* If this window has an associate bitmap destroy it. */ 405 /* If this window has an associate bitmap destroy it. */
405 _free_bitmap(handle); 406 _free_bitmap(handle);
454 dw_signal_disconnect_by_name(menu, DW_SIGNAL_CLICKED); 455 dw_signal_disconnect_by_name(menu, DW_SIGNAL_CLICKED);
455 _free_window_memory(menu); 456 _free_window_memory(menu);
456 457
457 for(i=0;i<count;i++) 458 for(i=0;i<count;i++)
458 { 459 {
459 SHORT menuid = (SHORT)WinSendMsg(menu, MM_ITEMIDFROMPOSITION, MPFROMSHORT(i), 0); 460 SHORT menuid = (SHORT)(LONG)WinSendMsg(menu, MM_ITEMIDFROMPOSITION, MPFROMSHORT(i), 0);
460 MENUITEM mi; 461 MENUITEM mi;
461 462
462 /* Free the data associated with the ID */ 463 /* Free the data associated with the ID */
463 if(menuid >= 30000) 464 if(menuid >= 30000)
464 { 465 {
465 char buffer[31] = {0}; 466 char buffer[31] = {0};
466 467
467 sprintf(buffer, "_dw_id%ld", menuid); 468 sprintf(buffer, "_dw_id%d", menuid);
468 dw_window_set_data( hwndApp, buffer, NULL ); 469 dw_window_set_data( hwndApp, buffer, NULL );
469 sprintf(buffer, "_dw_checkable%ld", menuid); 470 sprintf(buffer, "_dw_checkable%d", menuid);
470 dw_window_set_data( hwndApp, buffer, NULL ); 471 dw_window_set_data( hwndApp, buffer, NULL );
471 sprintf(buffer, "_dw_ischecked%ld", menuid); 472 sprintf(buffer, "_dw_ischecked%d", menuid);
472 dw_window_set_data( hwndApp, buffer, NULL ); 473 dw_window_set_data( hwndApp, buffer, NULL );
473 sprintf(buffer, "_dw_isdisabled%ld", menuid); 474 sprintf(buffer, "_dw_isdisabled%d", menuid);
474 dw_window_set_data( hwndApp, buffer, NULL ); 475 dw_window_set_data( hwndApp, buffer, NULL );
475 } 476 }
476 477
477 /* Check any submenus */ 478 /* Check any submenus */
478 if(WinSendMsg(menu, MM_QUERYITEM, MPFROMSHORT(menuid), MPFROMP(&mi)) 479 if(WinSendMsg(menu, MM_QUERYITEM, MPFROMSHORT(menuid), MPFROMP(&mi))
489 char tmpbuf[100]; 490 char tmpbuf[100];
490 491
491 if(!handle) 492 if(!handle)
492 return 0; 493 return 0;
493 494
494 WinQueryClassName(handle, 99, tmpbuf); 495 WinQueryClassName(handle, 99, (PCH)tmpbuf);
495 496
496 if(!WinIsWindowEnabled(handle) || 497 if(!WinIsWindowEnabled(handle) ||
497 (strncmp(tmpbuf, "ColorSelectClass", 17) && dw_window_get_data(handle, "_dw_disabled"))) 498 (strncmp(tmpbuf, "ColorSelectClass", 17) && dw_window_get_data(handle, "_dw_disabled")))
498 return 0; 499 return 0;
499 500
587 } 588 }
588 else 589 else
589 { 590 {
590 char tmpbuf[100] = ""; 591 char tmpbuf[100] = "";
591 592
592 WinQueryClassName(box->items[z].hwnd, 99, tmpbuf); 593 WinQueryClassName(box->items[z].hwnd, 99, (PCH)tmpbuf);
593 if(strncmp(tmpbuf, SplitbarClassName, strlen(SplitbarClassName)+1)==0) 594 if(strncmp(tmpbuf, SplitbarClassName, strlen(SplitbarClassName)+1)==0)
594 { 595 {
595 /* Then try the bottom or right box */ 596 /* Then try the bottom or right box */
596 HWND mybox = (HWND)dw_window_get_data(box->items[z].hwnd, "_dw_bottomright"); 597 HWND mybox = (HWND)dw_window_get_data(box->items[z].hwnd, "_dw_bottomright");
597 598
722 } 723 }
723 else 724 else
724 { 725 {
725 char tmpbuf[100] = ""; 726 char tmpbuf[100] = "";
726 727
727 WinQueryClassName(box->items[z].hwnd, 99, tmpbuf); 728 WinQueryClassName(box->items[z].hwnd, 99, (PCH)tmpbuf);
728 if(strncmp(tmpbuf, SplitbarClassName, strlen(SplitbarClassName)+1)==0) 729 if(strncmp(tmpbuf, SplitbarClassName, strlen(SplitbarClassName)+1)==0)
729 { 730 {
730 /* Try the top or left box */ 731 /* Try the top or left box */
731 HWND mybox = (HWND)dw_window_get_data(box->items[z].hwnd, "_dw_topleft"); 732 HWND mybox = (HWND)dw_window_get_data(box->items[z].hwnd, "_dw_topleft");
732 733
967 968
968 void _check_resize_notebook(HWND hwnd) 969 void _check_resize_notebook(HWND hwnd)
969 { 970 {
970 char tmpbuf[100]; 971 char tmpbuf[100];
971 972
972 WinQueryClassName(hwnd, 99, tmpbuf); 973 WinQueryClassName(hwnd, 99, (PCH)tmpbuf);
973 974
974 /* If we have a notebook we resize the page again. */ 975 /* If we have a notebook we resize the page again. */
975 if(strncmp(tmpbuf, "#40", 4)==0) 976 if(strncmp(tmpbuf, "#40", 4)==0)
976 { 977 {
977 long x, y; 978 long x, y;
1364 if(thisbox->items[z].vsize != SIZEEXPAND) 1365 if(thisbox->items[z].vsize != SIZEEXPAND)
1365 vectory = 0; 1366 vectory = 0;
1366 if(thisbox->items[z].hsize != SIZEEXPAND) 1367 if(thisbox->items[z].hsize != SIZEEXPAND)
1367 vectorx = 0; 1368 vectorx = 0;
1368 1369
1369 WinQueryClassName(handle, 99, tmpbuf); 1370 WinQueryClassName(handle, 99, (PCH)tmpbuf);
1370 1371
1371 if(strncmp(tmpbuf, "#2", 3)==0) 1372 if(strncmp(tmpbuf, "#2", 3)==0)
1372 { 1373 {
1373 HWND frame = (HWND)dw_window_get_data(handle, "_dw_combo_box"); 1374 HWND frame = (HWND)dw_window_get_data(handle, "_dw_combo_box");
1374 /* Make the combobox big enough to drop down. :) */ 1375 /* Make the combobox big enough to drop down. :) */
1634 1635
1635 GpiSetColor(hpsPaint, CLR_WHITE); 1636 GpiSetColor(hpsPaint, CLR_WHITE);
1636 _Right(hpsPaint, rclPaint); 1637 _Right(hpsPaint, rclPaint);
1637 _Bottom(hpsPaint, rclPaint); 1638 _Bottom(hpsPaint, rclPaint);
1638 1639
1639 WinQueryWindowText(hWnd, 1024, buf); 1640 WinQueryWindowText(hWnd, 1024, (PSZ)buf);
1640 rclPaint.xLeft += 3; 1641 rclPaint.xLeft += 3;
1641 rclPaint.xRight--; 1642 rclPaint.xRight--;
1642 rclPaint.yTop--; 1643 rclPaint.yTop--;
1643 rclPaint.yBottom++; 1644 rclPaint.yBottom++;
1644 1645
1645 GpiSetColor(hpsPaint, CLR_BLACK); 1646 GpiSetColor(hpsPaint, CLR_BLACK);
1646 WinDrawText(hpsPaint, -1, buf, &rclPaint, DT_TEXTATTRS, DT_TEXTATTRS, DT_VCENTER | DT_LEFT | DT_TEXTATTRS); 1647 WinDrawText(hpsPaint, -1, (PCH)buf, &rclPaint, DT_TEXTATTRS, DT_TEXTATTRS, DT_VCENTER | DT_LEFT | DT_TEXTATTRS);
1647 WinEndPaint(hpsPaint); 1648 WinEndPaint(hpsPaint);
1648 1649
1649 return (MRESULT)TRUE; 1650 return (MRESULT)TRUE;
1650 } 1651 }
1651 } 1652 }
1760 1761
1761 void _click_default(HWND handle) 1762 void _click_default(HWND handle)
1762 { 1763 {
1763 char tmpbuf[100]; 1764 char tmpbuf[100];
1764 1765
1765 WinQueryClassName(handle, 99, tmpbuf); 1766 WinQueryClassName(handle, 99, (PCH)tmpbuf);
1766 1767
1767 /* These are the window classes which can 1768 /* These are the window classes which can
1768 * obtain input focus. 1769 * obtain input focus.
1769 */ 1770 */
1770 if(strncmp(tmpbuf, "#3", 3)==0) 1771 if(strncmp(tmpbuf, "#3", 3)==0)
1810 char tmpbuf[100]; 1811 char tmpbuf[100];
1811 1812
1812 if(blah) 1813 if(blah)
1813 oldproc = blah->oldproc; 1814 oldproc = blah->oldproc;
1814 1815
1815 WinQueryClassName(hWnd, 99, tmpbuf); 1816 WinQueryClassName(hWnd, 99, (PCH)tmpbuf);
1816 1817
1817 /* These are the window classes which should get a menu */ 1818 /* These are the window classes which should get a menu */
1818 if(strncmp(tmpbuf, "#2", 3)==0 || /* Combobox */ 1819 if(strncmp(tmpbuf, "#2", 3)==0 || /* Combobox */
1819 strncmp(tmpbuf, "#6", 3)==0 || /* Entryfield */ 1820 strncmp(tmpbuf, "#6", 3)==0 || /* Entryfield */
1820 strncmp(tmpbuf, "#10", 4)==0 || /* MLE */ 1821 strncmp(tmpbuf, "#10", 4)==0 || /* MLE */
2518 { 2519 {
2519 PRECORDCORE pre; 2520 PRECORDCORE pre;
2520 2521
2521 pre = ((PNOTIFYRECORDENTER)mp2)->pRecord; 2522 pre = ((PNOTIFYRECORDENTER)mp2)->pRecord;
2522 if(pre) 2523 if(pre)
2523 text = pre->pszIcon; 2524 text = (char *)pre->pszIcon;
2524 } 2525 }
2525 2526
2526 if(tmp->window == notifyhwnd) 2527 if(tmp->window == notifyhwnd)
2527 { 2528 {
2528 result = containerselectfunc(tmp->window, text, tmp->data); 2529 result = containerselectfunc(tmp->window, text, tmp->data);
2552 { 2553 {
2553 PCNRITEM pci; 2554 PCNRITEM pci;
2554 2555
2555 pci = (PCNRITEM)mp2; 2556 pci = (PCNRITEM)mp2;
2556 2557
2557 text = pci->rc.pszIcon; 2558 text = (char *)pci->rc.pszIcon;
2558 user = pci->user; 2559 user = pci->user;
2559 } 2560 }
2560 2561
2561 dw_pointer_query_pos(&x, &y); 2562 dw_pointer_query_pos(&x, &y);
2562 2563
2609 if(pci && pre->fEmphasisMask & CRA_CURSORED && (pci->rc.flRecordAttr & CRA_CURSORED)) 2610 if(pci && pre->fEmphasisMask & CRA_CURSORED && (pci->rc.flRecordAttr & CRA_CURSORED))
2610 { 2611 {
2611 int (* API treeselectfunc)(HWND, HTREEITEM, char *, void *, void *) = (int (* API)(HWND, HTREEITEM, char *, void *, void *))tmp->signalfunction; 2612 int (* API treeselectfunc)(HWND, HTREEITEM, char *, void *, void *) = (int (* API)(HWND, HTREEITEM, char *, void *, void *))tmp->signalfunction;
2612 2613
2613 if(dw_window_get_data(tmp->window, "_dw_container")) 2614 if(dw_window_get_data(tmp->window, "_dw_container"))
2614 result = treeselectfunc(tmp->window, 0, pci->rc.pszIcon, tmp->data, 0); 2615 result = treeselectfunc(tmp->window, 0, (char *)pci->rc.pszIcon, tmp->data, 0);
2615 else 2616 else
2616 { 2617 {
2617 if(lasthcnr == tmp->window && lastitem == (HWND)pci) 2618 if(lasthcnr == tmp->window && lastitem == (HWND)pci)
2618 { 2619 {
2619 lasthcnr = 0; 2620 lasthcnr = 0;
2621 } 2622 }
2622 else 2623 else
2623 { 2624 {
2624 lasthcnr = tmp->window; 2625 lasthcnr = tmp->window;
2625 lastitem = (HWND)pci; 2626 lastitem = (HWND)pci;
2626 result = treeselectfunc(tmp->window, (HTREEITEM)pci, pci->rc.pszIcon, tmp->data, pci->user); 2627 result = treeselectfunc(tmp->window, (HTREEITEM)pci, (char *)pci->rc.pszIcon, tmp->data, pci->user);
2627 } 2628 }
2628 } 2629 }
2629 tmp = NULL; 2630 tmp = NULL;
2630 } 2631 }
2631 } 2632 }
2636 break; 2637 break;
2637 case LN_SELECT: 2638 case LN_SELECT:
2638 { 2639 {
2639 char classbuf[100]; 2640 char classbuf[100];
2640 2641
2641 WinQueryClassName(tmp->window, 99, classbuf); 2642 WinQueryClassName(tmp->window, 99, (PCH)classbuf);
2642 2643
2643 if(strncmp(classbuf, "#38", 4) == 0) 2644 if(strncmp(classbuf, "#38", 4) == 0)
2644 { 2645 {
2645 int (* API valuechangedfunc)(HWND, int, void *) = (int (* API)(HWND, int, void *))tmp->signalfunction; 2646 int (* API valuechangedfunc)(HWND, int, void *) = (int (* API)(HWND, int, void *))tmp->signalfunction;
2646 2647
3549 void *blah; 3550 void *blah;
3550 3551
3551 hwndBubbleLast = hwnd; 3552 hwndBubbleLast = hwnd;
3552 hwndBubble = WinCreateWindow(HWND_DESKTOP, 3553 hwndBubble = WinCreateWindow(HWND_DESKTOP,
3553 WC_STATIC, 3554 WC_STATIC,
3554 "", 3555 NULL,
3555 SS_TEXT | 3556 SS_TEXT |
3556 DT_CENTER | 3557 DT_CENTER |
3557 DT_VCENTER, 3558 DT_VCENTER,
3558 0,0,0,0, 3559 0,0,0,0,
3559 HWND_DESKTOP, 3560 HWND_DESKTOP,
3572 PP_BACKGROUNDCOLORINDEX, 3573 PP_BACKGROUNDCOLORINDEX,
3573 sizeof(ulColor), 3574 sizeof(ulColor),
3574 &ulColor); 3575 &ulColor);
3575 3576
3576 WinSetWindowText(hwndBubble, 3577 WinSetWindowText(hwndBubble,
3577 bubble->bubbletext); 3578 (PSZ)bubble->bubbletext);
3578 3579
3579 WinMapWindowPoints(hwnd, HWND_DESKTOP, &ptlWork, 1); 3580 WinMapWindowPoints(hwnd, HWND_DESKTOP, &ptlWork, 1);
3580 3581
3581 hpsTemp = WinGetPS(hwndBubble); 3582 hpsTemp = WinGetPS(hwndBubble);
3582 GpiQueryTextBox(hpsTemp, 3583 GpiQueryTextBox(hpsTemp,
3583 strlen(bubble->bubbletext), 3584 strlen(bubble->bubbletext),
3584 bubble->bubbletext, 3585 (PCH)bubble->bubbletext,
3585 TXTBOX_COUNT, 3586 TXTBOX_COUNT,
3586 txtPointl); 3587 txtPointl);
3587 WinReleasePS(hpsTemp); 3588 WinReleasePS(hpsTemp);
3588 3589
3589 lWidth = txtPointl[TXTBOX_TOPRIGHT].x - 3590 lWidth = txtPointl[TXTBOX_TOPRIGHT].x -
3712 { 3713 {
3713 dwhab = WinInitialize(0); 3714 dwhab = WinInitialize(0);
3714 dwhmq = WinCreateMsgQueue(dwhab, 0); 3715 dwhmq = WinCreateMsgQueue(dwhab, 0);
3715 } 3716 }
3716 3717
3717 rc = WinRegisterClass(dwhab, ClassName, _wndproc, CS_SIZEREDRAW | CS_CLIPCHILDREN, 32); 3718 rc = WinRegisterClass(dwhab, (PSZ)ClassName, _wndproc, CS_SIZEREDRAW | CS_CLIPCHILDREN, 32);
3718 rc = WinRegisterClass(dwhab, SplitbarClassName, _splitwndproc, 0L, 32); 3719 rc = WinRegisterClass(dwhab, (PSZ)SplitbarClassName, _splitwndproc, 0L, 32);
3719 rc = WinRegisterClass(dwhab, ScrollClassName, _scrollwndproc, 0L, 32); 3720 rc = WinRegisterClass(dwhab, (PSZ)ScrollClassName, _scrollwndproc, 0L, 32);
3720 3721
3721 /* Get the OS/2 version. */ 3722 /* Get the OS/2 version. */
3722 DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_MS_COUNT,(void *)aulBuffer, 4*sizeof(ULONG)); 3723 DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_MS_COUNT,(void *)aulBuffer, 4*sizeof(ULONG));
3723 3724
3724 desktop = WinQueryDesktopWindow(dwhab, NULLHANDLE); 3725 desktop = WinQueryDesktopWindow(dwhab, NULLHANDLE);
3731 /* This is a window that hangs around as long as the 3732 /* This is a window that hangs around as long as the
3732 * application does and handles menu messages. 3733 * application does and handles menu messages.
3733 */ 3734 */
3734 hwndApp = dw_window_new(HWND_OBJECT, "", 0); 3735 hwndApp = dw_window_new(HWND_OBJECT, "", 0);
3735 /* Attempt to locate a tray server */ 3736 /* Attempt to locate a tray server */
3736 WinDdeInitiate(hwndApp, "SystrayServer", "TRAY", NULL); 3737 WinDdeInitiate(hwndApp, (PSZ)"SystrayServer", (PSZ)"TRAY", NULL);
3737 3738
3738 DosLoadModule(objnamebuf, sizeof(objnamebuf), "WPCONFIG", &wpconfig); 3739 /* Load DLLs for providing extra functionality if available */
3739 3740 DosLoadModule((PSZ)objnamebuf, sizeof(objnamebuf), (PSZ)"WPCONFIG", &wpconfig);
3741 if(!DosLoadModule((PSZ)objnamebuf, sizeof(objnamebuf), (PSZ)"PMPRINTF", &pmprintf))
3742 DosQueryProcAddr(pmprintf, 0, (PSZ)"PmPrintfString", (PFN*)&_PmPrintfString);
3740 return rc; 3743 return rc;
3741 } 3744 }
3742 3745
3743 /* 3746 /*
3744 * Runs a message loop for Dynamic Windows. 3747 * Runs a message loop for Dynamic Windows.
3903 char outbuf[1024]; 3906 char outbuf[1024];
3904 3907
3905 va_start(args, format); 3908 va_start(args, format);
3906 vsprintf(outbuf, format, args); 3909 vsprintf(outbuf, format, args);
3907 va_end(args); 3910 va_end(args);
3908 3911
3909 fprintf(stderr, "%s", outbuf); 3912 if(_PmPrintfString)
3913 _PmPrintfString(outbuf);
3914 else
3915 fprintf(stderr, "%s", outbuf);
3910 } 3916 }
3911 3917
3912 /* 3918 /*
3913 * Displays a Message Box with given text and title.. 3919 * Displays a Message Box with given text and title..
3914 * Parameters: 3920 * Parameters:
3925 3931
3926 va_start(args, format); 3932 va_start(args, format);
3927 vsprintf(outbuf, format, args); 3933 vsprintf(outbuf, format, args);
3928 va_end(args); 3934 va_end(args);
3929 3935
3930 rc = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, outbuf, title, 0, flags | MB_MOVEABLE); 3936 rc = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, (PSZ)outbuf, (PSZ)title, 0, flags | MB_MOVEABLE);
3931 if(rc == MBID_OK) 3937 if(rc == MBID_OK)
3932 return DW_MB_RETURN_OK; 3938 return DW_MB_RETURN_OK;
3933 else if(rc == MBID_YES) 3939 else if(rc == MBID_YES)
3934 return DW_MB_RETURN_YES; 3940 return DW_MB_RETURN_YES;
3935 else if(rc == MBID_NO) 3941 else if(rc == MBID_NO)
4190 } 4196 }
4191 4197
4192 /* Fill in the font dialog struct */ 4198 /* Fill in the font dialog struct */
4193 fd.cbSize = sizeof(fd); 4199 fd.cbSize = sizeof(fd);
4194 fd.hpsScreen = WinGetScreenPS(HWND_DESKTOP); 4200 fd.hpsScreen = WinGetScreenPS(HWND_DESKTOP);
4195 fd.pszTitle = "Choose Font"; 4201 fd.pszTitle = (PSZ)"Choose Font";
4196 fd.clrFore = CLR_BLACK; 4202 fd.clrFore = CLR_BLACK;
4197 fd.clrBack = CLR_WHITE; 4203 fd.clrBack = CLR_WHITE;
4198 fd.pszFamilyname = buf; 4204 fd.pszFamilyname = (PSZ)buf;
4199 fd.usFamilyBufLen = 100; 4205 fd.usFamilyBufLen = 100;
4200 fd.fxPointSize = MAKEFIXED(size,0); 4206 fd.fxPointSize = MAKEFIXED(size,0);
4201 fd.fl = FNTS_INITFROMFATTRS; 4207 fd.fl = FNTS_INITFROMFATTRS;
4202 4208
4203 /* Show the dialog and wait for a response */ 4209 /* Show the dialog and wait for a response */
4410 { 4416 {
4411 winStyle |= WS_MINIMIZED; 4417 winStyle |= WS_MINIMIZED;
4412 flStyle &= ~WS_MINIMIZED; 4418 flStyle &= ~WS_MINIMIZED;
4413 } 4419 }
4414 4420
4415 hwndframe = WinCreateStdWindow(hwndOwner, winStyle, &flStyle, ClassName, title, 0L, NULLHANDLE, 0L, &newbox->hwnd); 4421 hwndframe = WinCreateStdWindow(hwndOwner, winStyle, &flStyle, (PSZ)ClassName, (PSZ)title, 0L, NULLHANDLE, 0L, &newbox->hwnd);
4416 newbox->hwndtitle = WinWindowFromID(hwndframe, FID_TITLEBAR); 4422 newbox->hwndtitle = WinWindowFromID(hwndframe, FID_TITLEBAR);
4417 if(!newbox->titlebar && newbox->hwndtitle) 4423 if(!newbox->titlebar && newbox->hwndtitle)
4418 WinSetParent(newbox->hwndtitle, HWND_OBJECT, FALSE); 4424 WinSetParent(newbox->hwndtitle, HWND_OBJECT, FALSE);
4419 blah->oldproc = WinSubclassWindow(hwndframe, _sizeproc); 4425 blah->oldproc = WinSubclassWindow(hwndframe, _sizeproc);
4420 WinSetWindowPtr(hwndframe, QWP_USER, blah); 4426 WinSetWindowPtr(hwndframe, QWP_USER, blah);
4466 { 4472 {
4467 HWND hwndframe, box = dw_box_new(type, pad); 4473 HWND hwndframe, box = dw_box_new(type, pad);
4468 HWND client, tmpbox = dw_box_new(DW_VERT, 0); 4474 HWND client, tmpbox = dw_box_new(DW_VERT, 0);
4469 Box *blah = calloc(sizeof(Box), 1); 4475 Box *blah = calloc(sizeof(Box), 1);
4470 dw_box_pack_start(tmpbox, box, 1, 1, TRUE, TRUE, 0); 4476 dw_box_pack_start(tmpbox, box, 1, 1, TRUE, TRUE, 0);
4471 hwndframe = WinCreateWindow(HWND_OBJECT, ScrollClassName, "", WS_VISIBLE | WS_CLIPCHILDREN, 4477 hwndframe = WinCreateWindow(HWND_OBJECT, (PSZ)ScrollClassName, NULL, WS_VISIBLE | WS_CLIPCHILDREN,
4472 0, 0, 2000, 1000, NULLHANDLE, HWND_TOP, 0, NULL, NULL); 4478 0, 0, 2000, 1000, NULLHANDLE, HWND_TOP, 0, NULL, NULL);
4473 WinCreateWindow(hwndframe, WC_SCROLLBAR, "", WS_VISIBLE | SBS_AUTOTRACK | SBS_VERT, 4479 WinCreateWindow(hwndframe, WC_SCROLLBAR, NULL, WS_VISIBLE | SBS_AUTOTRACK | SBS_VERT,
4474 0,0,2000,1000, hwndframe, HWND_TOP, FID_VERTSCROLL, NULL, NULL); 4480 0,0,2000,1000, hwndframe, HWND_TOP, FID_VERTSCROLL, NULL, NULL);
4475 WinCreateWindow(hwndframe, WC_SCROLLBAR, "", WS_VISIBLE | SBS_AUTOTRACK | SBS_HORZ, 4481 WinCreateWindow(hwndframe, WC_SCROLLBAR, NULL, WS_VISIBLE | SBS_AUTOTRACK | SBS_HORZ,
4476 0,0,2000,1000, hwndframe, HWND_TOP, FID_HORZSCROLL, NULL, NULL); 4482 0,0,2000,1000, hwndframe, HWND_TOP, FID_HORZSCROLL, NULL, NULL);
4477 client = WinCreateWindow(hwndframe, WC_FRAME, "", WS_VISIBLE | WS_CLIPCHILDREN, 4483 client = WinCreateWindow(hwndframe, WC_FRAME, NULL, WS_VISIBLE | WS_CLIPCHILDREN,
4478 0,0,2000,1000, NULLHANDLE, HWND_TOP, FID_CLIENT, NULL, NULL); 4484 0,0,2000,1000, NULLHANDLE, HWND_TOP, FID_CLIENT, NULL, NULL);
4479 WinSetParent(tmpbox, client, FALSE); 4485 WinSetParent(tmpbox, client, FALSE);
4480 WinSetWindowPtr(client, QWP_USER, blah); 4486 WinSetWindowPtr(client, QWP_USER, blah);
4481 dw_window_set_data(hwndframe, "_dw_resizebox", (void *)tmpbox); 4487 dw_window_set_data(hwndframe, "_dw_resizebox", (void *)tmpbox);
4482 dw_window_set_data(hwndframe, "_dw_box", (void *)box); 4488 dw_window_set_data(hwndframe, "_dw_box", (void *)box);
4553 NULL, 4559 NULL,
4554 NULL); 4560 NULL);
4555 4561
4556 newbox->grouphwnd = WinCreateWindow(newbox->hwnd, 4562 newbox->grouphwnd = WinCreateWindow(newbox->hwnd,
4557 WC_STATIC, 4563 WC_STATIC,
4558 title, 4564 (PSZ)title,
4559 WS_VISIBLE | SS_GROUPBOX | 4565 WS_VISIBLE | SS_GROUPBOX |
4560 WS_GROUP, 4566 WS_GROUP,
4561 0,0,2000,1000, 4567 0,0,2000,1000,
4562 NULLHANDLE, 4568 NULLHANDLE,
4563 HWND_TOP, 4569 HWND_TOP,
5035 HWND API dw_text_new(char *text, ULONG id) 5041 HWND API dw_text_new(char *text, ULONG id)
5036 { 5042 {
5037 WindowData *blah = calloc(sizeof(WindowData), 1); 5043 WindowData *blah = calloc(sizeof(WindowData), 1);
5038 HWND tmp = WinCreateWindow(HWND_OBJECT, 5044 HWND tmp = WinCreateWindow(HWND_OBJECT,
5039 WC_STATIC, 5045 WC_STATIC,
5040 text, 5046 (PSZ)text,
5041 WS_VISIBLE | SS_TEXT, 5047 WS_VISIBLE | SS_TEXT,
5042 0,0,2000,1000, 5048 0,0,2000,1000,
5043 NULLHANDLE, 5049 NULLHANDLE,
5044 HWND_TOP, 5050 HWND_TOP,
5045 id, 5051 id,
5061 HWND API dw_status_text_new(char *text, ULONG id) 5067 HWND API dw_status_text_new(char *text, ULONG id)
5062 { 5068 {
5063 WindowData *blah = calloc(sizeof(WindowData), 1); 5069 WindowData *blah = calloc(sizeof(WindowData), 1);
5064 HWND tmp = WinCreateWindow(HWND_OBJECT, 5070 HWND tmp = WinCreateWindow(HWND_OBJECT,
5065 WC_STATIC, 5071 WC_STATIC,
5066 text, 5072 (PSZ)text,
5067 WS_VISIBLE | SS_TEXT, 5073 WS_VISIBLE | SS_TEXT,
5068 0,0,2000,1000, 5074 0,0,2000,1000,
5069 NULLHANDLE, 5075 NULLHANDLE,
5070 HWND_TOP, 5076 HWND_TOP,
5071 id, 5077 id,
5090 HWND API dw_mle_new(ULONG id) 5096 HWND API dw_mle_new(ULONG id)
5091 { 5097 {
5092 WindowData *blah = calloc(1, sizeof(WindowData)); 5098 WindowData *blah = calloc(1, sizeof(WindowData));
5093 HWND tmp = WinCreateWindow(HWND_OBJECT, 5099 HWND tmp = WinCreateWindow(HWND_OBJECT,
5094 WC_MLE, 5100 WC_MLE,
5095 "", 5101 NULL,
5096 WS_VISIBLE | 5102 WS_VISIBLE |
5097 MLS_BORDER | MLS_IGNORETAB | 5103 MLS_BORDER | MLS_IGNORETAB |
5098 MLS_VSCROLL | 5104 MLS_VSCROLL |
5099 MLS_LIMITVSCROLL, 5105 MLS_LIMITVSCROLL,
5100 0,0,2000,1000, 5106 0,0,2000,1000,
5120 { 5126 {
5121 5127
5122 WindowData *blah = calloc(1, sizeof(WindowData)); 5128 WindowData *blah = calloc(1, sizeof(WindowData));
5123 HWND tmp = WinCreateWindow(HWND_OBJECT, 5129 HWND tmp = WinCreateWindow(HWND_OBJECT,
5124 WC_ENTRYFIELD, 5130 WC_ENTRYFIELD,
5125 text, 5131 (PSZ)text,
5126 WS_VISIBLE | ES_MARGIN | 5132 WS_VISIBLE | ES_MARGIN |
5127 ES_AUTOSCROLL | WS_TABSTOP, 5133 ES_AUTOSCROLL | WS_TABSTOP,
5128 0,0,2000,1000, 5134 0,0,2000,1000,
5129 NULLHANDLE, 5135 NULLHANDLE,
5130 HWND_TOP, 5136 HWND_TOP,
5147 HWND API dw_entryfield_password_new(char *text, ULONG id) 5153 HWND API dw_entryfield_password_new(char *text, ULONG id)
5148 { 5154 {
5149 WindowData *blah = calloc(1, sizeof(WindowData)); 5155 WindowData *blah = calloc(1, sizeof(WindowData));
5150 HWND tmp = WinCreateWindow(HWND_OBJECT, 5156 HWND tmp = WinCreateWindow(HWND_OBJECT,
5151 WC_ENTRYFIELD, 5157 WC_ENTRYFIELD,
5152 text, 5158 (PSZ)text,
5153 WS_VISIBLE | ES_MARGIN | ES_UNREADABLE | 5159 WS_VISIBLE | ES_MARGIN | ES_UNREADABLE |
5154 ES_AUTOSCROLL | WS_TABSTOP, 5160 ES_AUTOSCROLL | WS_TABSTOP,
5155 0,0,2000,1000, 5161 0,0,2000,1000,
5156 NULLHANDLE, 5162 NULLHANDLE,
5157 HWND_TOP, 5163 HWND_TOP,
5175 { 5181 {
5176 WindowData *blah = calloc(1, sizeof(WindowData)); 5182 WindowData *blah = calloc(1, sizeof(WindowData));
5177 HWND frame = dw_box_new(DW_HORZ, 0); 5183 HWND frame = dw_box_new(DW_HORZ, 0);
5178 HWND tmp = WinCreateWindow(frame, 5184 HWND tmp = WinCreateWindow(frame,
5179 WC_COMBOBOX, 5185 WC_COMBOBOX,
5180 text, 5186 (PSZ)text,
5181 WS_VISIBLE | CBS_DROPDOWN | WS_GROUP, 5187 WS_VISIBLE | CBS_DROPDOWN | WS_GROUP,
5182 0,0,2000,1000, 5188 0,0,2000,1000,
5183 NULLHANDLE, 5189 NULLHANDLE,
5184 HWND_TOP, 5190 HWND_TOP,
5185 id ? id : _GlobalID(), 5191 id ? id : _GlobalID(),
5217 { 5223 {
5218 BubbleButton *bubble = calloc(sizeof(BubbleButton), 1); 5224 BubbleButton *bubble = calloc(sizeof(BubbleButton), 1);
5219 5225
5220 HWND tmp = WinCreateWindow(HWND_OBJECT, 5226 HWND tmp = WinCreateWindow(HWND_OBJECT,
5221 WC_BUTTON, 5227 WC_BUTTON,
5222 text, 5228 (PSZ)text,
5223 WS_VISIBLE, 5229 WS_VISIBLE,
5224 0,0,2000,1000, 5230 0,0,2000,1000,
5225 NULLHANDLE, 5231 NULLHANDLE,
5226 HWND_TOP, 5232 HWND_TOP,
5227 id, 5233 id,
5290 _GenResIDStr(idbuf, id); 5296 _GenResIDStr(idbuf, id);
5291 } 5297 }
5292 5298
5293 tmp = WinCreateWindow(HWND_OBJECT, 5299 tmp = WinCreateWindow(HWND_OBJECT,
5294 WC_BUTTON, 5300 WC_BUTTON,
5295 name, 5301 (PSZ)name,
5296 WS_VISIBLE | BS_PUSHBUTTON | 5302 WS_VISIBLE | BS_PUSHBUTTON |
5297 BS_NOPOINTERFOCUS | BS_AUTOSIZE | 5303 BS_NOPOINTERFOCUS | BS_AUTOSIZE |
5298 (icon ? 0 : BS_BITMAP), 5304 (icon ? 0 : BS_BITMAP),
5299 0,0,2000,1000, 5305 0,0,2000,1000,
5300 NULLHANDLE, 5306 NULLHANDLE,
5328 HWND API dw_bitmapbutton_new_from_file(char *text, unsigned long id, char *filename) 5334 HWND API dw_bitmapbutton_new_from_file(char *text, unsigned long id, char *filename)
5329 { 5335 {
5330 BubbleButton *bubble = calloc(sizeof(BubbleButton), 1); 5336 BubbleButton *bubble = calloc(sizeof(BubbleButton), 1);
5331 HWND tmp = WinCreateWindow(HWND_OBJECT, 5337 HWND tmp = WinCreateWindow(HWND_OBJECT,
5332 WC_BUTTON, 5338 WC_BUTTON,
5333 "", 5339 NULL,
5334 WS_VISIBLE | BS_PUSHBUTTON | 5340 WS_VISIBLE | BS_PUSHBUTTON |
5335 BS_AUTOSIZE | BS_NOPOINTERFOCUS, 5341 BS_AUTOSIZE | BS_NOPOINTERFOCUS,
5336 0,0,2000,1000, 5342 0,0,2000,1000,
5337 NULLHANDLE, 5343 NULLHANDLE,
5338 HWND_TOP, 5344 HWND_TOP,
5355 { 5361 {
5356 len = strlen( file ); 5362 len = strlen( file );
5357 if(len > 4) 5363 if(len > 4)
5358 { 5364 {
5359 if(stricmp(file + len - 4, ".ico") == 0) 5365 if(stricmp(file + len - 4, ".ico") == 0)
5360 icon = WinLoadFileIcon(file, FALSE); 5366 icon = WinLoadFileIcon((PSZ)file, FALSE);
5361 else 5367 else
5362 _load_bitmap_file(file, tmp, &pixmap->hbm, &pixmap->hdc, &pixmap->hps, &pixmap->width, &pixmap->height); 5368 _load_bitmap_file(file, tmp, &pixmap->hbm, &pixmap->hdc, &pixmap->hps, &pixmap->width, &pixmap->height);
5363 } 5369 }
5364 } 5370 }
5365 else 5371 else
5366 { 5372 {
5367 /* Try with .ico extension first...*/ 5373 /* Try with .ico extension first...*/
5368 strcat(file, ".ico"); 5374 strcat(file, ".ico");
5369 if(access(file, 04) == 0) 5375 if(access(file, 04) == 0)
5370 icon = WinLoadFileIcon(file, FALSE); 5376 icon = WinLoadFileIcon((PSZ)file, FALSE);
5371 else 5377 else
5372 { 5378 {
5373 strcpy(file, filename); 5379 strcpy(file, filename);
5374 strcat(file, ".bmp"); 5380 strcat(file, ".bmp");
5375 if(access(file, 04) == 0) 5381 if(access(file, 04) == 0)
5433 { 5439 {
5434 FILE *fp; 5440 FILE *fp;
5435 BubbleButton *bubble = calloc(sizeof(BubbleButton), 1); 5441 BubbleButton *bubble = calloc(sizeof(BubbleButton), 1);
5436 HWND tmp = WinCreateWindow(HWND_OBJECT, 5442 HWND tmp = WinCreateWindow(HWND_OBJECT,
5437 WC_BUTTON, 5443 WC_BUTTON,
5438 "", 5444 NULL,
5439 WS_VISIBLE | BS_PUSHBUTTON | 5445 WS_VISIBLE | BS_PUSHBUTTON |
5440 BS_AUTOSIZE | BS_NOPOINTERFOCUS, 5446 BS_AUTOSIZE | BS_NOPOINTERFOCUS,
5441 0,0,2000,1000, 5447 0,0,2000,1000,
5442 NULLHANDLE, 5448 NULLHANDLE,
5443 HWND_TOP, 5449 HWND_TOP,
5464 { 5470 {
5465 _load_bitmap_file( file, tmp, &pixmap->hbm, &pixmap->hdc, &pixmap->hps, &pixmap->width, &pixmap->height ); 5471 _load_bitmap_file( file, tmp, &pixmap->hbm, &pixmap->hdc, &pixmap->hps, &pixmap->width, &pixmap->height );
5466 } 5472 }
5467 else /* otherwise its assumed to be an ico */ 5473 else /* otherwise its assumed to be an ico */
5468 { 5474 {
5469 icon = WinLoadFileIcon(file, FALSE); 5475 icon = WinLoadFileIcon((PSZ)file, FALSE);
5470 } 5476 }
5471 } 5477 }
5472 else 5478 else
5473 { 5479 {
5474 unlink( file ); 5480 unlink( file );
5529 HWND API dw_spinbutton_new(char *text, ULONG id) 5535 HWND API dw_spinbutton_new(char *text, ULONG id)
5530 { 5536 {
5531 WindowData *blah = calloc(sizeof(WindowData), 1); 5537 WindowData *blah = calloc(sizeof(WindowData), 1);
5532 HWND tmp = WinCreateWindow(HWND_OBJECT, 5538 HWND tmp = WinCreateWindow(HWND_OBJECT,
5533 WC_SPINBUTTON, 5539 WC_SPINBUTTON,
5534 text, 5540 (PSZ)text,
5535 WS_VISIBLE | SPBS_MASTER, 5541 WS_VISIBLE | SPBS_MASTER,
5536 0,0,2000,1000, 5542 0,0,2000,1000,
5537 NULLHANDLE, 5543 NULLHANDLE,
5538 HWND_TOP, 5544 HWND_TOP,
5539 id, 5545 id,
5562 HWND API dw_radiobutton_new(char *text, ULONG id) 5568 HWND API dw_radiobutton_new(char *text, ULONG id)
5563 { 5569 {
5564 WindowData *blah = calloc(sizeof(WindowData), 1); 5570 WindowData *blah = calloc(sizeof(WindowData), 1);
5565 HWND tmp = WinCreateWindow(HWND_OBJECT, 5571 HWND tmp = WinCreateWindow(HWND_OBJECT,
5566 WC_BUTTON, 5572 WC_BUTTON,
5567 text, 5573 (PSZ)text,
5568 WS_VISIBLE | 5574 WS_VISIBLE |
5569 BS_AUTORADIOBUTTON, 5575 BS_AUTORADIOBUTTON,
5570 0,0,2000,1000, 5576 0,0,2000,1000,
5571 NULLHANDLE, 5577 NULLHANDLE,
5572 HWND_TOP, 5578 HWND_TOP,
5597 sldcData.cbSize = sizeof(SLDCDATA); 5603 sldcData.cbSize = sizeof(SLDCDATA);
5598 sldcData.usScale1Increments = increments; 5604 sldcData.usScale1Increments = increments;
5599 5605
5600 tmp = WinCreateWindow(HWND_OBJECT, 5606 tmp = WinCreateWindow(HWND_OBJECT,
5601 WC_SLIDER, 5607 WC_SLIDER,
5602 "", 5608 NULL,
5603 WS_VISIBLE | SLS_SNAPTOINCREMENT | 5609 WS_VISIBLE | SLS_SNAPTOINCREMENT |
5604 (vertical ? SLS_VERTICAL : SLS_HORIZONTAL), 5610 (vertical ? SLS_VERTICAL : SLS_HORIZONTAL),
5605 0,0,2000,1000, 5611 0,0,2000,1000,
5606 NULLHANDLE, 5612 NULLHANDLE,
5607 HWND_TOP, 5613 HWND_TOP,
5623 */ 5629 */
5624 HWND API dw_scrollbar_new(int vertical, ULONG id) 5630 HWND API dw_scrollbar_new(int vertical, ULONG id)
5625 { 5631 {
5626 return WinCreateWindow(HWND_OBJECT, 5632 return WinCreateWindow(HWND_OBJECT,
5627 WC_SCROLLBAR, 5633 WC_SCROLLBAR,
5628 "", 5634 NULL,
5629 WS_VISIBLE | SBS_AUTOTRACK | 5635 WS_VISIBLE | SBS_AUTOTRACK |
5630 (vertical ? SBS_VERT : SBS_HORZ), 5636 (vertical ? SBS_VERT : SBS_HORZ),
5631 0,0,2000,1000, 5637 0,0,2000,1000,
5632 NULLHANDLE, 5638 NULLHANDLE,
5633 HWND_TOP, 5639 HWND_TOP,
5644 HWND API dw_percent_new(ULONG id) 5650 HWND API dw_percent_new(ULONG id)
5645 { 5651 {
5646 WindowData *blah = calloc(1, sizeof(WindowData)); 5652 WindowData *blah = calloc(1, sizeof(WindowData));
5647 HWND tmp = WinCreateWindow(HWND_OBJECT, 5653 HWND tmp = WinCreateWindow(HWND_OBJECT,
5648 WC_SLIDER, 5654 WC_SLIDER,
5649 "", 5655 NULL,
5650 WS_VISIBLE | SLS_READONLY 5656 WS_VISIBLE | SLS_READONLY
5651 | SLS_RIBBONSTRIP, 5657 | SLS_RIBBONSTRIP,
5652 0,0,2000,1000, 5658 0,0,2000,1000,
5653 NULLHANDLE, 5659 NULLHANDLE,
5654 HWND_TOP, 5660 HWND_TOP,
5670 HWND API dw_checkbox_new(char *text, ULONG id) 5676 HWND API dw_checkbox_new(char *text, ULONG id)
5671 { 5677 {
5672 BubbleButton *bubble = calloc(sizeof(BubbleButton), 1); 5678 BubbleButton *bubble = calloc(sizeof(BubbleButton), 1);
5673 HWND tmp = WinCreateWindow(HWND_OBJECT, 5679 HWND tmp = WinCreateWindow(HWND_OBJECT,
5674 WC_BUTTON, 5680 WC_BUTTON,
5675 text, 5681 (PSZ)text,
5676 WS_VISIBLE | BS_AUTOCHECKBOX, 5682 WS_VISIBLE | BS_AUTOCHECKBOX,
5677 0,0,2000,1000, 5683 0,0,2000,1000,
5678 NULLHANDLE, 5684 NULLHANDLE,
5679 HWND_TOP, 5685 HWND_TOP,
5680 id, 5686 id,
5744 HPS hps1; 5750 HPS hps1;
5745 HDC hdc1; 5751 HDC hdc1;
5746 SIZEL sizl = { 0, 0 }; 5752 SIZEL sizl = { 0, 0 };
5747 5753
5748 /* open bitmap file */ 5754 /* open bitmap file */
5749 DosOpen(file, &BitmapFileHandle, &OpenAction, 0L, 5755 DosOpen((PSZ)file, &BitmapFileHandle, &OpenAction, 0L,
5750 FILE_ARCHIVED | FILE_NORMAL | FILE_READONLY, 5756 FILE_ARCHIVED | FILE_NORMAL | FILE_READONLY,
5751 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS, 5757 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
5752 OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY | 5758 OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY |
5753 OPEN_FLAGS_NOINHERIT, 0L); 5759 OPEN_FLAGS_NOINHERIT, 0L);
5754 5760
5808 hps1 = WinGetPS(handle); 5814 hps1 = WinGetPS(handle);
5809 5815
5810 hdc1 = GpiQueryDevice(hps1); 5816 hdc1 = GpiQueryDevice(hps1);
5811 ulFlags = GpiQueryPS(hps1, &sizl); 5817 ulFlags = GpiQueryPS(hps1, &sizl);
5812 5818
5813 *hdc = DevOpenDC(dwhab, OD_MEMORY, "*", 0L, NULL, hdc1); 5819 *hdc = DevOpenDC(dwhab, OD_MEMORY, (PSZ)"*", 0L, NULL, hdc1);
5814 *hps = GpiCreatePS (dwhab, *hdc, &sizl, ulFlags | GPIA_ASSOC); 5820 *hps = GpiCreatePS (dwhab, *hdc, &sizl, ulFlags | GPIA_ASSOC);
5815 5821
5816 /* create bitmap now using the parameters from the info block */ 5822 /* create bitmap now using the parameters from the info block */
5817 *hbm = GpiCreateBitmap(*hps, pBitmapInfoHeader, 0L, NULL, NULL); 5823 *hbm = GpiCreateBitmap(*hps, pBitmapInfoHeader, 0L, NULL, NULL);
5818 5824
5972 * text: The text associsated with a given window. 5978 * text: The text associsated with a given window.
5973 */ 5979 */
5974 void API dw_window_set_text(HWND handle, char *text) 5980 void API dw_window_set_text(HWND handle, char *text)
5975 { 5981 {
5976 HWND entryfield = (HWND)dw_window_get_data(handle, "_dw_buddy"); 5982 HWND entryfield = (HWND)dw_window_get_data(handle, "_dw_buddy");
5977 WinSetWindowText(entryfield ? entryfield : handle, text); 5983 WinSetWindowText(entryfield ? entryfield : handle, (PSZ)text);
5978 } 5984 }
5979 5985
5980 /* 5986 /*
5981 * Gets the text used for a given window. 5987 * Gets the text used for a given window.
5982 * Parameters: 5988 * Parameters:
5988 { 5994 {
5989 HWND entryfield = (HWND)dw_window_get_data(handle, "_dw_buddy"); 5995 HWND entryfield = (HWND)dw_window_get_data(handle, "_dw_buddy");
5990 int len = WinQueryWindowTextLength(entryfield ? entryfield : handle); 5996 int len = WinQueryWindowTextLength(entryfield ? entryfield : handle);
5991 char *tempbuf = calloc(1, len + 2); 5997 char *tempbuf = calloc(1, len + 2);
5992 5998
5993 WinQueryWindowText(entryfield ? entryfield : handle, len + 1, tempbuf); 5999 WinQueryWindowText(entryfield ? entryfield : handle, len + 1, (PSZ)tempbuf);
5994 6000
5995 return tempbuf; 6001 return tempbuf;
5996 } 6002 }
5997 6003
5998 /* 6004 /*
6018 } 6024 }
6019 6025
6020 if(dw_window_get_data(handle, "_dw_disabled")) 6026 if(dw_window_get_data(handle, "_dw_disabled"))
6021 return; 6027 return;
6022 6028
6023 WinQueryClassName(handle, 99, tmpbuf); 6029 WinQueryClassName(handle, 99, (PCH)tmpbuf);
6024 dw_window_set_data(handle, "_dw_disabled", (void *)1); 6030 dw_window_set_data(handle, "_dw_disabled", (void *)1);
6025 6031
6026 if(tmpbuf[0] == '#') 6032 if(tmpbuf[0] == '#')
6027 { 6033 {
6028 int val = atoi(&tmpbuf[1]); 6034 int val = atoi(&tmpbuf[1]);
6109 while((child = WinGetNextWindow(henum)) != NULLHANDLE) 6115 while((child = WinGetNextWindow(henum)) != NULLHANDLE)
6110 { 6116 {
6111 int windowid = WinQueryWindowUShort(child, QWS_ID); 6117 int windowid = WinQueryWindowUShort(child, QWS_ID);
6112 HWND found; 6118 HWND found;
6113 6119
6114 WinQueryClassName(child, 99, tmpbuf); 6120 WinQueryClassName(child, 99, (PCH)tmpbuf);
6115 6121
6116 /* If the child is a box (frame) then recurse into it */ 6122 /* If the child is a box (frame) then recurse into it */
6117 if(strncmp(tmpbuf, "#1", 3)==0) 6123 if(strncmp(tmpbuf, "#1", 3)==0)
6118 if((found = dw_window_from_id(child, id)) != NULLHANDLE) 6124 if((found = dw_window_from_id(child, id)) != NULLHANDLE)
6119 return found; 6125 return found;
6181 tmpitem[x] = thisitem[z]; 6187 tmpitem[x] = thisitem[z];
6182 x++; 6188 x++;
6183 } 6189 }
6184 6190
6185 6191
6186 WinQueryClassName(item, 99, tmpbuf); 6192 WinQueryClassName(item, 99, (PCH)tmpbuf);
6187 6193
6188 if(vsize && !height) 6194 if(vsize && !height)
6189 height = 1; 6195 height = 1;
6190 if(hsize && !width) 6196 if(hsize && !width)
6191 width = 1; 6197 width = 1;
6221 if(thisbox->count) 6227 if(thisbox->count)
6222 free(thisitem); 6228 free(thisitem);
6223 6229
6224 thisbox->count++; 6230 thisbox->count++;
6225 6231
6226 WinQueryClassName(item, 99, tmpbuf); 6232 WinQueryClassName(item, 99, (PCH)tmpbuf);
6227 /* Don't set the ownership if it's an entryfield or spinbutton */ 6233 /* Don't set the ownership if it's an entryfield or spinbutton */
6228 if(strncmp(tmpbuf, "#6", 3)!=0 && strncmp(tmpbuf, "#32", 4)!=0 && strncmp(tmpbuf, "#2", 3)!=0) 6234 if(strncmp(tmpbuf, "#6", 3)!=0 && strncmp(tmpbuf, "#32", 4)!=0 && strncmp(tmpbuf, "#2", 3)!=0)
6229 WinSetOwner(item, box); 6235 WinSetOwner(item, box);
6230 WinSetParent(frame ? frame : item, box, FALSE); 6236 WinSetParent(frame ? frame : item, box, FALSE);
6231 } 6237 }
6645 { 6651 {
6646 char tmpbuf[100]; 6652 char tmpbuf[100];
6647 6653
6648 WinSendMsg(handle, LM_SELECTITEM, MPFROMSHORT(index), (MPARAM)state); 6654 WinSendMsg(handle, LM_SELECTITEM, MPFROMSHORT(index), (MPARAM)state);
6649 6655
6650 WinQueryClassName(handle, 99, tmpbuf); 6656 WinQueryClassName(handle, 99, (PCH)tmpbuf);
6651 6657
6652 /* If we are setting a combobox call the event handler manually */ 6658 /* If we are setting a combobox call the event handler manually */
6653 if(strncmp(tmpbuf, "#6", 3)==0) 6659 if(strncmp(tmpbuf, "#6", 3)==0)
6654 _run_event(handle, WM_CONTROL, MPFROM2SHORT(0, LN_SELECT), (MPARAM)handle); 6660 _run_event(handle, WM_CONTROL, MPFROM2SHORT(0, LN_SELECT), (MPARAM)handle);
6655 } 6661 }
7117 return 0; 7123 return 0;
7118 7124
7119 /* Fill in the parent record data */ 7125 /* Fill in the parent record data */
7120 7126
7121 pci->rc.cb = sizeof(MINIRECORDCORE); 7127 pci->rc.cb = sizeof(MINIRECORDCORE);
7122 pci->rc.pszIcon = strdup(title); 7128 pci->rc.pszIcon = (PSZ)strdup(title);
7123 pci->rc.hptrIcon = icon; 7129 pci->rc.hptrIcon = icon;
7124 7130
7125 pci->hptrIcon = icon; 7131 pci->hptrIcon = icon;
7126 pci->user = itemdata; 7132 pci->user = itemdata;
7127 pci->parent = parent; 7133 pci->parent = parent;
7175 return; 7181 return;
7176 7182
7177 if(pci->rc.pszIcon) 7183 if(pci->rc.pszIcon)
7178 free(pci->rc.pszIcon); 7184 free(pci->rc.pszIcon);
7179 7185
7180 pci->rc.pszIcon = strdup(title); 7186 pci->rc.pszIcon = (PSZ)strdup(title);
7181 pci->rc.hptrIcon = icon; 7187 pci->rc.hptrIcon = icon;
7182 7188
7183 pci->hptrIcon = icon; 7189 pci->hptrIcon = icon;
7184 7190
7185 WinSendMsg(handle, CM_INVALIDATERECORD, (MPARAM)&pci, MPFROM2SHORT(1, CMA_TEXTCHANGED)); 7191 WinSendMsg(handle, CM_INVALIDATERECORD, (MPARAM)&pci, MPFROM2SHORT(1, CMA_TEXTCHANGED));
7195 { 7201 {
7196 PCNRITEM pci = (PCNRITEM)item; 7202 PCNRITEM pci = (PCNRITEM)item;
7197 7203
7198 handle = handle; /* keep compiler happy */ 7204 handle = handle; /* keep compiler happy */
7199 if(pci) 7205 if(pci)
7200 return pci->rc.pszIcon; 7206 return (char *)pci->rc.pszIcon;
7201 return NULL; 7207 return NULL;
7202 } 7208 }
7203 7209
7204 /* 7210 /*
7205 * Gets the text an item in a tree window (widget). 7211 * Gets the text an item in a tree window (widget).
7498 /* Try with .bmp extention */ 7504 /* Try with .bmp extention */
7499 strcat(file, ".ico"); 7505 strcat(file, ".ico");
7500 if(access(file, 04) != 0) 7506 if(access(file, 04) != 0)
7501 return 0; 7507 return 0;
7502 } 7508 }
7503 return WinLoadFileIcon(file, FALSE); 7509 return WinLoadFileIcon((PSZ)file, FALSE);
7504 } 7510 }
7505 7511
7506 /* 7512 /*
7507 * Obtains an icon from data 7513 * Obtains an icon from data
7508 * Parameters: 7514 * Parameters:
7524 fp = fopen( file, "wb" ); 7530 fp = fopen( file, "wb" );
7525 if ( fp != NULL ) 7531 if ( fp != NULL )
7526 { 7532 {
7527 fwrite( data, 1, len, fp ); 7533 fwrite( data, 1, len, fp );
7528 fclose( fp ); 7534 fclose( fp );
7529 icon = WinLoadFileIcon( file, FALSE ); 7535 icon = WinLoadFileIcon( (PSZ)file, FALSE );
7530 } 7536 }
7531 else 7537 else
7532 { 7538 {
7533 unlink( file ); 7539 unlink( file );
7534 return 0; 7540 return 0;
7909 currentcount = cnr.cRecords; 7915 currentcount = cnr.cRecords;
7910 7916
7911 for(z=0;z<(row-currentcount);z++) 7917 for(z=0;z<(row-currentcount);z++)
7912 temp = temp->preccNextRecord; 7918 temp = temp->preccNextRecord;
7913 7919
7914 temp->pszIcon = title; 7920 temp->pszIcon = (PSZ)title;
7915 temp->pszName = title; 7921 temp->pszName = (PSZ)title;
7916 temp->pszText = title; 7922 temp->pszText = (PSZ)title;
7917 } 7923 }
7918 7924
7919 /* 7925 /*
7920 * Changes the title of a row already inserted in the container. 7926 * Changes the title of a row already inserted in the container.
7921 * Parameters: 7927 * Parameters:
7930 7936
7931 while(pCore) 7937 while(pCore)
7932 { 7938 {
7933 if(count == row) 7939 if(count == row)
7934 { 7940 {
7935 pCore->pszIcon = title; 7941 pCore->pszIcon = (PSZ)title;
7936 pCore->pszName = title; 7942 pCore->pszName = (PSZ)title;
7937 pCore->pszText = title; 7943 pCore->pszText = (PSZ)title;
7938 7944
7939 WinSendMsg(handle, CM_INVALIDATERECORD, (MPARAM)&pCore, MPFROM2SHORT(1, CMA_NOREPOSITION | CMA_TEXTCHANGED)); 7945 WinSendMsg(handle, CM_INVALIDATERECORD, (MPARAM)&pCore, MPFROM2SHORT(1, CMA_NOREPOSITION | CMA_TEXTCHANGED));
7940 return; 7946 return;
7941 } 7947 }
7942 pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); 7948 pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
8102 while(pCore) 8108 while(pCore)
8103 { 8109 {
8104 if(pCore->flRecordAttr & flags) 8110 if(pCore->flRecordAttr & flags)
8105 { 8111 {
8106 dw_window_set_data(handle, "_dw_pcore", (void *)pCore); 8112 dw_window_set_data(handle, "_dw_pcore", (void *)pCore);
8107 return pCore->pszIcon; 8113 return (char *)pCore->pszIcon;
8108 } 8114 }
8109 pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); 8115 pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
8110 } 8116 }
8111 } 8117 }
8112 else 8118 else
8113 { 8119 {
8114 dw_window_set_data(handle, "_dw_pcore", (void *)pCore); 8120 dw_window_set_data(handle, "_dw_pcore", (void *)pCore);
8115 return pCore->pszIcon; 8121 return (char *)pCore->pszIcon;
8116 } 8122 }
8117 } 8123 }
8118 return NULL; 8124 return NULL;
8119 } 8125 }
8120 8126
8139 while(pCore) 8145 while(pCore)
8140 { 8146 {
8141 if(pCore->flRecordAttr & flags) 8147 if(pCore->flRecordAttr & flags)
8142 { 8148 {
8143 dw_window_set_data(handle, "_dw_pcore", (void *)pCore); 8149 dw_window_set_data(handle, "_dw_pcore", (void *)pCore);
8144 return pCore->pszIcon; 8150 return (char *)pCore->pszIcon;
8145 } 8151 }
8146 8152
8147 pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); 8153 pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
8148 } 8154 }
8149 } 8155 }
8150 else 8156 else
8151 { 8157 {
8152 dw_window_set_data(handle, "_dw_pcore", (void *)pCore); 8158 dw_window_set_data(handle, "_dw_pcore", (void *)pCore);
8153 return pCore->pszIcon; 8159 return (char *)pCore->pszIcon;
8154 } 8160 }
8155 } 8161 }
8156 return NULL; 8162 return NULL;
8157 } 8163 }
8158 8164
8168 PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 8174 PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
8169 int textcomp = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_textcomp")); 8175 int textcomp = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_textcomp"));
8170 8176
8171 while(pCore) 8177 while(pCore)
8172 { 8178 {
8173 if((textcomp && pCore->pszIcon && strcmp(pCore->pszIcon, text) == 0) || (!textcomp && (char *)pCore->pszIcon == text)) 8179 if((textcomp && pCore->pszIcon && strcmp((char *)pCore->pszIcon, text) == 0) || (!textcomp && (char *)pCore->pszIcon == text))
8174 { 8180 {
8175 QUERYRECORDRECT qrr; 8181 QUERYRECORDRECT qrr;
8176 int scrollpixels = 0, midway; 8182 int scrollpixels = 0, midway;
8177 8183
8178 qrr.cb = sizeof(QUERYRECORDRECT); 8184 qrr.cb = sizeof(QUERYRECORDRECT);
8206 PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 8212 PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
8207 int textcomp = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_textcomp")); 8213 int textcomp = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_textcomp"));
8208 8214
8209 while(pCore) 8215 while(pCore)
8210 { 8216 {
8211 if((textcomp && pCore->pszIcon && strcmp(pCore->pszIcon, text) == 0) || (!textcomp && (char *)pCore->pszIcon == text)) 8217 if((textcomp && pCore->pszIcon && strcmp((char *)pCore->pszIcon, text) == 0) || (!textcomp && (char *)pCore->pszIcon == text))
8212 { 8218 {
8213 WinSendMsg(handle, CM_REMOVERECORD, (MPARAM)&pCore, MPFROM2SHORT(1, CMA_FREE | CMA_INVALIDATE)); 8219 WinSendMsg(handle, CM_REMOVERECORD, (MPARAM)&pCore, MPFROM2SHORT(1, CMA_FREE | CMA_INVALIDATE));
8214 return; 8220 return;
8215 } 8221 }
8216 pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); 8222 pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
8397 hbox = dw_box_new(DW_HORZ, 0); 8403 hbox = dw_box_new(DW_HORZ, 0);
8398 8404
8399 dw_box_pack_start(vbox, hbox, 0, 0, FALSE, FALSE, 0); 8405 dw_box_pack_start(vbox, hbox, 0, 0, FALSE, FALSE, 0);
8400 dw_window_set_style(hbox, 0, WS_CLIPCHILDREN); 8406 dw_window_set_style(hbox, 0, WS_CLIPCHILDREN);
8401 8407
8402 col = WinCreateWindow(vbox, "ColorSelectClass", "", WS_VISIBLE | WS_GROUP, 0, 0, 390, 300, vbox, HWND_TOP, 266, NULL,NULL); 8408 col = WinCreateWindow(vbox, (PSZ)"ColorSelectClass", NULL, WS_VISIBLE | WS_GROUP, 0, 0, 390, 300, vbox, HWND_TOP, 266, NULL,NULL);
8403 dw_box_pack_start(hbox, col, 390, 300, FALSE, FALSE, 0); 8409 dw_box_pack_start(hbox, col, 390, 300, FALSE, FALSE, 0);
8404 8410
8405 dw_window_set_data(hbox, "_dw_window", (void *)window); 8411 dw_window_set_data(hbox, "_dw_window", (void *)window);
8406 dw_window_set_data(window, "_dw_mutex", (void *)mtx); 8412 dw_window_set_data(window, "_dw_mutex", (void *)mtx);
8407 dw_window_set_data(window, "_dw_col", (void *)col); 8413 dw_window_set_data(window, "_dw_col", (void *)col);
8638 { 8644 {
8639 if(fontname[z]=='.') 8645 if(fontname[z]=='.')
8640 break; 8646 break;
8641 } 8647 }
8642 8648
8643 GpiQueryTextBox(hps, strlen(text), text, TXTBOX_COUNT, aptl); 8649 GpiQueryTextBox(hps, strlen(text), (PCH)text, TXTBOX_COUNT, aptl);
8644 8650
8645 rcl.xLeft = x; 8651 rcl.xLeft = x;
8646 rcl.yTop = height - y; 8652 rcl.yTop = height - y;
8647 rcl.yBottom = rcl.yTop - (aptl[TXTBOX_TOPLEFT].y - aptl[TXTBOX_BOTTOMLEFT].y); 8653 rcl.yBottom = rcl.yTop - (aptl[TXTBOX_TOPLEFT].y - aptl[TXTBOX_BOTTOMLEFT].y);
8648 rcl.xRight = rcl.xLeft + (aptl[TXTBOX_TOPRIGHT].x - aptl[TXTBOX_TOPLEFT].x); 8654 rcl.xRight = rcl.xLeft + (aptl[TXTBOX_TOPRIGHT].x - aptl[TXTBOX_TOPLEFT].x);
8649 8655
8650 if(_background == DW_CLR_DEFAULT) 8656 if(_background == DW_CLR_DEFAULT)
8651 WinDrawText(hps, -1, text, &rcl, DT_TEXTATTRS, DT_TEXTATTRS, DT_VCENTER | DT_LEFT | DT_TEXTATTRS); 8657 WinDrawText(hps, -1, (PCH)text, &rcl, DT_TEXTATTRS, DT_TEXTATTRS, DT_VCENTER | DT_LEFT | DT_TEXTATTRS);
8652 else 8658 else
8653 WinDrawText(hps, -1, text, &rcl, _internal_color(_foreground), _internal_color(_background), DT_VCENTER | DT_LEFT | DT_ERASERECT); 8659 WinDrawText(hps, -1, (PCH)text, &rcl, _internal_color(_foreground), _internal_color(_background), DT_VCENTER | DT_LEFT | DT_ERASERECT);
8654 8660
8655 if(!pixmap) 8661 if(!pixmap)
8656 WinReleasePS(hps); 8662 WinReleasePS(hps);
8657 } 8663 }
8658 8664
8682 WinReleasePS(pixmaphps); 8688 WinReleasePS(pixmaphps);
8683 } 8689 }
8684 else 8690 else
8685 return; 8691 return;
8686 8692
8687 GpiQueryTextBox(hps, strlen(text), text, TXTBOX_COUNT, aptl); 8693 GpiQueryTextBox(hps, strlen(text), (PCH)text, TXTBOX_COUNT, aptl);
8688 8694
8689 if(width) 8695 if(width)
8690 *width = aptl[TXTBOX_TOPRIGHT].x - aptl[TXTBOX_TOPLEFT].x; 8696 *width = aptl[TXTBOX_TOPRIGHT].x - aptl[TXTBOX_TOPLEFT].x;
8691 8697
8692 if(height) 8698 if(height)
8923 8929
8924 hdc = GpiQueryDevice(hps); 8930 hdc = GpiQueryDevice(hps);
8925 ulFlags = GpiQueryPS(hps, &sizl); 8931 ulFlags = GpiQueryPS(hps, &sizl);
8926 8932
8927 pixmap->handle = handle; 8933 pixmap->handle = handle;
8928 pixmap->hdc = DevOpenDC(dwhab, OD_MEMORY, "*", 0L, NULL, hdc); 8934 pixmap->hdc = DevOpenDC(dwhab, OD_MEMORY, (PSZ)"*", 0L, NULL, hdc);
8929 pixmap->hps = GpiCreatePS (dwhab, pixmap->hdc, &sizl, ulFlags | GPIA_ASSOC); 8935 pixmap->hps = GpiCreatePS (dwhab, pixmap->hdc, &sizl, ulFlags | GPIA_ASSOC);
8930 8936
8931 DevQueryCaps(hdc, CAPS_COLOR_PLANES , 1L, &cPlanes); 8937 DevQueryCaps(hdc, CAPS_COLOR_PLANES , 1L, &cPlanes);
8932 if (!depth) 8938 if (!depth)
8933 { 8939 {
9095 hps = WinGetPS(handle); 9101 hps = WinGetPS(handle);
9096 9102
9097 hdc = GpiQueryDevice(hps); 9103 hdc = GpiQueryDevice(hps);
9098 ulFlags = GpiQueryPS(hps, &sizl); 9104 ulFlags = GpiQueryPS(hps, &sizl);
9099 9105
9100 pixmap->hdc = DevOpenDC(dwhab, OD_MEMORY, "*", 0L, NULL, hdc); 9106 pixmap->hdc = DevOpenDC(dwhab, OD_MEMORY, (PSZ)"*", 0L, NULL, hdc);
9101 pixmap->hps = GpiCreatePS (dwhab, pixmap->hdc, &sizl, ulFlags | GPIA_ASSOC); 9107 pixmap->hps = GpiCreatePS (dwhab, pixmap->hdc, &sizl, ulFlags | GPIA_ASSOC);
9102 9108
9103 pixmap->hbm = GpiLoadBitmap(pixmap->hps, NULLHANDLE, id, 0, 0); 9109 pixmap->hbm = GpiLoadBitmap(pixmap->hps, NULLHANDLE, id, 0, 0);
9104 9110
9105 GpiQueryBitmapParameters(pixmap->hbm, &bmih); 9111 GpiQueryBitmapParameters(pixmap->hbm, &bmih);
9311 */ 9317 */
9312 int API dw_module_load(char *name, HMOD *handle) 9318 int API dw_module_load(char *name, HMOD *handle)
9313 { 9319 {
9314 char objnamebuf[300] = ""; 9320 char objnamebuf[300] = "";
9315 9321
9316 return DosLoadModule(objnamebuf, sizeof(objnamebuf), name, handle); 9322 return DosLoadModule((PSZ)objnamebuf, sizeof(objnamebuf), (PSZ)name, handle);
9317 } 9323 }
9318 9324
9319 /* Queries the address of a symbol within open handle. 9325 /* Queries the address of a symbol within open handle.
9320 * Parameters: 9326 * Parameters:
9321 * handle: Module handle returned by dw_module_load() 9327 * handle: Module handle returned by dw_module_load()
9323 * func: A pointer to a function pointer, to obtain 9329 * func: A pointer to a function pointer, to obtain
9324 * the address. 9330 * the address.
9325 */ 9331 */
9326 int API dw_module_symbol(HMOD handle, char *name, void**func) 9332 int API dw_module_symbol(HMOD handle, char *name, void**func)
9327 { 9333 {
9328 return DosQueryProcAddr(handle, 0, name, (PFN*)func); 9334 return DosQueryProcAddr(handle, 0, (PSZ)name, (PFN*)func);
9329 } 9335 }
9330 9336
9331 /* Frees the shared library previously opened. 9337 /* Frees the shared library previously opened.
9332 * Parameters: 9338 * Parameters:
9333 * handle: Module handle returned by dw_module_load() 9339 * handle: Module handle returned by dw_module_load()
9491 return 0; 9497 return 0;
9492 9498
9493 strcpy(semname, "\\sem32\\"); 9499 strcpy(semname, "\\sem32\\");
9494 strcat(semname, name); 9500 strcat(semname, name);
9495 9501
9496 DosCreateEventSem(semname, &ev, 0L, FALSE); 9502 DosCreateEventSem((PSZ)semname, &ev, 0L, FALSE);
9497 9503
9498 free(semname); 9504 free(semname);
9499 return ev; 9505 return ev;
9500 } 9506 }
9501 9507
9514 return 0; 9520 return 0;
9515 9521
9516 strcpy(semname, "\\sem32\\"); 9522 strcpy(semname, "\\sem32\\");
9517 strcat(semname, name); 9523 strcat(semname, name);
9518 9524
9519 DosOpenEventSem(semname, &ev); 9525 DosOpenEventSem((PSZ)semname, &ev);
9520 9526
9521 free(semname); 9527 free(semname);
9522 return ev; 9528 return ev;
9523 } 9529 }
9524 9530
9616 { 9622 {
9617 char namebuf[1024]; 9623 char namebuf[1024];
9618 9624
9619 sprintf(namebuf, "\\sharemem\\%s", name); 9625 sprintf(namebuf, "\\sharemem\\%s", name);
9620 9626
9621 if(DosAllocSharedMem((void *)dest, namebuf, size, PAG_COMMIT | PAG_WRITE | PAG_READ) != NO_ERROR) 9627 if(DosAllocSharedMem((void *)dest, (PSZ)namebuf, size, PAG_COMMIT | PAG_WRITE | PAG_READ) != NO_ERROR)
9622 return 0; 9628 return 0;
9623 9629
9624 return 1; 9630 return 1;
9625 } 9631 }
9626 9632
9636 char namebuf[1024]; 9642 char namebuf[1024];
9637 9643
9638 size = size; 9644 size = size;
9639 sprintf(namebuf, "\\sharemem\\%s", name); 9645 sprintf(namebuf, "\\sharemem\\%s", name);
9640 9646
9641 if(DosGetNamedSharedMem((void *)dest, namebuf, PAG_READ | PAG_WRITE) != NO_ERROR) 9647 if(DosGetNamedSharedMem((void *)dest, (PSZ)namebuf, PAG_READ | PAG_WRITE) != NO_ERROR)
9642 return 0; 9648 return 0;
9643 9649
9644 return 1; 9650 return 1;
9645 } 9651 }
9646 9652
9741 * A handle to a splitbar window or NULL on failure. 9747 * A handle to a splitbar window or NULL on failure.
9742 */ 9748 */
9743 HWND API dw_splitbar_new(int type, HWND topleft, HWND bottomright, unsigned long id) 9749 HWND API dw_splitbar_new(int type, HWND topleft, HWND bottomright, unsigned long id)
9744 { 9750 {
9745 HWND tmp = WinCreateWindow(HWND_OBJECT, 9751 HWND tmp = WinCreateWindow(HWND_OBJECT,
9746 SplitbarClassName, 9752 (PSZ)SplitbarClassName,
9747 NULL, 9753 NULL,
9748 WS_VISIBLE | WS_CLIPCHILDREN, 9754 WS_VISIBLE | WS_CLIPCHILDREN,
9749 0,0,2000,1000, 9755 0,0,2000,1000,
9750 NULLHANDLE, 9756 NULLHANDLE,
9751 HWND_TOP, 9757 HWND_TOP,
9856 HFILE hfile; 9862 HFILE hfile;
9857 ULONG ulResult; 9863 ULONG ulResult;
9858 9864
9859 achFileName[0] = (char)('A'+ulBootDrive-1); 9865 achFileName[0] = (char)('A'+ulBootDrive-1);
9860 9866
9861 if (DosOpen (achFileName, &hfile, &ulResult, 0, 0, OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS, OPEN_FLAGS_FAIL_ON_ERROR | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_SEQUENTIAL | OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY, NULL) == NO_ERROR) 9867 if (DosOpen ((PSZ)achFileName, &hfile, &ulResult, 0, 0, OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS, OPEN_FLAGS_FAIL_ON_ERROR | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_SEQUENTIAL | OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY, NULL) == NO_ERROR)
9862 { 9868 {
9863 ULONG ulFileSize = 0; 9869 ULONG ulFileSize = 0;
9864 if (DosSetFilePtr (hfile, 0, FILE_END, &ulFileSize) == NO_ERROR) 9870 if (DosSetFilePtr (hfile, 0, FILE_END, &ulFileSize) == NO_ERROR)
9865 { 9871 {
9866 const ULONG ulFirstTry = min (256, ulFileSize); 9872 const ULONG ulFirstTry = min (256, ulFileSize);
9942 9948
9943 rc = WinQueryClipbrdFmtInfo(dwhab, CF_TEXT, &fmtInfo); 9949 rc = WinQueryClipbrdFmtInfo(dwhab, CF_TEXT, &fmtInfo);
9944 if (rc) /* Text data in clipboard */ 9950 if (rc) /* Text data in clipboard */
9945 { 9951 {
9946 PSZ pszClipText = (PSZ)WinQueryClipbrdData(dwhab, CF_TEXT); /* Query data handle */ 9952 PSZ pszClipText = (PSZ)WinQueryClipbrdData(dwhab, CF_TEXT); /* Query data handle */
9947 retbuf = strdup(pszClipText); 9953 retbuf = strdup((char *)pszClipText);
9948 } 9954 }
9949 WinCloseClipbrd(dwhab); 9955 WinCloseClipbrd(dwhab);
9950 return retbuf; 9956 return retbuf;
9951 } 9957 }
9952 9958
10029 FILEFINDBUF3 ffbuf; 10035 FILEFINDBUF3 ffbuf;
10030 HTREEITEM item; 10036 HTREEITEM item;
10031 ULONG count = 1; 10037 ULONG count = 1;
10032 HDIR hdir = HDIR_CREATE; 10038 HDIR hdir = HDIR_CREATE;
10033 10039
10034 if(DosFindFirst(path, &hdir, FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM | FILE_ARCHIVED | MUST_HAVE_DIRECTORY, 10040 if(DosFindFirst((PSZ)path, &hdir, FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM | FILE_ARCHIVED | MUST_HAVE_DIRECTORY,
10035 &ffbuf, sizeof(FILEFINDBUF3), &count, FIL_STANDARD) == NO_ERROR) 10041 &ffbuf, sizeof(FILEFINDBUF3), &count, FIL_STANDARD) == NO_ERROR)
10036 { 10042 {
10037 while(DosFindNext(hdir, &ffbuf, sizeof(FILEFINDBUF3), &count) == NO_ERROR) 10043 while(DosFindNext(hdir, &ffbuf, sizeof(FILEFINDBUF3), &count) == NO_ERROR)
10038 { 10044 {
10039 if(strcmp(ffbuf.achName, ".") && strcmp(ffbuf.achName, "..")) 10045 if(strcmp(ffbuf.achName, ".") && strcmp(ffbuf.achName, ".."))
10043 HTREEITEM tempitem; 10049 HTREEITEM tempitem;
10044 10050
10045 strcpy(folder, path); 10051 strcpy(folder, path);
10046 strcpy(&folder[len-1], ffbuf.achName); 10052 strcpy(&folder[len-1], ffbuf.achName);
10047 10053
10048 item = dw_tree_insert(tree, ffbuf.achName, WinLoadFileIcon(folder, TRUE), parent, (void *)parent); 10054 item = dw_tree_insert(tree, ffbuf.achName, WinLoadFileIcon((PSZ)folder, TRUE), parent, (void *)parent);
10049 tempitem = dw_tree_insert(tree, "", 0, item, 0); 10055 tempitem = dw_tree_insert(tree, "", 0, item, 0);
10050 dw_tree_item_set_data(tree, item, (void *)tempitem); 10056 dw_tree_item_set_data(tree, item, (void *)tempitem);
10051 } 10057 }
10052 } 10058 }
10053 DosFindClose(hdir); 10059 DosFindClose(hdir);
10072 char folder[5] = "C:\\", name[9] = "Drive C:"; 10078 char folder[5] = "C:\\", name[9] = "Drive C:";
10073 HTREEITEM tempitem; 10079 HTREEITEM tempitem;
10074 10080
10075 folder[0] = name[6] = 'A' + drive; 10081 folder[0] = name[6] = 'A' + drive;
10076 10082
10077 items[drive] = dw_tree_insert(tree, name, WinLoadFileIcon(folder, TRUE), NULL, 0); 10083 items[drive] = dw_tree_insert(tree, name, WinLoadFileIcon((PSZ)folder, TRUE), NULL, 0);
10078 tempitem = dw_tree_insert(tree, "", 0, items[drive], 0); 10084 tempitem = dw_tree_insert(tree, "", 0, items[drive], 0);
10079 dw_tree_item_set_data(tree, items[drive], (void *)tempitem); 10085 dw_tree_item_set_data(tree, items[drive], (void *)tempitem);
10080 } 10086 }
10081 else 10087 else
10082 items[drive] = 0; 10088 items[drive] = 0;
10247 int len; 10253 int len;
10248 struct stat buf; 10254 struct stat buf;
10249 10255
10250 if(defpath) 10256 if(defpath)
10251 { 10257 {
10252 if(DosQueryPathInfo(defpath, FIL_QUERYFULLNAME, fild.szFullFile, sizeof(fild.szFullFile))) 10258 if(DosQueryPathInfo((PSZ)defpath, FIL_QUERYFULLNAME, fild.szFullFile, sizeof(fild.szFullFile)))
10253 strcpy(fild.szFullFile, defpath); 10259 strcpy(fild.szFullFile, defpath);
10254 }; 10260 };
10255 10261
10256 len = strlen(fild.szFullFile); 10262 len = strlen(fild.szFullFile);
10257 10263
10288 } 10294 }
10289 10295
10290 /* Setup the structure */ 10296 /* Setup the structure */
10291 fild.cbSize = sizeof(FILEDLG); 10297 fild.cbSize = sizeof(FILEDLG);
10292 fild.fl = FDS_CENTER | FDS_OPEN_DIALOG; 10298 fild.fl = FDS_CENTER | FDS_OPEN_DIALOG;
10293 fild.pszTitle = title; 10299 fild.pszTitle = (PSZ)title;
10294 fild.pszOKButton = ((flags & DW_FILE_SAVE) ? "Save" : "Open"); 10300 fild.pszOKButton = (PSZ)((flags & DW_FILE_SAVE) ? "Save" : "Open");
10295 fild.pfnDlgProc = (PFNWP)WinDefFileDlgProc; 10301 fild.pfnDlgProc = (PFNWP)WinDefFileDlgProc;
10296 10302
10297 hwndFile = WinFileDlg(HWND_DESKTOP, HWND_DESKTOP, &fild); 10303 hwndFile = WinFileDlg(HWND_DESKTOP, HWND_DESKTOP, &fild);
10298 if(hwndFile) 10304 if(hwndFile)
10299 { 10305 {
10350 char *execargs[3], browser[1024], *olddir, *newurl = NULL; 10356 char *execargs[3], browser[1024], *olddir, *newurl = NULL;
10351 int len, ret; 10357 int len, ret;
10352 10358
10353 olddir = _getcwd(NULL, 1024); 10359 olddir = _getcwd(NULL, 1024);
10354 10360
10355 PrfQueryProfileString(HINI_USERPROFILE, "WPURLDEFAULTSETTINGS", 10361 PrfQueryProfileString(HINI_USERPROFILE, (PSZ)"WPURLDEFAULTSETTINGS",
10356 "DefaultWorkingDir", NULL, browser, 1024); 10362 (PSZ)"DefaultWorkingDir", NULL, (PSZ)browser, 1024);
10357 10363
10358 if(browser[0]) 10364 if(browser[0])
10359 _SetPath(browser); 10365 _SetPath(browser);
10360 10366
10361 PrfQueryProfileString(HINI_USERPROFILE, "WPURLDEFAULTSETTINGS", 10367 PrfQueryProfileString(HINI_USERPROFILE, (PSZ)"WPURLDEFAULTSETTINGS",
10362 "DefaultBrowserExe", NULL, browser, 1024); 10368 (PSZ)"DefaultBrowserExe", NULL, (PSZ)browser, 1024);
10363 10369
10364 len = strlen(browser) - strlen("explore.exe"); 10370 len = strlen(browser) - strlen("explore.exe");
10365 10371
10366 execargs[0] = browser; 10372 execargs[0] = browser;
10367 execargs[1] = url; 10373 execargs[1] = url;
10572 PVOID pBuf = NULL; 10578 PVOID pBuf = NULL;
10573 ULONG fsType = SPL_PR_QUEUE; 10579 ULONG fsType = SPL_PR_QUEUE;
10574 ULONG cbBuf, cRes, cTotal, cbNeeded; 10580 ULONG cbBuf, cRes, cTotal, cbNeeded;
10575 SPLERR splerr = 0 ; 10581 SPLERR splerr = 0 ;
10576 PPRINTERINFO pRes ; /* Check the default printer for now... want a printer list in the future */ 10582 PPRINTERINFO pRes ; /* Check the default printer for now... want a printer list in the future */
10577 int cb = PrfQueryProfileString(HINI_PROFILE, "PM_SPOOLER", "PRINTER", "", printername, 32); 10583 int cb = PrfQueryProfileString(HINI_PROFILE, (PSZ)"PM_SPOOLER", (PSZ)"PRINTER", (PSZ)"", printername, 32);
10578 10584
10579 if(!drawfunc || !(print = calloc(1, sizeof(DWPrint)))) 10585 if(!drawfunc || !(print = calloc(1, sizeof(DWPrint))))
10580 return NULL; 10586 return NULL;
10581 10587
10582 print->drawfunc = drawfunc; 10588 print->drawfunc = drawfunc;
10632 int count = 0; 10638 int count = 0;
10633 10639
10634 pRes = (PPRINTERINFO)pBuf ; 10640 pRes = (PPRINTERINFO)pBuf ;
10635 while(cRes--) 10641 while(cRes--)
10636 { 10642 {
10637 dw_listbox_append(printerlist, pRes[cRes].pszPrintDestinationName); 10643 dw_listbox_append(printerlist, (char *)pRes[cRes].pszPrintDestinationName);
10638 /* If this is the default printer... select it by default */ 10644 /* If this is the default printer... select it by default */
10639 if(strcmp(pRes[cRes].pszPrintDestinationName, printername) == 0) 10645 if(strcmp((char *)pRes[cRes].pszPrintDestinationName, printername) == 0)
10640 dw_listbox_select(printerlist, count, TRUE); 10646 dw_listbox_select(printerlist, count, TRUE);
10641 count++; 10647 count++;
10642 } 10648 }
10643 } 10649 }
10644 else 10650 else
10717 char DriverName[32]; 10723 char DriverName[32];
10718 char LogAddress[32]; 10724 char LogAddress[32];
10719 DEVOPENSTRUC dop; 10725 DEVOPENSTRUC dop;
10720 10726
10721 /* Get the printer information string */ 10727 /* Get the printer information string */
10722 cb = PrfQueryProfileString(HINI_PROFILE, "PM_SPOOLER_PRINTER", print->printername, "", PrintDetails, 256); 10728 cb = PrfQueryProfileString(HINI_PROFILE, (PSZ)"PM_SPOOLER_PRINTER", (PSZ)print->printername, (PSZ)"", PrintDetails, 256);
10723 _ExtractLogAddress(LogAddress, PrintDetails); 10729 _ExtractLogAddress(LogAddress, PrintDetails);
10724 _ExtractDriverName(DriverName, PrintDetails); 10730 _ExtractDriverName(DriverName, PrintDetails);
10725 dop.pszDriverName = DriverName; 10731 dop.pszDriverName = (PSZ)DriverName;
10726 dop.pszLogAddress = LogAddress; 10732 dop.pszLogAddress = (PSZ)LogAddress;
10727 dop.pdriv = NULL; 10733 dop.pdriv = NULL;
10728 dop.pszDataType = "PM_Q_STD"; 10734 dop.pszDataType = (PSZ)"PM_Q_STD";
10729 /* Attempt to open a device context and return a handle to it */ 10735 /* Attempt to open a device context and return a handle to it */
10730 print->hdc = DevOpenDC(dwhab, OD_QUEUED, "*", 4L, (PDEVOPENDATA) &dop, (HDC)NULL); 10736 print->hdc = DevOpenDC(dwhab, OD_QUEUED, (PSZ)"*", 4L, (PDEVOPENDATA) &dop, (HDC)NULL);
10731 if(print->hdc) 10737 if(print->hdc)
10732 return print; 10738 return print;
10733 } 10739 }
10734 /* The user canceled */ 10740 /* The user canceled */
10735 if(print->printername) 10741 if(print->printername)
10758 10764
10759 if (!(pixmap = calloc(1,sizeof(struct _hpixmap)))) 10765 if (!(pixmap = calloc(1,sizeof(struct _hpixmap))))
10760 return result; 10766 return result;
10761 10767
10762 /* Start the job */ 10768 /* Start the job */
10763 DevEscape(p->hdc, DEVESC_STARTDOC, strlen(p->jobname), p->jobname, NULL, NULL); 10769 DevEscape(p->hdc, DEVESC_STARTDOC, strlen(p->jobname), (PBYTE)p->jobname, NULL, NULL);
10764 10770
10765 pixmap->font = WinCreateWindow(HWND_OBJECT, WC_FRAME, NULL, 0,0,0,1,1, NULLHANDLE, HWND_TOP,0, NULL, NULL); 10771 pixmap->font = WinCreateWindow(HWND_OBJECT, WC_FRAME, NULL, 0,0,0,1,1, NULLHANDLE, HWND_TOP,0, NULL, NULL);
10766 pixmap->hdc = p->hdc; 10772 pixmap->hdc = p->hdc;
10767 pixmap->hps = GpiCreatePS(dwhab, p->hdc, &sizl, PU_PELS | GPIF_DEFAULT | GPIT_NORMAL | GPIA_ASSOC); 10773 pixmap->hps = GpiCreatePS(dwhab, p->hdc, &sizl, PU_PELS | GPIF_DEFAULT | GPIT_NORMAL | GPIA_ASSOC);
10768 pixmap->transcolor = DW_RGB_TRANSPARENT; 10774 pixmap->transcolor = DW_RGB_TRANSPARENT;
11206 { 11212 {
11207 char *text = "dummy calendar"; 11213 char *text = "dummy calendar";
11208 WindowData *blah = calloc(sizeof(WindowData), 1); 11214 WindowData *blah = calloc(sizeof(WindowData), 1);
11209 HWND tmp = WinCreateWindow(HWND_OBJECT, 11215 HWND tmp = WinCreateWindow(HWND_OBJECT,
11210 WC_STATIC, 11216 WC_STATIC,
11211 text, 11217 (PSZ)text,
11212 WS_VISIBLE | SS_TEXT, 11218 WS_VISIBLE | SS_TEXT,
11213 0,0,2000,1000, 11219 0,0,2000,1000,
11214 NULLHANDLE, 11220 NULLHANDLE,
11215 HWND_TOP, 11221 HWND_TOP,
11216 id, 11222 id,
11218 NULL); 11224 NULL);
11219 blah->oldproc = WinSubclassWindow(tmp, _textproc); 11225 blah->oldproc = WinSubclassWindow(tmp, _textproc);
11220 WinSetWindowPtr(tmp, QWP_USER, blah); 11226 WinSetWindowPtr(tmp, QWP_USER, blah);
11221 dw_window_set_font(tmp, DefaultFont); 11227 dw_window_set_font(tmp, DefaultFont);
11222 dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY); 11228 dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY);
11223 WinSetWindowText(tmp, text); 11229 WinSetWindowText(tmp, (PSZ)text);
11224 return tmp; 11230 return tmp;
11225 } 11231 }
11226 11232
11227 /* 11233 /*
11228 * The following are stubs 11234 * The following are stubs
11229 */ 11235 */
11230 void API dw_calendar_set_date( HWND window, unsigned int year, unsigned int month, unsigned int day ) 11236 void API dw_calendar_set_date( HWND window, unsigned int year, unsigned int month, unsigned int day )
11231 { 11237 {
11232 char tmp[30]; 11238 char tmp[30];
11233 sprintf( tmp, "%4.4d-%2.2d-%2.2d", year, month, day); 11239 sprintf( tmp, "%4.4d-%2.2d-%2.2d", year, month, day);
11234 WinSetWindowText(window, tmp); 11240 WinSetWindowText(window, (PSZ)tmp);
11235 } 11241 }
11236 11242
11237 void API dw_calendar_get_date( HWND window, unsigned int *year, unsigned int *month, unsigned int *day ) 11243 void API dw_calendar_get_date( HWND window, unsigned int *year, unsigned int *month, unsigned int *day )
11238 { 11244 {
11239 window = window; 11245 window = window;