FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

SYSTEM

Hide Control Strip


Recently I posted a request for a way of hiding the pesky Control Strip (which destroys the beauty of a whole-screen window), without success. The following program answers my own request. FN HideShowControlStrip has internal error-checking which makes it immune to abuses such as calling it twice to hide.
'---------------------------------------
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.com
 '   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
'------------------------------------------------------
Robert Purves