wxMac - click-through behavior

Michael Stauffer michael at circular-logic.com
Fri Jun 1 15:10:24 PDT 2007


wxMac 2.8.3
OS X 10.4

Hi,

I'm trying to get click-through behavior for controls going on Mac.
Click-through is for controls that are in an inactive window, so they can be
clicked directly and processed, without first having to click to bring their
parent window to the front, and then click again to actual "do" the control.

I've hacked into mac/carbon/window.cpp, and in
wxMacWindowControlEventHandler(), under the case for
kEventControlGetClickActivation, I've changed the code to this:

        case kEventControlGetClickActivation :
            {
            	// fix to always have a proper activation for DataBrowser
controls (stay in bkgnd otherwise)
                WindowRef owner =
cEvent.GetParameter<WindowRef>(kEventParamWindowRef);
                if ( !IsWindowActive(owner) )
                {
	
//cEvent.SetParameter(kEventParamClickActivation,(UInt32)
kActivateAndIgnoreClick) ;
                    cEvent.SetParameter(kEventParamClickActivation,(UInt32)
kActivateAndHandleClick) ;
	
//do "click-through"					
                    result = noErr ;
                }
            }

However, this only enables click-through for wxButton-derived controls, and
not for system controls. Does anyone know how I might get all controls
working with click-through? 

I tried adding hacking mac/carbon/toplevelwindow.cpp to add the
kEventWindowGetClickActivation event and this handler:

		case kEventWindowGetClickActivation:	
		{
            	cEvent.SetParameter(kEventParamClickActivation,(UInt32)
kActivateAndHandleClick) ;
				//This doesn't seem to work, or at least
it's not getting any events.
			result = noErr;
		}
			break;


In a related issue, how might I get controls to *not* be greyed out in
inactive wxDialog-derived windows?

Many thanks,
Michael





More information about the wx-users mailing list