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
This commit is contained in:
Jaakko Salli
2008-10-05 13:56:40 +00:00
parent e725ba4fc2
commit 858ad6708d
2 changed files with 8 additions and 0 deletions

View File

@@ -243,6 +243,7 @@ protected:
void OnLeftDown(wxMouseEvent& event); void OnLeftDown(wxMouseEvent& event);
void OnLeftDClick(wxMouseEvent& event); void OnLeftDClick(wxMouseEvent& event);
void OnSetOrKillFocus(wxFocusEvent& event); void OnSetOrKillFocus(wxFocusEvent& event);
void OnSize(wxSizeEvent& event);
// common part of all ctors // common part of all ctors
void Init(); void Init();

View File

@@ -51,6 +51,8 @@ BEGIN_EVENT_TABLE(wxVListBox, wxVScrolledWindow)
EVT_SET_FOCUS(wxVListBox::OnSetOrKillFocus) EVT_SET_FOCUS(wxVListBox::OnSetOrKillFocus)
EVT_KILL_FOCUS(wxVListBox::OnSetOrKillFocus) EVT_KILL_FOCUS(wxVListBox::OnSetOrKillFocus)
EVT_SIZE(wxVListBox::OnSize)
END_EVENT_TABLE() END_EVENT_TABLE()
// ============================================================================ // ============================================================================
@@ -494,6 +496,11 @@ void wxVListBox::OnSetOrKillFocus(wxFocusEvent& WXUNUSED(event))
RefreshSelected(); RefreshSelected();
} }
void wxVListBox::OnSize(wxSizeEvent& event)
{
UpdateScrollbar();
event.Skip();
}
// ============================================================================ // ============================================================================
// wxVListBox keyboard/mouse handling // wxVListBox keyboard/mouse handling