[futurebasic] Re: [FB] Carbon pG buttons

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2002 : Group Archive : Group : All Groups

From: Alberto Fiumana <alfium@...>
Date: Sat, 16 Nov 2002 11:16:48 +0100
Il giorno 15/11/2002 6:14, MoorePrint@..., MoorePrint@... ha
scritto:

> I am planning to do some change to allow pG to use the pulsating button trick
> shown in the rel 7 examples. I plan to just do an override of the function
> that draw frammed buttons and sub that code. I don't know if the "imitation"
> pulsating buttons receive keyboard returns. If not I'll be at a loss.
> 
> Any already done this?
> 
> 
> Bruce Moore
> 
> --
> To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>
> 

Hi Bruce, (sorry for my English)

Yes "imitation" receive keyboard returns.
But in Return.FLRT  change in this mode (as cancel filter):

"Return.FLTR"
LONG IF gLongAction& = _oEvents
LONG IF gWhat = _keyDwnEvt
SELECT {@gMessage& + 2}
CASE &240d'return
FN checkReturn
CASE &4c03'return numeric layout
FN checkReturn
END SELECT
END IF
END IF
IF 0 THEN RETURN

I don't know because, but in this mode work (Mac OS 9 and Mac OS X)




      My solution for pulsating buttons is in Runtime.INCL
      add:

#if CarbonLib'Aggiunta per i push button di MAC OS X
toolbox fn SetControlData(ControlRef, ControlPartCode inPart, ¬
         ResType inTagName, long inSize, ptr * inData) = OSErr

local mode 'rel 7 examples
local fn ConvertBtnToShadow( btnNum as short )
dim as OSErr     err
dim as boolean @ bool
bool = _zTrue
err  = fn SetControlData( button&( btnNum ), 0, _"dflt", 1, bool )
Draw1Control( button&(btnNum) )
end fn

#endif




    and in FN pGdrawControls
    change BUTTON gObjRef,gObjCtrlVal,objText$,@gObjT,tempType

with

#if CarbonLib // aggiunta da me special workaround per MAc OS X
long if tempType=_shadow && gObjCtrlVal=_activeBtn
button gObjRef, _activeBtn,objText$,@gObjT, _push
fn ConvertBtnToShadow(gObjRef)
xelse
long if tempType=129 'geneva
BUTTON gObjRef,gObjCtrlVal,objText$,@gObjT,369+_useWFont
xelse
BUTTON gObjRef,gObjCtrlVal,objText$,@gObjT,tempType 'chiamata normale non é
framed e geneva
end if
end if
#else // normal code
BUTTON gObjRef,gObjCtrlVal,objText$,@gObjT,tempType 'chiamata normale
#endif



Dott. Geol. Alberto Fiumana
http://space.tin.it/computer/albfiuma/