git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53743
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
virtual void* DoGetItemClientData(unsigned int n) const;
virtual int DoListHitTest(const wxPoint& point) const;
virtual void* DoGetItemClientData(unsigned int n) const;
virtual int DoListHitTest(const wxPoint& point) const;
+ bool m_updateHorizontalExtent;
+ virtual void OnInternalIdle();
+
// free memory (common part of Clear() and dtor)
void Free();
unsigned int m_noItems;
// free memory (common part of Clear() and dtor)
void Free();
unsigned int m_noItems;
virtual wxSize DoGetBestSize() const;
virtual wxSize DoGetBestSize() const;
wxListBox::wxListBox()
{
m_noItems = 0;
wxListBox::wxListBox()
{
m_noItems = 0;
+ m_updateHorizontalExtent = false;
}
bool wxListBox::Create(wxWindow *parent,
}
bool wxListBox::Create(wxWindow *parent,
const wxString& name)
{
m_noItems = 0;
const wxString& name)
{
m_noItems = 0;
+ m_updateHorizontalExtent = false;
// initialize base class fields
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
// initialize base class fields
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
+void wxListBox::OnInternalIdle()
+{
+ wxWindow::OnInternalIdle();
+
+ if (m_updateHorizontalExtent)
+ {
+ SetHorizontalExtent(wxEmptyString);
+ m_updateHorizontalExtent = false;
+ }
+}
+
// ----------------------------------------------------------------------------
// implementation of wxListBoxBase methods
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// implementation of wxListBoxBase methods
// ----------------------------------------------------------------------------
SendMessage(GetHwnd(), LB_DELETESTRING, n, 0);
m_noItems--;
SendMessage(GetHwnd(), LB_DELETESTRING, n, 0);
m_noItems--;
- SetHorizontalExtent(wxEmptyString);
+ // SetHorizontalExtent(wxEmptyString); can be slow
+ m_updateHorizontalExtent = true;
ListBox_ResetContent(GetHwnd());
m_noItems = 0;
ListBox_ResetContent(GetHwnd());
m_noItems = 0;
+ m_updateHorizontalExtent = true;
AssignNewItemClientData(n, clientData, i, type);
}
AssignNewItemClientData(n, clientData, i, type);
}
+ m_updateHorizontalExtent = true;
if ( wasSelected )
Select(n);
if ( wasSelected )
Select(n);
+ m_updateHorizontalExtent = true;
}
unsigned int wxListBox::GetCount() const
}
unsigned int wxListBox::GetCount() const