![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

I have a need to change the color of pushbuttons in a dialog box. For
example, in the following code, is it possible to make the IDYES pushbutton
green, and the IDNO pushbutton red? How?
REQUIRES CENTERED
DIALOG YNBOX-TEMPLATE
[MODAL " Yes or No" 200 200 120 40 (FONT 8, MS Sans Serif) ] \ STDFONT ]
[DEFPUSHBUTTON " &YES" IDYES 15 20 40 15 ]
[PUSHBUTTON " &NO" IDNO 65 20 40 15 ]
[CTEXT " ?" 100 5 5 110 12 ]
END-DIALOG
:NONAME ( -- res ) MSG LOWORD CASE
WM_COMMAND OF HWND WPARAM EndDialog ENDOF
WM_INITDIALOG OF HWND DUP GetParent CENTERED
HWND 100 LPARAM CELL+ @ SetDlgItemText DROP
HWND LPARAM @ SetWindowText DROP
0 ENDOF
0 SWAP
ENDCASE ; 4 CB: YNBOX-CALLBACK
\ Give YNBOX the parent's handle, a text to display, and a title.
\ It will return either IDYES or IDNO
: YNBOX ( hwnd ztext ztitle -- t/f res )
ROT 0 LOCALS| params hw | SP@ TO params
HINST YNBOX-TEMPLATE hw YNBOX-CALLBACK
params DialogBoxIndirectParam NIP NIP
6 = if -1 else 0 then ;
-- Roger
--------------------------------------------
Dr. Roger Dube
President and Chief Science Officer
Digital Authentication Technologies, Inc.
561.392.7404 (office)
561.892.2474 (eFax)
RogerDube_at_datHQ.com
1900 Glades Road Suite 441
Boca Raton, FL 33431-7333
----------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message. Any views expressed in this message are those of
the individual sender, except where the sender specifically states them to
be the views of Digital Authentication Technologies, Inc.
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Fri Jun 03 2005 - 07:13:17 PDT
This archive was generated by hypermail 2.2.0 : Thu Dec 04 2008 - 03:04:20 PST