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:
parent
952f2aaa86
commit
6bbe97b71d
@ -86,6 +86,7 @@ public:
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnIconized(wxIconizeEvent& event);
|
||||
|
||||
bool HandleActivate(int state, bool minimized, WXHWND activate);
|
||||
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
|
||||
@ -103,6 +104,10 @@ protected:
|
||||
|
||||
virtual WXHICON GetDefaultIcon() const;
|
||||
|
||||
// set the size of the MDI client window to match the frame size
|
||||
void UpdateClientSize();
|
||||
|
||||
|
||||
wxMDIClientWindow * m_clientWindow;
|
||||
wxMDIChildFrame * m_currentChild;
|
||||
wxMenu* m_windowMenu;
|
||||
@ -191,7 +196,7 @@ protected:
|
||||
private:
|
||||
bool m_needsInitialShow; // Show must be called in idle time after Creation
|
||||
bool m_needsResize; // flag which tells us to artificially resize the frame
|
||||
virtual void DetachMenuBar() ;
|
||||
virtual void DetachMenuBar() ;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMDIChildFrame)
|
||||
|
@ -133,6 +133,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame)
|
||||
EVT_SIZE(wxMDIParentFrame::OnSize)
|
||||
EVT_ICONIZE(wxMDIParentFrame::OnIconized)
|
||||
EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
@ -323,7 +324,7 @@ void wxMDIParentFrame::DoMenuUpdates(wxMenu* menu)
|
||||
}
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::OnSize(wxSizeEvent&)
|
||||
void wxMDIParentFrame::UpdateClientSize()
|
||||
{
|
||||
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
|
||||
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
|
||||
{
|
||||
@ -852,8 +870,8 @@ void wxMDIChildFrame::InternalSetMenuBar()
|
||||
|
||||
void wxMDIChildFrame::DetachMenuBar()
|
||||
{
|
||||
RemoveWindowMenu(NULL, m_hMenu);
|
||||
wxFrame::DetachMenuBar();
|
||||
RemoveWindowMenu(NULL, m_hMenu);
|
||||
wxFrame::DetachMenuBar();
|
||||
}
|
||||
|
||||
WXHICON wxMDIChildFrame::GetDefaultIcon() 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,
|
||||
// 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))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user