X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e062c6a4d0464d7780cd753ea86020a68eca9062..3e822cd8d0bdf04cd2c7a3dddff61dcc211f7439:/src/generic/listctrl.cpp?ds=sidebyside diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index bc9bb84c92..c7821beb30 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -520,8 +520,6 @@ public: virtual ~wxListMainWindow(); - wxWindow *GetMainWindowOfCompositeControl() { return GetParent(); } - bool HasFlag(int flag) const { return m_parent->HasFlag(flag); } // return true if this is a virtual list control @@ -780,6 +778,8 @@ public: wxListTextCtrl* m_textctrl; protected: + wxWindow *GetMainWindowOfCompositeControl() { return GetParent(); } + // the total count of items in a virtual list control size_t m_countVirt; @@ -1683,8 +1683,6 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) PrepareDC( dc ); AdjustDC( dc ); - dc.BeginDrawing(); - dc.SetFont( GetFont() ); // width and height of the entire header window @@ -1794,8 +1792,6 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) x += wCol; } - - dc.EndDrawing(); } void wxListHeaderWindow::DrawCurrent() @@ -2568,7 +2564,7 @@ void wxListMainWindow::Thaw() { wxCHECK_RET( m_freezeCount > 0, _T("thawing unfrozen list control?") ); - if ( !--m_freezeCount ) + if ( --m_freezeCount == 0 ) Refresh(); } @@ -2591,8 +2587,6 @@ void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) int dev_x, dev_y; CalcScrolledPosition( 0, 0, &dev_x, &dev_y ); - dc.BeginDrawing(); - dc.SetFont( GetFont() ); if ( InReportView() ) @@ -2700,8 +2694,6 @@ void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) } } #endif - - dc.EndDrawing(); } void wxListMainWindow::HighlightAll( bool on ) @@ -4681,10 +4673,10 @@ void wxGenericListCtrl::CalculateAndSetHeaderHeight() { m_headerHeight = h; - m_headerWin->SetSize(m_headerWin->GetSize().x, m_headerHeight); - if ( HasHeader() ) ResizeReportView(true); + else //why is this needed if it doesn't have a header? + m_headerWin->SetSize(m_headerWin->GetSize().x, m_headerHeight); } } } @@ -5299,7 +5291,12 @@ void wxGenericListCtrl::ResizeReportView(bool showHeader) if ( showHeader ) { m_headerWin->SetSize( 0, 0, cw, m_headerHeight ); - m_mainWin->SetSize( 0, m_headerHeight + 1, cw, ch - m_headerHeight - 1 ); + if(ch > m_headerHeight) + m_mainWin->SetSize( 0, m_headerHeight + 1, + cw, ch - m_headerHeight - 1 ); + else + m_mainWin->SetSize( 0, m_headerHeight + 1, + cw, 0); } else // no header window {