X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a3622daa901777a33969d8bc04e2d62dee14d164..52cbfcf009d9f2ac995280bd6f5dcf584295b67d:/src/msw/frame.cpp diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 71309be724..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); @@ -1011,3 +1022,16 @@ 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); + } + } +} +