From: Julian Smart Date: Thu, 25 Mar 2004 13:14:54 +0000 (+0000) Subject: Added UpdateSize to wxSplitterWindow, to allow an app X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7e521b01c32d4f98de9f6b7624968ee4cdaada93 Added UpdateSize to wxSplitterWindow, to allow an app to force pane resizing _before_ showing the window. Added a call to UpdateSize from helpfrm.cpp. Without this, the flicker is horrible. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26333 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/generic/splitter.h b/include/wx/generic/splitter.h index 1162e887da..61e4c08008 100644 --- a/include/wx/generic/splitter.h +++ b/include/wx/generic/splitter.h @@ -129,6 +129,11 @@ public: // parameter should be NULL) bool ReplaceWindow(wxWindow *winOld, wxWindow *winNew); + // Make sure the child window sizes are updated. This is useful + // for reducing flicker by updating the sizes before a + // window is shown, if you know the overall size is correct. + void UpdateSize(); + // Is the window split? bool IsSplit() const { return (m_windowTwo != NULL); } diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index 4269063c1d..1d6a539568 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -801,6 +801,16 @@ void wxSplitterWindow::SetSashPosition(int position, bool redraw) } } +// Make sure the child window sizes are updated. This is useful +// for reducing flicker by updating the sizes before a +// window is shown, if you know the overall size is correct. +void wxSplitterWindow::UpdateSize() +{ + m_checkRequestedSashPosition = true; + SizeWindows(); + m_checkRequestedSashPosition = false; +} + bool wxSplitterWindow::DoSendEvent(wxSplitterEvent& event) { return !GetEventHandler()->ProcessEvent(event) || event.IsAllowed(); diff --git a/src/html/helpctrl.cpp b/src/html/helpctrl.cpp index 2900d99d31..5f0bc3fd68 100644 --- a/src/html/helpctrl.cpp +++ b/src/html/helpctrl.cpp @@ -148,6 +148,7 @@ void wxHtmlHelpController::CreateHelpWindow() m_helpFrame->Create(NULL, wxID_HTML_HELPFRAME, wxEmptyString, m_FrameStyle); m_helpFrame->SetTitleFormat(m_titleFormat); + m_helpFrame->Show(TRUE); } diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp index f8d35f3a50..ac2b31819d 100644 --- a/src/html/helpfrm.cpp +++ b/src/html/helpfrm.cpp @@ -490,6 +490,13 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, } } + // Reduce flicker by updating the splitter pane sizes before the + // frame is shown + wxSizeEvent sizeEvent(GetSize(), GetId()); + ProcessEvent(sizeEvent); + + m_Splitter->UpdateSize(); + return TRUE; }