- wxCommandEvent commandEvent(wxEVENT_TYPE_MENU_COMMAND, id);
- commandEvent.SetInt( id );
- commandEvent.SetEventObject( this );
-
- wxMenuBar *bar = GetMenuBar() ;
- if (!bar)
- return;
-
- // Motif does the job by itself!!
-#ifndef __MOTIF__
- wxMenuItem *item = bar->FindItemForId(id) ;
- if (item && item->IsCheckable())
- {
-//wxDebugMsg("Toggling id %d\n",id) ;
- bar->Check(id,!bar->Checked(id)) ;
- }
-#endif
- if (!ProcessEvent(commandEvent))
- OldOnMenuCommand(id);
+ bool processed = FALSE;
+
+ switch ( id )
+ {
+ case SIZENORMAL:
+ // only do it it if we were iconized before, otherwise resizing the
+ // parent frame has a curious side effect of bringing it under it's
+ // children
+ if ( !m_iconized )
+ break;
+
+ // restore all child frames too
+ IconizeChildFrames(FALSE);
+
+ // fall through
+
+ case SIZEFULLSCREEN:
+ m_iconized = FALSE;
+ break;
+
+ case SIZEICONIC:
+ // iconize all child frames too
+ IconizeChildFrames(TRUE);
+
+ m_iconized = TRUE;
+ break;
+ }
+
+ if ( !m_iconized )
+ {
+ // forward WM_SIZE to status bar control
+#if wxUSE_NATIVE_STATUSBAR
+ if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
+ {
+ wxSizeEvent event(wxSize(x, y), m_frameStatusBar->GetId());
+ event.SetEventObject( m_frameStatusBar );
+
+ ((wxStatusBar95 *)m_frameStatusBar)->OnSize(event);
+ }
+#endif // wxUSE_NATIVE_STATUSBAR
+
+ PositionStatusBar();
+ PositionToolBar();
+
+ wxSizeEvent event(wxSize(x, y), m_windowId);
+ event.SetEventObject( this );
+ processed = GetEventHandler()->ProcessEvent(event);
+ }
+
+ return processed;