[futurebasic] Re: [FB] FBtoC : _kControlSliderLiveFeedback dead

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2008 : Group Archive : Group : All Groups

From: Bernie <fblist.bw@...>
Date: Fri, 4 Jan 2008 15:01:31 +0100
On 4 Jan 2008, at 09:30, Detlev Lang wrote:

> Apperance Button Control Slider does not show the "Live Feedback"  
> feature when translated with FBtoC.

This example appears to work in both FB and FBtoC:

'------------
_SliderTestWnd = 1
begin enum 1
_cSlider
_cStat
end enum

local fn SliderBtn
'~'1
def SetButtonTextString( _cStat, str$( button( _cSlider ) ) )
end fn

long if 0
"MySliderAction"
enterproc MySliderAction( c as ControlRef, partCode as short )
'~'1
fn SliderBtn
exitproc
end if

local fn InstallMySliderAction( c as ControlRef )
'~'1
begin globals
dim as pointer sMySliderActionUPP
end globals

long if ( sMySliderActionUPP == 0 )
#if def _FBtoC
sMySliderActionUPP = fn NewControlActionUPP( proc "MySliderAction" )
#else
sMySliderActionUPP = fn NewControlActionUPP( [proc "MySliderAction" +  
_FBprocToProcPtrOffset] )
#endif
end if
SetControlAction( c, sMySliderActionUPP )
end fn

local fn BuildSliderTestWnd
'~'1
dim as Rect r

SetRect( r, 0, 0, 326, 137 )
appearance window -_SliderTestWnd, "Slider Test", @r,  
_kDocumentWindowClass//, _kWindowStandardHandlerAttribute
def SetWindowBackground( _kThemeActiveDialogBackgroundBrush, _zTrue )

SetRect( r, 45, 54, 245, 78 )
appearance button _cSlider,, 5, 0, 4,, @r, _kControlSliderProc  
_kControlSliderHasTickMarks _kControlSliderLiveFeedback
appearance button _cSlider,, 0
fn InstallMySliderAction( button&( _cSlider ) )

SetRect( r, 268, 58, 288, 74 )
appearance button _cStat,,,,,, @r, _kControlStaticTextProc
def SetButtonTextString( _cStat, " 0" )

appearance window _SliderTestWnd
end fn

local fn DoDialog
'~'1
dim as long ev, id

ev = dialog( 0 )
id = dialog( ev )
select ev
case _wndClick : window id
case _btnClick
select window( _outputWnd )
case _SliderTestWnd
select id
case _cSlider : fn SliderBtn()
end select
end select
end select
end fn

fn BuildSliderTestWnd()

on dialog fn DoDialog

do
HandleEvents
until gFBQuit
'------------

Bernie