}
#endif // wxUSE_CARET
- wxFocusEvent event( wxEVT_SET_FOCUS, win->GetId() );
- event.SetEventObject( win );
+ if (win->IsTopLevel())
+ {
+ wxActivateEvent event( wxEVT_ACTIVATE, TRUE, win->GetId() );
+ event.SetEventObject( win );
- if (win->GetEventHandler()->ProcessEvent( event ))
+ if (win->GetEventHandler()->ProcessEvent( event ))
+ {
+ gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_in_event" );
+ return TRUE;
+ }
+ }
+ else
{
- gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_in_event" );
- return TRUE;
+ wxFocusEvent event( wxEVT_SET_FOCUS, win->GetId() );
+ event.SetEventObject( win );
+
+ if (win->GetEventHandler()->ProcessEvent( event ))
+ {
+ gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_in_event" );
+ return TRUE;
+ }
}
+
return FALSE;
}
}
#endif // wxUSE_CARET
- wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
- event.SetEventObject( win );
+ if (win->IsTopLevel())
+ {
+ wxActivateEvent event( wxEVT_ACTIVATE, FALSE, win->GetId() );
+ event.SetEventObject( win );
- if (win->GetEventHandler()->ProcessEvent( event ))
+ if (win->GetEventHandler()->ProcessEvent( event ))
+ {
+ gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_out_event" );
+ return TRUE;
+ }
+ }
+ else
{
- gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_out_event" );
- return TRUE;
+ wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
+ event.SetEventObject( win );
+
+ if (win->GetEventHandler()->ProcessEvent( event ))
+ {
+ gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_out_event" );
+ return TRUE;
+ }
}
return FALSE;
// do it only once
g_sendActivateEvent = -1;
- wxActivateEvent event(wxEVT_ACTIVATE, activate, GetId());
+ wxActivateEvent event(wxEVT_ACTIVATE_APP, activate, GetId());
event.SetEventObject(this);
(void)GetEventHandler()->ProcessEvent(event);