It's possible to have the buttons appear in other colors. I was able
to set a "Kill" button to red using a graphics program (FastGraph,
though I'm sure something like GnuPlot will do the same thing). All I
did was "paint" the button.
I don't think that that was the "correct" method for doing it, but it
worked. I'm also interested in this question, because I'd like to
"grey out" the button then have it flash a color when a certain
function is activated.
Sorry if this wasn't very informative.
On 6/3/05, Dr. Roger Dube <rogerdube_at_dathq.com> wrote:
> 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 pushbutt=
on
> green, and the IDNO pushbutton red? How?
>=20
>=20
> REQUIRES CENTERED
>=20
>=20
>=20
>=20
>=20
> DIALOG YNBOX-TEMPLATE
>=20
> [MODAL " Yes or No" 200 200 120 40 (FONT 8, MS Sans Serif) ] \ STDFONT ]
>=20
> [DEFPUSHBUTTON " &YES" IDYES 15 20 40 15 ]
>=20
> [PUSHBUTTON " &NO" IDNO 65 20 40 15 ]
>=20
> [CTEXT " ?" 100 5 5 110 12 ]
>=20
> END-DIALOG
>=20
>=20
>=20
> :NONAME ( -- res ) MSG LOWORD CASE
>=20
> WM_COMMAND OF HWND WPARAM EndDialog ENDOF
>=20
> WM_INITDIALOG OF HWND DUP GetParent CENTERED
>=20
> HWND 100 LPARAM CELL+ @ SetDlgItemText DROP
>=20
> HWND LPARAM @ SetWindowText DROP
>=20
> 0 ENDOF
>=20
> 0 SWAP
>=20
> ENDCASE ; 4 CB: YNBOX-CALLBACK
>=20
>=20
>=20
>=20
>=20
> \ Give YNBOX the parent's handle, a text to display, and a title.
>=20
> \ It will return either IDYES or IDNO
>=20
>=20
>=20
>=20
>=20
> : YNBOX ( hwnd ztext ztitle -- t/f res )
>=20
> ROT 0 LOCALS| params hw | SP@ TO params
>=20
> HINST YNBOX-TEMPLATE hw YNBOX-CALLBACK
>=20
> params DialogBoxIndirectParam NIP NIP
>=20
> 6 =3D if -1 else 0 then ;
>=20
>=20
>=20
> -- 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
>=20
> http://www.datHQ.com
>=20
> 1900 Glades Road Suite 441
>=20
> Boca Raton, FL 33431-7333
>=20
>=20
> ----------------------------------------------------------------------
> 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 intende=
d
> recipient, please contact the sender by reply email and destroy all copie=
s
> of the original message. Any views expressed in this message are those of
> the individual sender, except where the sender specifically states them t=
o
> be the views of Digital Authentication Technologies, Inc.
>=20
>=20
>=20
>=20
>=20
>=20
>=20
> ----------------------------------------------------------------------
> 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
> ----------------------------------------------------------------------
>=20
>
----------------------------------------------------------------------
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 Sun Jun 05 2005 - 01:16:59 PDT
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 08-Feb-2012. Archive updated nightly.