IMPLEMENT_DYNAMIC_CLASS_XTI(wxListBox, wxControl,"wx/listbox.h")
wxBEGIN_PROPERTIES_TABLE(wxListBox)
- wxEVENT_PROPERTY( Select , wxEVT_COMMAND_LISTBOX_SELECTED , wxCommandEvent )
- wxEVENT_PROPERTY( DoubleClick , wxEVT_COMMAND_LISTBOX_DOUBLECLICKED , wxCommandEvent )
+ wxEVENT_PROPERTY( Select , wxEVT_COMMAND_LISTBOX_SELECTED , wxCommandEvent )
+ wxEVENT_PROPERTY( DoubleClick , wxEVT_COMMAND_LISTBOX_DOUBLECLICKED , wxCommandEvent )
wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
- wxPROPERTY( Selection ,int, SetSelection, GetSelection, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
+ wxPROPERTY( Selection ,int, SetSelection, GetSelection, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
wxPROPERTY_FLAGS( WindowStyle , wxListBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
wxEND_PROPERTIES_TABLE()
/*
TODO PROPERTIES
- selection
- content
- item
+ selection
+ content
+ item
*/
// ============================================================================
int wxListBox::DoAppend(const wxString& item)
{
+ InvalidateBestSize();
+
int index = ListBox_AddString(GetHwnd(), item);
m_noItems++;
wxCHECK_RET( pos >= 0 && pos <= m_noItems,
wxT("invalid index in wxListBox::InsertItems") );
+ InvalidateBestSize();
+
int nItems = items.GetCount();
for ( int i = 0; i < nItems; i++ )
{
ListBox_SetItemData(GetHwnd(), idx, pNewItem);
}
+#else
+ wxUnusedVar(idx);
#endif // wxUSE_OWNER_DRAWN
}
// the listbox should be slightly larger than the widest string
int cx, cy;
- wxGetCharSize(GetHWND(), &cx, &cy, &GetFont());
+ wxGetCharSize(GetHWND(), &cx, &cy, GetFont());
wListbox += 3*cx;
wxDC dc;
dc.SetHDC((WXHDC)hdc);
- dc.SetFont(wxSystemSettings::GetFont(wxSYS_ANSI_VAR_FONT));
+ dc.SetFont(GetFont());
pStruct->itemHeight = dc.GetCharHeight() + 2*OWNER_DRAWN_LISTBOX_EXTRA_SPACE;
pStruct->itemWidth = dc.GetCharWidth();