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:
@@ -4549,11 +4549,24 @@ wxGenericListCtrl::~wxGenericListCtrl()
|
|||||||
|
|
||||||
void wxGenericListCtrl::CalculateAndSetHeaderHeight()
|
void wxGenericListCtrl::CalculateAndSetHeaderHeight()
|
||||||
{
|
{
|
||||||
// we use the letter "H" for calculating the needed space, basing on the current font
|
if ( m_headerWin )
|
||||||
int w, h;
|
{
|
||||||
m_headerWin->GetTextExtent(wxT("H"), &w, &h);
|
// we use 'g' to get the descent, too
|
||||||
m_headerHeight = h + 2 * HEADER_OFFSET_Y + EXTRA_HEIGHT;
|
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);
|
m_headerWin->SetSize(m_headerWin->GetSize().x, m_headerHeight);
|
||||||
|
|
||||||
|
if ( HasFlag(wxLC_REPORT) && !HasFlag(wxLC_NO_HEADER) )
|
||||||
|
ResizeReportView(TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericListCtrl::CreateHeaderWindow()
|
void wxGenericListCtrl::CreateHeaderWindow()
|
||||||
|
Reference in New Issue
Block a user