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:
@@ -156,6 +156,9 @@ public:
|
|||||||
int x, int y, int width, int height, long style);
|
int x, int y, int width, int height, long style);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
// propagate our state change to all child frames
|
||||||
|
void IconizeChildFrames(bool bIconize);
|
||||||
|
|
||||||
wxMenuBar * m_frameMenuBar;
|
wxMenuBar * m_frameMenuBar;
|
||||||
wxStatusBar * m_frameStatusBar;
|
wxStatusBar * m_frameStatusBar;
|
||||||
wxIcon m_icon;
|
wxIcon m_icon;
|
||||||
|
@@ -112,8 +112,11 @@ bool wxFrame::Create(wxWindow *parent,
|
|||||||
int height = size.y;
|
int height = size.y;
|
||||||
|
|
||||||
m_iconized = FALSE;
|
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);
|
wxModelessWindows.Append(this);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -684,11 +687,20 @@ void wxFrame::MSWOnSize(int x, int y, WXUINT id)
|
|||||||
#endif
|
#endif
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case SIZEFULLSCREEN:
|
|
||||||
case SIZENORMAL:
|
case SIZENORMAL:
|
||||||
|
// restore all child frames too
|
||||||
|
IconizeChildFrames(FALSE);
|
||||||
|
|
||||||
|
// fall through
|
||||||
|
|
||||||
|
case SIZEFULLSCREEN:
|
||||||
m_iconized = FALSE;
|
m_iconized = FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIZEICONIC:
|
case SIZEICONIC:
|
||||||
|
// iconize all child frames too
|
||||||
|
IconizeChildFrames(TRUE);
|
||||||
|
|
||||||
m_iconized = TRUE;
|
m_iconized = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -982,8 +994,6 @@ wxToolBar* wxFrame::OnCreateToolBar(long style, wxWindowID id, const wxString& n
|
|||||||
|
|
||||||
void wxFrame::PositionToolBar(void)
|
void wxFrame::PositionToolBar(void)
|
||||||
{
|
{
|
||||||
int cw, ch;
|
|
||||||
|
|
||||||
RECT rect;
|
RECT rect;
|
||||||
::GetClientRect((HWND) GetHWND(), &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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user