From 858ad6708dcaffe710583efb6de37cd2628f72fa Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Sun, 5 Oct 2008 13:56:40 +0000 Subject: [PATCH] Need to call wxVScrolledWindow::UpdateScrollbar() in wxVListBox EVT_SIZE handler. Otherwise resizing wxVListBox does not update visible items count. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56090 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/vlbox.h | 1 + src/generic/vlbox.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/wx/vlbox.h b/include/wx/vlbox.h index 6887686b03..f4b2e945bf 100644 --- a/include/wx/vlbox.h +++ b/include/wx/vlbox.h @@ -243,6 +243,7 @@ protected: void OnLeftDown(wxMouseEvent& event); void OnLeftDClick(wxMouseEvent& event); void OnSetOrKillFocus(wxFocusEvent& event); + void OnSize(wxSizeEvent& event); // common part of all ctors void Init(); diff --git a/src/generic/vlbox.cpp b/src/generic/vlbox.cpp index df4a9bbfb0..04ad587675 100644 --- a/src/generic/vlbox.cpp +++ b/src/generic/vlbox.cpp @@ -51,6 +51,8 @@ BEGIN_EVENT_TABLE(wxVListBox, wxVScrolledWindow) EVT_SET_FOCUS(wxVListBox::OnSetOrKillFocus) EVT_KILL_FOCUS(wxVListBox::OnSetOrKillFocus) + + EVT_SIZE(wxVListBox::OnSize) END_EVENT_TABLE() // ============================================================================ @@ -494,6 +496,11 @@ void wxVListBox::OnSetOrKillFocus(wxFocusEvent& WXUNUSED(event)) RefreshSelected(); } +void wxVListBox::OnSize(wxSizeEvent& event) +{ + UpdateScrollbar(); + event.Skip(); +} // ============================================================================ // wxVListBox keyboard/mouse handling