fix for calculating the header window height (patch 805791)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23588 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-09-14 22:52:47 +00:00
parent 94dd23aebc
commit 86351e4a9d

View File

@@ -4549,11 +4549,24 @@ wxGenericListCtrl::~wxGenericListCtrl()
void wxGenericListCtrl::CalculateAndSetHeaderHeight()
{
// we use the letter "H" for calculating the needed space, basing on the current font
int w, h;
m_headerWin->GetTextExtent(wxT("H"), &w, &h);
m_headerHeight = h + 2 * HEADER_OFFSET_Y + EXTRA_HEIGHT;
if ( m_headerWin )
{
// we use 'g' to get the descent, too
int w, h, d;
m_headerWin->GetTextExtent(wxT("Hg"), &w, &h, &d);
h += d + 2 * HEADER_OFFSET_Y + EXTRA_HEIGHT;
// only update if there is not enough space
if ( h > m_headerHeight )
{
m_headerHeight = h;
m_headerWin->SetSize(m_headerWin->GetSize().x, m_headerHeight);
if ( HasFlag(wxLC_REPORT) && !HasFlag(wxLC_NO_HEADER) )
ResizeReportView(TRUE);
}
}
}
void wxGenericListCtrl::CreateHeaderWindow()