From 136518e5c08bfb00413cd071929b857883ab2656 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 3 Jan 2005 22:10:10 +0000 Subject: [PATCH] Factor out the OnSize code so it can also be used in other places where the header window needs to be adjusted. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- .../contrib/gizmos/wxCode/include/wx/treelistctrl.h | 2 +- wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/wxPython/contrib/gizmos/wxCode/include/wx/treelistctrl.h b/wxPython/contrib/gizmos/wxCode/include/wx/treelistctrl.h index ad8190dac9..7746a96d36 100644 --- a/wxPython/contrib/gizmos/wxCode/include/wx/treelistctrl.h +++ b/wxPython/contrib/gizmos/wxCode/include/wx/treelistctrl.h @@ -545,7 +545,7 @@ protected: void OnSize(wxSizeEvent& event); void CalculateAndSetHeaderHeight(); - + void DoHeaderLayout(); private: size_t fill_column; diff --git a/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp b/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp index c178ad47eb..bebd08d5f1 100644 --- a/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp +++ b/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp @@ -4653,8 +4653,7 @@ void wxTreeListCtrl::CalculateAndSetHeaderHeight() } } - -void wxTreeListCtrl::OnSize(wxSizeEvent& WXUNUSED(event)) +void wxTreeListCtrl::DoHeaderLayout() { int w, h; GetClientSize(&w, &h); @@ -4665,6 +4664,11 @@ void wxTreeListCtrl::OnSize(wxSizeEvent& WXUNUSED(event)) } if (m_main_win) m_main_win->SetSize(0, m_headerHeight + 1, w, h - m_headerHeight - 1); +} + +void wxTreeListCtrl::OnSize(wxSizeEvent& WXUNUSED(event)) +{ + DoHeaderLayout(); } @@ -5015,7 +5019,10 @@ wxString wxTreeListCtrl::GetColumnText(size_t column) const { return m_header_win->GetColumnText(column); } void wxTreeListCtrl::AddColumn(const wxTreeListColumnInfo& col) -{ m_header_win->AddColumn(col); } +{ + m_header_win->AddColumn(col); + DoHeaderLayout(); +} void wxTreeListCtrl::InsertColumn(size_t before, const wxTreeListColumnInfo& col) -- 2.45.2