[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 20:15:28 -0500
I am  trying to create and open up a sheet window
I am new to sheet's  in FutureBASIC.

here is what TWM created
How do I display the sheet window and attach it to
my appearance window _mainWnd?

Brian


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

wa = _kWindowStandardHandlerAttribute¬
      _kWindowCompositingAttribute

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


SetRect( r, 22, 18, 393, 34 )
appearance button _cStat,,,,,, @r, _kControlStaticTextProc
def 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
def SetButtonData( _gOK, _kControlEntireControl,  
_kControlPushButtonDefaultTag, sizeof( Boolean ), bool )

end fn


local fn ShowSheetWnd( sheet as long, parent as long )
'~'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