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;
#endif
}
-void wxFrame::SetAcceleratorTable(const wxAcceleratorTable& accel)
-{
- m_acceleratorTable = accel;
-}
-
wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
const wxString& name)
{
#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)
void wxFrame::PositionToolBar(void)
{
- int cw, ch;
-
RECT rect;
::GetClientRect((HWND) GetHWND(), &rect);
}
}
}
+
+// 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);
+ }
+ }
+}
+