[futurebasic] Re: [FB] Cursors

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 2012 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Wed, 23 May 2012 00:53:26 -0400
That works great, thanks Bernie!

rc

On May 23, 2012, at 12:27 AM, Bernie wrote:

> 
> rc wrote:
> 
>>> Util_MouseTracking.incl
>>> Examples/Text/Util_MouseTracking demos 
>> 
>> Appears to not like a drawer window very much. They remain as iBeams, or arrows, going over a field no change.
>> 
> 
> Use HIViewNewTrackingArea instead:
> 
> '---------------
> include "Tlbx HIView.incl"
> include "Util_CE.incl"
> 
> // MacWindows.h
> toolbox fn SetDrawerParent( WindowRef inDrawerWindow, WindowRef inParent ) = OSStatus
> toolbox ToggleDrawer( WindowRef inDrawerWindow )
> 
> local fn MyTrackingAreaHandler( nextHandler as EventHandlerCallRef, theEvent as EventRef, userData as pointer ) as OSStatus
> '~'1
> select switch ( fn GetEventKind( theEvent ) )
> case _kEventControlTrackingAreaEntered : fn SetThemeCursor( _kThemeIBeamCursor )
> case _kEventControlTrackingAreaExited : fn SetThemeCursor( _kThemeArrowCursor )
> end select
> end fn = _noErr
> 
> dim as WindowRef   parent, drawer
> 
> appearance window 1,, (0,0)-(400,300), _kDocumentWindowClass, _kWindowCompositingAttribute
> appearance window -2,, (0,0)-(0,0), _kDrawerWindowClass, _kWindowCompositingAttribute
> appearance button 1,,,,,, (23,23)-(110,39), _kControlEditUnicodeTextProc
> fn HIViewNewTrackingArea( button&(1), NULL, 0, NULL )
> fn CEAddEvent( _kEventClassControl, _kEventControlTrackingAreaEntered )
> fn CEAddEvent( _kEventClassControl, _kEventControlTrackingAreaExited )
> fn CEInstallControlEventHandler( button&(1), @fn MyTrackingAreaHandler, NULL, NULL )
> 
> get window 1, @parent
> get window 2, @drawer
> fn SetDrawerParent( drawer, parent )
> ToggleDrawer( drawer )
> 
> RunApplicationEventLoop()