X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/954fc50b6edca29cfc1b042c1227c91023580131..2fe212b0336512aac9eace69fab09ce856b0bf4b:/src/mac/carbon/window.cpp?ds=sidebyside diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 32f583f2ec..40f2f2a960 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -45,7 +45,7 @@ #define wxWINDOW_VSCROLL 5997 #define MAC_SCROLLBAR_SIZE 16 -#include +#include "wx/mac/uma.h" #if wxUSE_DRAG_AND_DROP #include "wx/dnd.h" @@ -264,11 +264,9 @@ void wxWindowMac::SetFocus() } #endif // wxUSE_CARET // panel wants to track the window which was the last to have focus in it - wxPanel *panel = wxDynamicCast(GetParent(), wxPanel); - if ( panel ) - { - panel->SetLastFocus((wxWindow*)this); - } + wxChildFocusEvent eventFocus(this); + (void)GetEventHandler()->ProcessEvent(eventFocus); + #ifndef __WXUNIVERSAL__ wxControl* control = wxDynamicCast( gFocusWindow , wxControl ) ; if ( control && control->GetMacControl() ) @@ -1482,18 +1480,10 @@ void wxWindowMac::OnSetFocus(wxFocusEvent& event) // notice that it's also important to do it upwards the tree becaus // otherwise when the top level panel gets focus, it won't set it back to // us, but to some other sibling - wxWindowMac *win = this; - while ( win ) - { - wxWindowMac *parent = win->GetParent(); - wxPanel *panel = wxDynamicCast(parent, wxPanel); - if ( panel ) - { - panel->SetLastFocus(win); - } - - win = parent; - } + + // CS:don't know if this is still needed: + //wxChildFocusEvent eventFocus(this); + //(void)GetEventHandler()->ProcessEvent(eventFocus); event.Skip(); }