Changeset 168
- Timestamp:
- Jun 2, 2002, 10:50:25 PM (23 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/comctl.h
r159 r168 1059 1059 BOOL ctlMakeHotkeyEntryField(HWND hwndHotkeyEntryField); 1060 1060 1061 /* ****************************************************************** 1062 * 1063 * Color rectangle 1064 * 1065 ********************************************************************/ 1066 1067 BOOL ctlMakeColorRect(HWND hwndStatic); 1068 typedef BOOL CTLMAKECOLORRECT(HWND hwndStatic); 1069 typedef CTLMAKECOLORRECT *PCTLMAKECOLORRECT; 1070 1061 1071 #endif 1062 1072 -
trunk/include/helpers/dialog.h
r166 r168 479 479 } DLGARRAY, *PDLGARRAY; 480 480 481 APIRET dlghCreateArray(ULONG cMaxItems, 482 PDLGARRAY *ppArray); 481 APIRET dlghCreateArray(ULONG cMaxItems, PDLGARRAY *ppArray); 482 typedef APIRET DLGHCREATEARRAY(ULONG cMaxItems, PDLGARRAY *ppArray); 483 typedef DLGHCREATEARRAY *PDLGHCREATEARRAY; 483 484 484 485 APIRET dlghFreeArray(PDLGARRAY *ppArray); 486 typedef APIRET DLGHFREEARRAY(PDLGARRAY *ppArray); 487 typedef DLGHFREEARRAY *PDLGHFREEARRAY; 485 488 486 489 APIRET dlghAppendToArray(PDLGARRAY pArray, 487 490 PCDLGHITEM paItems, 488 491 ULONG cItems); 492 typedef APIRET DLGHAPPENDTOARRAY(PDLGARRAY pArray, 493 PCDLGHITEM paItems, 494 ULONG cItems); 495 typedef DLGHAPPENDTOARRAY *PDLGHAPPENDTOARRAY; 489 496 490 497 /* ****************************************************************** -
trunk/src/helpers/comctl.c
r167 r168 89 89 #define INCL_WINBUTTONS 90 90 #define INCL_WINSTDCNR 91 #define INCL_WINENTRYFIELDS 91 92 92 93 #define INCL_GPIPRIMITIVES … … 1430 1431 } 1431 1432 1433 /* ****************************************************************** 1434 * 1435 * Color rectangle 1436 * 1437 ********************************************************************/ 1438 1439 static PFNWP G_pfnwpOrigStatic = NULL; 1440 1441 /* 1442 *@@ ctl_fnwpSubclassedColorRect: 1443 * window procedure for subclassed static frames representing 1444 * a color. 1445 * 1446 * The control simply paints itself as a rectangle with the 1447 * color specified in its PP_BACKGROUNDCOLOR presentation 1448 * parameter. If a window text is set for the control, it is 1449 * painted with the PP_FOREGROUNDCOLOR color. 1450 * 1451 * If the user drags a color onto the control, it notifies 1452 * its owner with the WM_CONTROL message and the EN_CHANGE 1453 * notification code, as with any entry field (since the 1454 * static control knows no notifications, we use that code 1455 * instead). 1456 * 1457 *@@added V0.9.16 (2002-01-05) [umoeller] 1458 *@@changed V0.9.19 (2002-06-02) [umoeller]: moved this here from w_pulse.c 1459 */ 1460 1461 static MRESULT EXPENTRY ctl_fnwpSubclassedColorRect(HWND hwndStatic, ULONG msg, MPARAM mp1, MPARAM mp2) 1462 { 1463 MRESULT mrc = 0; 1464 1465 switch (msg) 1466 { 1467 case WM_PAINT: 1468 { 1469 LONG lColor; 1470 RECTL rclPaint; 1471 PSZ pszText; 1472 1473 HPS hps = WinBeginPaint(hwndStatic, 1474 NULLHANDLE, // HPS 1475 NULL); // PRECTL 1476 gpihSwitchToRGB(hps); 1477 WinQueryWindowRect(hwndStatic, 1478 &rclPaint); // exclusive 1479 lColor = winhQueryPresColor(hwndStatic, 1480 PP_BACKGROUNDCOLOR, 1481 FALSE, // no inherit 1482 SYSCLR_DIALOGBACKGROUND); 1483 1484 // make rect inclusive 1485 rclPaint.xRight--; 1486 rclPaint.yTop--; 1487 1488 // draw interior 1489 GpiSetColor(hps, lColor); 1490 gpihBox(hps, 1491 DRO_FILL, 1492 &rclPaint); 1493 1494 // draw frame 1495 GpiSetColor(hps, RGBCOL_BLACK); 1496 gpihBox(hps, 1497 DRO_OUTLINE, 1498 &rclPaint); 1499 1500 if (pszText = winhQueryWindowText(hwndStatic)) 1501 { 1502 GpiSetColor(hps, 1503 winhQueryPresColor(hwndStatic, 1504 PP_FOREGROUNDCOLOR, 1505 FALSE, 1506 -1)); 1507 WinDrawText(hps, 1508 strlen(pszText), 1509 pszText, 1510 &rclPaint, 1511 0, 1512 0, 1513 DT_CENTER | DT_VCENTER | DT_TEXTATTRS); 1514 1515 free(pszText); 1516 } 1517 1518 WinEndPaint(hps); 1519 } 1520 break; 1521 1522 case WM_PRESPARAMCHANGED: 1523 switch ((ULONG)mp1) 1524 { 1525 case PP_BACKGROUNDCOLOR: 1526 WinInvalidateRect(hwndStatic, 1527 NULL, 1528 FALSE); 1529 // notify owner; since the static control 1530 // doesn't send any notifications, we 1531 // use EN_CHANGED 1532 WinSendMsg(WinQueryWindow(hwndStatic, QW_OWNER), 1533 WM_CONTROL, 1534 MPFROM2SHORT(WinQueryWindowUShort(hwndStatic, QWS_ID), 1535 EN_CHANGE), 1536 (MPARAM)hwndStatic); 1537 break; 1538 } 1539 break; 1540 1541 default: 1542 mrc = G_pfnwpOrigStatic(hwndStatic, msg, mp1, mp2); 1543 break; 1544 } 1545 1546 return mrc; 1547 } 1548 1549 /* 1550 *@@ ctlMakeColorRect: 1551 * turns a static rectangle into a color rectangle. 1552 * 1553 *@@added V0.9.19 (2002-06-02) [umoeller] 1554 */ 1555 1556 BOOL ctlMakeColorRect(HWND hwndStatic) 1557 { 1558 PFNWP pfnwp; 1559 1560 if (pfnwp = WinSubclassWindow(hwndStatic, 1561 ctl_fnwpSubclassedColorRect)) 1562 { 1563 G_pfnwpOrigStatic = pfnwp; 1564 return TRUE; 1565 } 1566 1567 return FALSE; 1568 } 1569 1570 -
trunk/src/helpers/winh.c
r167 r168 3534 3534 if (cbText) 3535 3535 { 3536 pszText = (PSZ)malloc(cbText + 1); 3537 if (pszText) 3536 if (pszText = (PSZ)malloc(cbText + 1)) 3538 3537 WinQueryWindowText(hwnd, 3539 3538 cbText + 1,
Note:
See TracChangeset
for help on using the changeset viewer.