[futurebasic] Re: Re: [FB] Is There a Way to Color Buttons and Non-Static Edit Fields

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 2012 : Group Archive : Group : All Groups

From: "Jan M. Hollis" <jan.mike.hollis@...>
Date: Tue, 08 May 2012 09:07:56 -0500 (CDT)
 Steve:

Exactly what I need for the edit field!

Thanks,
Mike
 
 
 

No man knows how bad he is until he has tried very hard to be good.

-- C.S. Lewis in Mere Christianity --

On 05/08/12, SVanVoorst wrote:

<<not as simple as I had hoped >>
 
 


 
 
 

Does this help?
 
 
 


 
 
 

' ------ begin ----- 
 


 
 
 

 

begin enum 1 
 

_ef1 
 

_ef2 
 

_ef3 
 

_quitBtn 
 

end enum 
 


 
 
 

local fn buildWnd 
 

'~'1 
 

dim as rect r 
 

dim as WindowAttributes attr 
 

dim as ControlFontStyleRec cfs 
 

dim as OSStatus ignore 
 


 
 
 

attr = _kWindowStandardDocumentAttributes 
 

attr += _kWindowStandardHandlerAttribute 
 

attr += _kWindowCompositingAttribute 
 


 
 
 

SetRect( r, 0, 0, 400, 200 ) 
 

appearance window 1, "EUTC_demo", @r, _kDocumentWindowClass, attr 
 


 
 
 

SetRect( r, 30, 30, 280, 50 ) 
 

appearance button _ef1, , ,,,, @r, _kControlEditUnicodeTextProc 
 


 
 
 

cfs.flags = _kControlUseFontMask+_kControlUseSizeMask� 
 

 +_kControlUseJustMask+_kControlUseBackColorMask+_kControlUseForeColorMask 
 


 
 
 

cfs.font = _monaco 
 

cfs.size = 18 
 

cfs.just = _teJustCenter 
 


 
 
 

cfs.backColor.red = 64512 
 

cfs.backColor.green = 62333 
 

cfs.backColor.blue = 1327 
 


 
 
 

cfs.foreColor.red = 0 
 

cfs.foreColor.green = 0 
 

cfs.foreColor.blue = -1 
 


 
 
 

fn SetButtonFontStyle( _ef1, cfs ) 
 

fn SetButtonTextString( _ef1, "Monaco 18" ) 
 


 
 
 

cfs.backColor.red = 0 
 

cfs.backColor.green = 0 
 

cfs.backColor.blue = -1 
 


 
 
 

cfs.foreColor.red = -1 
 

cfs.foreColor.green = -1 
 

cfs.foreColor.blue = -1 
 


 
 
 

OffsetRect( r, 0, 40 ) 
 

appearance button _ef2, , ,,,, @r, _kControlEditUnicodeTextProc 
 

fn SetButtonFontStyle( _ef2, cfs ) 
 


 
 
 

cfs.backColor.red = -1 
 

cfs.backColor.green = 0 
 

cfs.backColor.blue = 0 
 


 
 
 

cfs.foreColor.red = 0 
 

cfs.foreColor.green = -1 
 

cfs.foreColor.blue = 0 
 


 
 
 

OffsetRect( r, 0, 40 ) 
 

appearance button _ef3, , ,,,, @r, _kControlEditUnicodeTextProc 
 

fn SetButtonFontStyle( _ef3, cfs ) 
 


 
 
 

SetRect( r, 320, 60, 380, 80 ) 
 

appearance button _quitBtn,,,,, "Quit", @r, _kControlPushButtonProc 
 

ignore = fn SetControlCommandID( button&( _quitBtn ), _kHICommandQuit ) 
 


 
 
 

appearance window 1 
 


 
 
 

end fn 
 


 
 
 

fn buildWnd 
 


 
 
 

do 
 

 handleevents 
 

until(gFBQuit) 
 


 
 
 

'------- end ------ 
 


 
 
 

Steve Van Voorst 
 


 
 
 
 

 


--

To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
 
To access the list archives, go to: http://freegroups.net/groups/futurebasic/