improved handling of frames with parent: now they have a NULL parent HWND (to

avoid Win32 bugs in handling this situation) but still are iconized/restored
with their parent frame


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@462 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1998-08-07 22:21:08 +00:00
parent c1066cdf62
commit d2aef3124b
2 changed files with 31 additions and 5 deletions

View File

@@ -156,6 +156,9 @@ public:
int x, int y, int width, int height, long style);
protected:
// propagate our state change to all child frames
void IconizeChildFrames(bool bIconize);
wxMenuBar * m_frameMenuBar;
wxStatusBar * m_frameStatusBar;
wxIcon m_icon;

View File

@@ -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;
@@ -684,11 +687,20 @@ void wxFrame::MSWOnSize(int x, int y, WXUINT id)
#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;
}
@@ -982,8 +994,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 +1021,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);
}
}
}