[futurebasic] Re: [FB] Filling space between rectangles - button question

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2004 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Sat, 4 Sep 2004 19:40:00 -0400
On Saturday, September 4, 2004, at 07:01  PM, Stu Cram wrote:

> On Sat Aug 4, RC wrote
>>>      I like the way that RC used regions to fill the space. But if 
>>> you
>>>      aren't up to speed with regions and the quickDraw graphical
>>>      commands, then here's another way...
>>   That was Al who did the region demo...though I'd have gone that
>>   route too as I mentioned if I knew there were innocent buttons
>>   involved, DrawOneControl(Button&(ID)) after drawing would
>>   likely have still been a cheat solution to the issue, if not wanting
>>   to use regions.
>>  Robert
> -------------
> Sorry, Robert;  I forgot to check back for accurate credit.
> ( Just another set of old eyes here - 57 yrs;   Been programming
> since '64 on many languages and machines. Like FB & Mac best
> but dream of day it can generate code for 'other' machines too.)

My eyes are a bit whacked from this coding life too I think, and I'm 
only 21. (x 2) :)

>
> I still wonder why the button in my example gets covered up by the
> drawing instructions when using Apearance mode but not Standard Basic.
> Any ideas?  Here's my example again...

There's no AutoClip in Appearance, so buttons are not protected from 
drawing. And even if they were, it would still require all windows 
likely be compositing types due to the shadow area surrounding all 
buttons (so it seems)

Using    IF evtCode = _wndRefresh THEN FN RefreshMain : 
DrawOneControl(Button&(1)) will show the button in your demo. However 
in OS X you will note a rim surrounding it.

The problem is that unless you are drawing over white (center the 
button in it), you will get the surrounding alpha channel region 
whiting out any color near. Such needs a compositing window type then.

What I did in Compositor for a pair of image-backed dialogs was to 
ditch the compositing window type (made life horrid) and then just 
painted in picts in appropriate places, leaving original window white 
showing where I would be adding buttons...so there's no rim showing 
then, and the buttons show themselves without tricks.

OSX makes the simple difficult for things like this.

Robert


> '------------------------------------------------------------
> '  How to fill between Rectangles with buttons;
> '   Original question by Bruce Gottshall (Sept 2, '04)
> '   Solution suggested by Al Staffieri Jr.
> '   Button test and FILL method by Stu Cram
> CLEAR LOCAL
> DIM AS RECT  r
> LOCAL FN RefreshMain
>    FlushWindowBuffer
>    COLOR _zBlue
>    PEN 2, 2, 1, 8, 0
>    SetRect( r, 72, 136, 504, 288 )
>    EraseRoundRect( r, 9, 9 )	' <--- paint entire area white first
>    FrameRoundRect( r, 9, 9 )
>    COLOR _zRed
>    InsetRect( r, 100, 18 )
>    FrameRoundRect ( r, 9, 9 )
>    LONG COLOR 32000, 48000, 64000	' <--- colour for FILL
>    FILL r.right+1, r.bottom+1	' <--- fill the region
>    PenNormal
>    COLOR _zBlack
>    FlushWindowBuffer
> END FN
> ' ----
> LOCAL FN doDialog
>    DIM evtCode, subCode
>    evtCode = DIALOG( 0 )
>    subCode = DIALOG ( evtCode )
>    IF evtCode = _wndRefresh THEN FN RefreshMain
> END FN
> ' ----
> ' Main program starts here...
> WINDOW 1, "Fill between rectangles", (0,0)-(800,600), 5
> BUTTON 1, 1, "Button #1", (100,100)-(200,180), _push
> ON DIALOG FN doDialog
> DO
>    HandleEvents
> UNTIL 0
> ' ---------------------------------------------------------------------
>
>
> --
> To unsubscribe, send ANY message to: 
> futurebasic-unsubscribe@...