[futurebasic] Re: [FB] Radio Button text colour

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2002 : Group Archive : Group : All Groups

From: Martin Fitzgibbons <rush@...>
Date: Mon, 24 Jun 2002 13:14:15 +1000
A simpler solution than thought provided by Steve. The reason for the 
variation is to suit a students game interface they have developed which 
is of course nonstandard.

Martin
=============

Martin:

Following code will change text color for radio btns (type 131):

LOCAL
dim btnNum%
dim mark
LOCAL FN resetRadioGroup (btnClicked%, first%, last%)
FOR btnNum% = first% TO last%
LONG IF btnNum% = btnClicked%
mark = _markedBtn 'new State
XELSE
mark = _activeBtn 'new State
END IF
LONG IF BUTTON(btnNum%) <> mark 'is radio button marked?
BUTTON #btnNum%, mark 'unmark radio button
END IF
NEXT btnNum%
END FN

LOCAL FN buildWnd
WINDOW#1,"Color RadioBtns",(0,0)-(200,160),_docNoGrow
text _sysFont,12,_boldBit%
color _zRed
button#1,_activeBtn,"Radio1",(30,30)-(100,50),131+_useWFont
text _sysFont,12,_italicBit%
color _zGreen
button#2,_activeBtn,"Radio2",(30,60)-(100,80),131+_useWFont
text _Monaco,12,0
color _zBlue
button#3,_activeBtn,"Radio3",(30,90)-(100,110),131+_useWFont
END FN

local
dim evnt%
dim id%
LOCAL FN doDialog
evnt% = DIALOG(0)
id% = DIALOG(evnt)
SELECT evnt%
CASE _wndClose
END
case _btnClick
fn resetRadioGroup(id%,1,3)
END SELECT
END FN

FN buildWnd
ON DIALOG FN doDialog
DO
HANDLEEVENTS
UNTIL 0

Steve Van Voorst



=============
gnome wrote:

> Le samedi 22 juin 2002, à 05:12 , Martin Fitzgibbons a écrit :
>
>> Is there a way of setting a radio button text color?
>
>
> <shudder> although i disapprove throughly of this very idea </shudder>
> have you looked at such strange creatures as:
> def setbuttonfontsytyle
> or
> def setbuttontextselection
>
> without necessarily providing a solution to your troubles they
> may [peek at the runtime] provide a means...
>
> :-j
>
>
> --
> To unsubscribe, send ANY message to 
> <futurebasic-unsubscribe@...>
>
>