force update of MDI client window size after the MDI parent frame is iconized and restored, otherwise all kinds of bad things (changes in MDI children positions; possibility to move them above the toolbar and below the status bar; wrong repaining) happen
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -86,6 +86,7 @@ public:
|
|||||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||||
|
|
||||||
void OnSize(wxSizeEvent& event);
|
void OnSize(wxSizeEvent& event);
|
||||||
|
void OnIconized(wxIconizeEvent& event);
|
||||||
|
|
||||||
bool HandleActivate(int state, bool minimized, WXHWND activate);
|
bool HandleActivate(int state, bool minimized, WXHWND activate);
|
||||||
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
|
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
|
||||||
@@ -103,6 +104,10 @@ protected:
|
|||||||
|
|
||||||
virtual WXHICON GetDefaultIcon() const;
|
virtual WXHICON GetDefaultIcon() const;
|
||||||
|
|
||||||
|
// set the size of the MDI client window to match the frame size
|
||||||
|
void UpdateClientSize();
|
||||||
|
|
||||||
|
|
||||||
wxMDIClientWindow * m_clientWindow;
|
wxMDIClientWindow * m_clientWindow;
|
||||||
wxMDIChildFrame * m_currentChild;
|
wxMDIChildFrame * m_currentChild;
|
||||||
wxMenu* m_windowMenu;
|
wxMenu* m_windowMenu;
|
||||||
|
@@ -133,6 +133,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow)
|
|||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame)
|
BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame)
|
||||||
EVT_SIZE(wxMDIParentFrame::OnSize)
|
EVT_SIZE(wxMDIParentFrame::OnSize)
|
||||||
|
EVT_ICONIZE(wxMDIParentFrame::OnIconized)
|
||||||
EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged)
|
EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
@@ -323,7 +324,7 @@ void wxMDIParentFrame::DoMenuUpdates(wxMenu* menu)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMDIParentFrame::OnSize(wxSizeEvent&)
|
void wxMDIParentFrame::UpdateClientSize()
|
||||||
{
|
{
|
||||||
if ( GetClientWindow() )
|
if ( GetClientWindow() )
|
||||||
{
|
{
|
||||||
@@ -334,6 +335,23 @@ void wxMDIParentFrame::OnSize(wxSizeEvent&)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxMDIParentFrame::OnSize(wxSizeEvent& WXUNUSED(event))
|
||||||
|
{
|
||||||
|
UpdateClientSize();
|
||||||
|
|
||||||
|
// do not call event.Skip() here, it somehow messes up MDI client window
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMDIParentFrame::OnIconized(wxIconizeEvent& event)
|
||||||
|
{
|
||||||
|
event.Skip();
|
||||||
|
|
||||||
|
if ( !event.Iconized() )
|
||||||
|
{
|
||||||
|
UpdateClientSize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Returns the active MDI child window
|
// Returns the active MDI child window
|
||||||
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
|
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
|
||||||
{
|
{
|
||||||
@@ -1285,11 +1303,11 @@ void wxMDIClientWindow::DoSetSize(int x, int y, int width, int height, int sizeF
|
|||||||
// (see OGL studio sample). So check if the position is changed and if so,
|
// (see OGL studio sample). So check if the position is changed and if so,
|
||||||
// redraw the MDI child frames.
|
// redraw the MDI child frames.
|
||||||
|
|
||||||
wxPoint oldPos = GetPosition();
|
const wxPoint oldPos = GetPosition();
|
||||||
|
|
||||||
wxWindow::DoSetSize(x, y, width, height, sizeFlags);
|
wxWindow::DoSetSize(x, y, width, height, sizeFlags | wxSIZE_FORCE);
|
||||||
|
|
||||||
wxPoint newPos = GetPosition();
|
const wxPoint newPos = GetPosition();
|
||||||
|
|
||||||
if ((newPos.x != oldPos.x) || (newPos.y != oldPos.y))
|
if ((newPos.x != oldPos.x) || (newPos.y != oldPos.y))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user