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
This commit is contained in:
Robin Dunn
2005-01-03 22:10:10 +00:00
parent f78e4942ec
commit 136518e5c0
2 changed files with 11 additions and 4 deletions

View File

@@ -545,7 +545,7 @@ protected:
void OnSize(wxSizeEvent& event); void OnSize(wxSizeEvent& event);
void CalculateAndSetHeaderHeight(); void CalculateAndSetHeaderHeight();
void DoHeaderLayout();
private: private:
size_t fill_column; size_t fill_column;

View File

@@ -4653,8 +4653,7 @@ void wxTreeListCtrl::CalculateAndSetHeaderHeight()
} }
} }
void wxTreeListCtrl::DoHeaderLayout()
void wxTreeListCtrl::OnSize(wxSizeEvent& WXUNUSED(event))
{ {
int w, h; int w, h;
GetClientSize(&w, &h); GetClientSize(&w, &h);
@@ -4667,6 +4666,11 @@ void wxTreeListCtrl::OnSize(wxSizeEvent& WXUNUSED(event))
m_main_win->SetSize(0, m_headerHeight + 1, w, h - m_headerHeight - 1); m_main_win->SetSize(0, m_headerHeight + 1, w, h - m_headerHeight - 1);
} }
void wxTreeListCtrl::OnSize(wxSizeEvent& WXUNUSED(event))
{
DoHeaderLayout();
}
size_t wxTreeListCtrl::GetCount() const { return m_main_win->GetCount(); } size_t wxTreeListCtrl::GetCount() const { return m_main_win->GetCount(); }
@@ -5015,7 +5019,10 @@ wxString wxTreeListCtrl::GetColumnText(size_t column) const
{ return m_header_win->GetColumnText(column); } { return m_header_win->GetColumnText(column); }
void wxTreeListCtrl::AddColumn(const wxTreeListColumnInfo& col) void wxTreeListCtrl::AddColumn(const wxTreeListColumnInfo& col)
{ m_header_win->AddColumn(col); } {
m_header_win->AddColumn(col);
DoHeaderLayout();
}
void wxTreeListCtrl::InsertColumn(size_t before, void wxTreeListCtrl::InsertColumn(size_t before,
const wxTreeListColumnInfo& col) const wxTreeListColumnInfo& col)