X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ebf82d2b4b8790a3f216f94acd56cbed07e8915a..05e0b047d879cdbfade7f2ab346c0acdf3e29f96:/src/generic/listctrl.cpp?ds=sidebyside diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 4486e729b2..ec924ef4c1 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -615,6 +615,8 @@ public: void OnPaint( wxPaintEvent &event ); + void OnChildFocus(wxChildFocusEvent& event); + void DrawImage( int index, wxDC *dc, int x, int y ); void GetImageSize( int index, int &width, int &height ) const; int GetTextLength( const wxString &s ) const; @@ -1895,6 +1897,19 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) x += wCol; } + + // Fill in what's missing to the right of the columns, otherwise we will + // leave an unpainted area when columns are removed (and it looks better) + if ( x < w ) + { + wxRendererNative::Get().DrawHeaderButton + ( + this, + dc, + wxRect(x, HEADER_OFFSET_Y, w - x, h), + 0 + ); + } } void wxListHeaderWindow::DrawCurrent() @@ -2246,6 +2261,7 @@ BEGIN_EVENT_TABLE(wxListMainWindow,wxScrolledCanvas) EVT_SET_FOCUS (wxListMainWindow::OnSetFocus) EVT_KILL_FOCUS (wxListMainWindow::OnKillFocus) EVT_SCROLLWIN (wxListMainWindow::OnScroll) + EVT_CHILD_FOCUS (wxListMainWindow::OnChildFocus) END_EVENT_TABLE() void wxListMainWindow::Init() @@ -2857,6 +2873,13 @@ void wxListMainWindow::HighlightAll( bool on ) } } +void wxListMainWindow::OnChildFocus(wxChildFocusEvent& WXUNUSED(event)) +{ + // Do nothing here. This prevents the default handler in wxScrolledWindow + // from needlessly scrolling the window when the edit control is + // dismissed. See ticket #9563. +} + void wxListMainWindow::SendNotify( size_t line, wxEventType command, const wxPoint& point )