// { kEventClassControl , kEventControlBoundsChanged } ,
} ;
+wxWindowMac* targetWindow = NULL;
+
static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
{
OSStatus result = eventNotHandledErr ;
inKillFocusEvent = true ;
wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId());
event.SetEventObject(thisWindow);
+ event.SetWindow(targetWindow);
thisWindow->HandleWindowEvent(event) ;
inKillFocusEvent = false ;
}
}
#endif
ControlPartCode controlPart = cEvent.GetParameter<ControlPartCode>(kEventParamControlPart , typeControlPartCode );
-
+ if ( controlPart != kControlFocusNoPart )
+ targetWindow = thisWindow;
+
ControlPartCode previousControlPart = 0;
verify_noerr( HIViewGetFocusPart(controlRef, &previousControlPart));
if ( !IsTopLevel() )
{
- wxTopLevelWindowMac* top = MacGetTopLevelWindow();
+ wxNonOwnedWindow* top = MacGetTopLevelWindow();
if (top)
{
pt.x -= MacGetLeftBorderSize() ;
if ( !IsTopLevel() )
{
- wxTopLevelWindowMac* top = MacGetTopLevelWindow();
+ wxNonOwnedWindow* top = MacGetTopLevelWindow();
if (top)
{
wxMacControl::Convert( &pt , top->m_peer , m_peer ) ;
wxWindowMac *mouseWin = 0 ;
{
- wxTopLevelWindowMac *tlw = MacGetTopLevelWindow() ;
+ wxNonOwnedWindow *tlw = MacGetTopLevelWindow() ;
WindowRef window = (WindowRef) ( tlw ? tlw->MacGetWindowRef() : 0 ) ;
ControlPartCode part ;
void wxWindowMac::Update()
{
- wxTopLevelWindowMac* top = MacGetTopLevelWindow();
+ wxNonOwnedWindow* top = MacGetTopLevelWindow();
if (top)
top->MacPerformUpdates() ;
}
-wxTopLevelWindowMac* wxWindowMac::MacGetTopLevelWindow() const
+wxNonOwnedWindow* wxWindowMac::MacGetTopLevelWindow() const
{
- wxTopLevelWindowMac* win = NULL ;
+ wxNonOwnedWindow* win = NULL ;
WindowRef window = (WindowRef) MacGetTopLevelWindowRef() ;
if ( window )
win = wxFindWinFromMacWindow( window ) ;
#if wxUSE_POPUPWIN
wxPopupWindow* popupwin = wxDynamicCast(iter,wxPopupWindow);
if ( popupwin )
- return popupwin->MacGetPopupWindowRef();
+ return popupwin->MacGetWindowRef();
#endif
}
iter = iter->GetParent() ;