[futurebasic] Re: [FB] Window questions

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2006 : Group Archive : Group : All Groups

From: Stu Cram <stu@...>
Date: Tue, 11 Apr 2006 10:11:05 -0600
On Apr 10, 2006, at 10:07 PM, Brian Heibert wrote:
> LOCAL FN buildEditor
> dim @r
>
>   WINDOW _editor,"HBasic 2006",( 149, 144)-( 875, 664), _docNoGrow
> TEXT _AndaleMono,11,0:COLOR=_zBlue
>   EDIT FIELD _EF1WClass2,%4000,(0,0)-( 709, 702), 4,_leftJust
> setrect(r,713,0, 729, 520 )
> scroll button -_EF1WClass2,0,0,0,0, @r, _scrollOther
> END F
>
> I have a question I want the close button & the minimize button to be 
> enabled in my document window but the above code only enables the 
> close button I do not want the green maximize button to be enabled. I 
> realize I am also not using a Appearance Window how would I go about 
> changing that?
>
> Brian
> --

Hi Brian,
You stated the answer yourself --> use the APPEARANCE WINDOW command! 
It's in the Reference manual.
However, there are some other bits of code that warrant looking as well.

1. Use some variables for the position and size of the window, the edit 
field and scroll bar rather than actual numbers. That will make it 
easier to modify the window's size and position. See the example below.

2. The constant '_AndaleMono' is not defined in FB. You would have to 
use a toolbox routine like GetFontNum to get the font number and store 
it in a variable.

3. The constant '_EF1WClass2' is not defined in FB. That looks like a 
PG variable which is ok if IT IS DEFINED IN ANOTHER PART OF YOUR 
PROJECT. In the example below, a variable was used instead.

Here's a complete but small example to make the window with the options 
you want.
Hope this helps.
-Stu

'----------------------------------------------------
LOCAL FN buildEditor
DIM @r AS RECT
DIM wl, wt, ww, wh
DIM wa as windowAttributes
DIM ef

wl = 149 ' window's left position
wt = 144 ' window's top position
ww = 710 ' window's width
wh = 520 ' window's height
wa = _kWindowCloseBoxAttribute + _kWindowCollapseBoxAttribute
_editorWnd = 666
SetRect( r, wl,wt, wl+ww,wt+wh ) ' rect for window
APPEARANCE WINDOW _editorWnd,"HBasic 2006", @r, _kDocumentWindowClass, 
wa

TEXT _Monaco,11,0
COLOR=_zBlue
SetRect( r, 0,0, ww-20,wh )' rect for edit field
ef = 1
EDIT FIELD ef, "Enter text here...", @r, _noFramed, _leftJust

SetRect( r, ww-20,0, ww,wh )' rect for edit field's scroll bar
SCROLL BUTTON -ef, 0,0,0,0, @r, _scrollOther

END FN
'----------------------------------------------------

FN buildEditor

DO
HandleEvents
UNTIL 0



--
To unsubscribe, send ANY message to: futurebasic-unsubscribe@...