[futurebasic] Re: [FB] questions

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1999 : Group Archive : Group : All Groups

From: Robert Purves <robert.purves@...>
Date: Sun, 10 Oct 1999 13:20:49 +1300
>Does anyone know how to:
>1) show/hide the  control strip on a G3 from within a FutureBasic II
>program?

Copied from a posting in March 1999, with a tiny correction in the intro blurb.
 -- see below

Robert Purves


'---------------------------------------
DIM gControlStripWasVisible ' to remember original state

LOCAL FN HideShowControlStrip(hideFlag)
 ' hideFlag = 0 ----- Hide Control Strip
 '   out: zero      = CS was already hidden
 '        non-zero  = CS was visible & is now hidden
 ' hideFlag <> 0 --- Show Control Strip
 '   out: zero      = CS was already visible
 '        non-zero  = CS was hidden & is now visible

 ' Modified for Future Basic by: Robert Purves    March 1999
 ' from Fantasm assembler code released into public domain by:
 '   James Hague     jhague@...
 '   Dadgum Games    www.dadgum.com/

 `  move.l #'sdev',d0 ; CS selector
 `  dc.w GESTALT      ; trap word
 `  tst.l d0
 `  bne.s Failure     ; fail if selector doesn't exist
 `  move.w a0,d0
 `  beq.s Failure     ; fail if no CS
 `  clr.b -(sp)
 `  dc.w $7000,$AAF2  ; SBIsControlStripVisible
 `  tst.w ^hideFlag
 `  bne.s Show
 `  move.b (sp)+,d0
 `  beq.s Failure     ; fail if already hidden
 `  clr.b -(sp)       ; to hide it
 `  bra.s ChangeIt
 `Failure
 `  moveq.w #0,d0     ; return fail value
 `  bra.s Done
 `Show
 `  move.b (sp)+,d0
 `  bne.s Failure     ; fail if already visible
 `  move.b #1,-(sp)   ; to show it
 `ChangeIt
 `  dc.w $303C,$0101,$AAF2 ; SBShowHideControlStrip
 `  moveq.w #-1,d0     ; return success value
 `Done
END FN

WINDOW 1
gControlStripWasVisible=FN HideShowControlStrip(0) ' hide
DO
 HANDLEEVENTS
UNTIL FN BUTTON
'restore original state nicely on exit
IF gControlStripWasVisible THEN FN HideShowControlStrip(-1)
END
'------------------------------------------------------