wxListBox::wxListBox()
{
m_noItems = 0;
- m_selected = 0;
+ m_updateHorizontalExtent = false;
}
bool wxListBox::Create(wxWindow *parent,
const wxString& name)
{
m_noItems = 0;
- m_selected = 0;
+ m_updateHorizontalExtent = false;
// initialize base class fields
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return msStyle;
}
+void wxListBox::OnInternalIdle()
+{
+ wxWindow::OnInternalIdle();
+
+ if (m_updateHorizontalExtent)
+ {
+ SetHorizontalExtent(wxEmptyString);
+ m_updateHorizontalExtent = false;
+ }
+}
+
// ----------------------------------------------------------------------------
// implementation of wxListBoxBase methods
// ----------------------------------------------------------------------------
SendMessage(GetHwnd(), LB_DELETESTRING, n, 0);
m_noItems--;
- SetHorizontalExtent(wxEmptyString);
+ // SetHorizontalExtent(wxEmptyString); can be slow
+ m_updateHorizontalExtent = true;
UpdateOldSelections();
}
ListBox_ResetContent(GetHwnd());
m_noItems = 0;
- SetHorizontalExtent();
+ m_updateHorizontalExtent = true;
UpdateOldSelections();
}
AssignNewItemClientData(n, clientData, i, type);
}
- SetHorizontalExtent();
+ m_updateHorizontalExtent = true;
UpdateOldSelections();
if ( wasSelected )
Select(n);
- SetHorizontalExtent();
+ m_updateHorizontalExtent = true;
}
unsigned int wxListBox::GetCount() const