[futurebasic] Sheet window

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2010 : Group Archive : Group : All Groups

From: Brian Heibert <heibert@...>
Date: Mon, 18 Jan 2010 22:52:42 -0500
Hi,

I got this code but I don't know how to display a sheet and attach it  
to my _mainWnd
I know the code to do it is below but I am having trouble getting it  
to work

I have done sheet windows in REALbasic but that was all visual, I just  
selected a window type of Sheet Window.  How do you do this in  
FutureBASIC?

Brian

local fn Buildlocsheet
'~'1
dim as Str255                 s
dim as ControlFontStyleRec    tfs
dim as Rect                   r
dim as WindowAttributes       wa
dim as Boolean              @ bool

wa = _kWindowStandardHandlerAttribute

//SetRect( r, 0, 0, 419, 140 )// Optional FB auto-centre
SetRect( r, 510, 337, 929, 477 )
appearance window -_locsheet,"Goto URL...", @r,  
_kSheetAlertWindowClass, wa
fn SetWindowBackground( _kThemeActiveDialogBackgroundBrush, _zTrue )


SetRect( r, 22, 18, 393, 34 )
appearance button _cStat,,,,,, @r, _kControlStaticTextProc
fn SetButtonTextString( _cStat, "Goto website location (URL)..." )

SetRect( r, 25, 45, 396, 61 )
appearance button _locationEDIT,,,,,, @r, _kControlEditUnicodeTextProc

SetRect( r, 252, 81, 322, 101 )
appearance button _Cancel,,,,, "Cancel", @r, _kControlPushButtonProc

SetRect( r, 329, 81, 399, 101 )
appearance button _gOK,,,,, "OK", @r, _kControlPushButtonProc
bool = _zTrue
fn SetButtonData( _gOK, _kControlEntireControl,  
_kControlPushButtonDefaultTag, sizeof( Boolean ), bool )

end fn

/*local fn ShowSheetWnd( sheet as long, parent as long )'Robert P
'~'1
dim as WindowRef  @ parentRef
dim as WindowRef  @ sheetRef
dim as OSStatus     ignore

get window sheet, sheetRef
get window parent, parentRef
ignore = fn ShowSheetWindow( sheetRef, parentRef )
end fn*/

/*local fn HideSheetWnd( sheet as long )
'~'1
dim as WindowRef  @ sheetRef
dim as OSStatus     ignore

get window sheet, sheetRef
ignore = fn HideSheetWindow( sheetRef )
end fn*/