[futurebasic] Lion Full Screen Mode with a Scrollbar

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

From: Rich Love <carnationsoftware@...>
Date: Fri, 23 Sep 2011 09:54:43 -0500
Working with the Robert P. sample, I added a vertical scroll bar and changed the background color to blue.
The problem is that the scroll bar area remains blue during the transition to full screen (not good).

Is there any way to prevent this other than changing the background color to white?
Here is my modified sample code with the scrollbar and background color.

Rich

// MacWindows.h
toolbox fn HIWindowChangeAttributes( WindowRef inWindow, const int *inAttrToSet, const int *inAttrToClear ) = OSStatus
_kHIWindowBitFullScreenPrimary = 45 // 10.7
// toolbox fn HIWindowToggleFullScreen( WindowRef inWindow ) = OSStatus // 10.7; not in FB
// toolbox fn HIWindowIsFullScreen(WindowRef inWindow) = Boolean // 10.7; not in FB

local fn CarbonBundle as CFBundleRef
'~'1
begin globals
dim as CFBundleRef  sCarbonBundle // static
end globals
if ( sCarbonBundle == 0 ) then sCarbonBundle = fn CreateBundleForFramework( "Carbon.framework" )
end fn = sCarbonBundle


// in 10.6 and earlier, return _paramErr and do nothing 
local fn HIWindowToggleFullScreen( w as WindowRef ) as OSStatus
'~'1
dim as OSStatus  err : err = _paramErr
dim as ptr       f
def fn HIWindowToggleFS( ww as WindowRef ) as OSStatus using f
f = fn CFBundleGetFunctionPointerForName( fn CarbonBundle, @"HIWindowToggleFullScreen" ) 
if ( f ) then err = fn HIWindowToggleFS( w )
end fn = err


// in 10.6 and earlier, return _false 
local fn HIWindowIsFullScreen( w as WindowRef ) as Boolean
'~'1
dim as Boolean   result : result = _false
dim as ptr       f
def fn HIWindowIsFS( ww as WindowRef ) as Boolean using f
f = fn CFBundleGetFunctionPointerForName( fn CarbonBundle, @"HIWindowIsFullScreen" ) 
if ( f ) then result = fn HIWindowIsFS( w )
end fn = result


local fn BuildWindow
'~'1
dim as SInt32   attr(1)

appearance window 1,, (0,0)-(480,360), _kDocumentWindowClass, _kWindowResizableAttribute
attr(0) = _kHIWindowBitFullScreenPrimary
attr(1) = 0
fn HIWindowChangeAttributes( window( _wndRef ), @attr(0), NULL )
end fn 


dim as WindowRef  w
fn BuildWindow()


SCROLL BUTTON 8001,1,,,,,_scrollVert'move thumb to correct position. 8/02/2007 Added _scrollVert to  be Appearance Compliant

DIM RGB.RGBCOLOR
RGB.Red%=0
RGB.Green%=0
RGB.Blue%=40000

CALL RGBBackColor(#@RGB)



get window 1, @w
fn HIWindowToggleFullScreen( w )
HandleEvents