- if (nFlags == 0xFFFF && hSysMenu == 0)
- {
- wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, -1);
- event.SetEventObject( this );
- GetEventHandler()->ProcessEvent(event);
- }
- else if (nFlags != MF_SEPARATOR)
- {
- wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, nItem);
- event.SetEventObject( this );
- GetEventHandler()->ProcessEvent(event);
- }
+ for ( wxWindowList::Node *node = GetChildren().GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxWindow *win = node->GetData();
+
+ // iconizing the frames with this style under Win95 shell puts them at
+ // the bottom of the screen (as the MDI children) instead of making
+ // them appear in the taskbar because they are, by virtue of this
+ // style, not managed by the taskbar - instead leave Windows take care
+ // of them
+#ifdef __WIN95__
+ if ( win->GetWindowStyle() & wxFRAME_TOOL_WINDOW )
+ continue;
+#endif // Win95
+
+ // the child MDI frames are a special case and should not be touched by
+ // the parent frame - instead, they are managed by the user
+ wxFrame *frame = wxDynamicCast(win, wxFrame);
+ if ( frame
+#if wxUSE_MDI_ARCHITECTURE
+ && !wxDynamicCast(frame, wxMDIChildFrame)
+#endif // wxUSE_MDI_ARCHITECTURE
+ )
+ {
+ // we don't want to restore the child frames which had been
+ // iconized even before we were iconized, so save the child frame
+ // status when iconizing the parent frame and check it when
+ // restoring it
+ if ( bIconize )
+ {
+ // note that we shouldn't touch the hidden frames neither
+ // because iconizing/restoring them would show them as a side
+ // effect
+ frame->m_wasMinimized = frame->IsIconized() || !frame->IsShown();
+ }
+
+ // this test works for both iconizing and restoring
+ if ( !frame->m_wasMinimized )
+ frame->Iconize(bIconize);
+ }
+ }