[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 12:12:54 +0100
Hm, you may also need to install kEventClassControl/ 
kEventControlValueFieldChanged on the slider.

Bernie


On 4 Jan 2008, at 12:00, Bernie wrote:

>
> 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.
>> You can see this when running the  "PrefsWindow.bas" (FBtoC_1.0/  
>> Examples folder)
>>
>> appearance button _gccDebugSlider, _activeBtn, 4, 0, 3,, @r,  
>> _kControlSliderProc_kControlSliderHasTickMarks_kControlSliderLiveFeedback
>>
>> is there any chance to bring this nice feature back to life ?
>>
>
> Looks like FBtoC adds the standard handler to windows created with  
> appearance window statement (can't remember why that is now, but I'm  
> sure there's a good reason for it). Installing a null slider action  
> on the button seems to fix it:
>
> '------------
> long if 0
> "MySliderAction"
> enterproc MySliderAction( unusedControl as ControlRef,  
> unusedPartCode as short )
> '~'1
> // can be null
> 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
>
> //....
>
> fn InstallMySliderAction( button&(_cSlid) )
> '------------