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
switch (id)
{
- case SIZEFULLSCREEN:
case SIZENORMAL:
+ // 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;
}
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);
+ }
+ }
+}
+