X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e1a6fc11e208d85b5dae82a8adc0dc7535cd5958..d069d02e1e27f6d924c3b28173ff81d87ec8b072:/src/msw/frame.cpp diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 75f2e5d0af..a45bf2ea6b 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -112,8 +112,11 @@ bool wxFrame::Create(wxWindow *parent, int height = size.y; m_iconized = FALSE; - MSWCreate(m_windowId, (wxWindow *)parent, wxFrameClassName, this, (char *)(const char *)title, - x, y, width, height, style); + + // we pass NULL as parent to MSWCreate because frames with parents behave + // very strangely under Win95 shell + MSWCreate(m_windowId, NULL, wxFrameClassName, this, title, + x, y, width, height, style); wxModelessWindows.Append(this); return TRUE; @@ -349,11 +352,6 @@ void wxFrame::SetIcon(const wxIcon& icon) #endif } -void wxFrame::SetAcceleratorTable(const wxAcceleratorTable& accel) -{ - m_acceleratorTable = accel; -} - wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id, const wxString& name) { @@ -684,13 +682,28 @@ void wxFrame::MSWOnSize(int x, int y, WXUINT id) #endif switch (id) { - case SIZEFULLSCREEN: 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; + break; + case SIZEICONIC: + // iconize all child frames too + IconizeChildFrames(TRUE); + m_iconized = TRUE; - break; + break; } if (!m_iconized) @@ -982,8 +995,6 @@ wxToolBar* wxFrame::OnCreateToolBar(long style, wxWindowID id, const wxString& n void wxFrame::PositionToolBar(void) { - int cw, ch; - RECT rect; ::GetClientRect((HWND) GetHWND(), &rect); @@ -1012,3 +1023,15 @@ void wxFrame::PositionToolBar(void) } } +// propagate our state change to all child frames +void wxFrame::IconizeChildFrames(bool bIconize) +{ + wxWindow *child = NULL; + for ( wxNode *node = GetChildren()->First(); node; node = node->Next() ) { + wxWindow *win = (wxWindow *)node->Data(); + if ( win->IsKindOf(CLASSINFO(wxFrame)) ) { + ((wxFrame *)win)->Iconize(bIconize); + } + } +} +