[futurebasic] Appearance Button Edit Fields

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

From: Ian Mann <i.mann@...>
Date: Wed, 6 Nov 2002 19:22:48 +0000
Appearance Button Edit Fields are neat because they behave properly with 
the Appearance Runtime but they are a pain to set up so for fellow 
recidivists

clear local
DIM cfsRec  AS ControlFontStyleRec
dim Rect0 as Rect
local fn IanAppEditField 
(IDNum&,atext$,RectAddr,EmbeddedIn&,type%,font%,size%,just%)
Rect0;8 = RectAddr
APPEARANCE BUTTON IDNum&,1,1,0,1,,@Rect0,type%
def setbuttontextstring (IDNum&,atext$)
cfsRec.flags = 0
if font% then cfsRec.flags = _kControlUseFontMask
if size% then cfsRec.flags = cfsRec.flags + _kControlUseSizeMask
if just% then cfsRec.flags = cfsRec.flags + _kControlUseJustMask
cfsRec.font = font%
cfsRec.size% = size%
cfsRec.just = just%
if cfsRec.flags then def setbuttonfontstyle (IDNum&,cfsRec)
if EmbeddedIn& then DEF EMBEDBUTTON(IDNum&,EmbeddedIn&)
end fn

Ian