1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/ctrlsub.h
3 // Purpose: common functionality of wxItemContainer-derived controls
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_MSW_CTRLSUB_H_
11 #define _WX_MSW_CTRLSUB_H_
13 // ----------------------------------------------------------------------------
15 // ----------------------------------------------------------------------------
17 class WXDLLIMPEXP_CORE wxControlWithItems
: public wxControlWithItemsBase
20 wxControlWithItems() { }
23 // preallocate memory for inserting the given new items into the control
24 // using the wm message (normally either LB_INITSTORAGE or CB_INITSTORAGE)
25 void MSWAllocStorage(const wxArrayStringsAdapter
& items
, unsigned wm
);
27 // insert or append a string to the controls using the given message
28 // (one of {CB,LB}_{ADD,INSERT}STRING, pos must be 0 when appending)
29 int MSWInsertOrAppendItem(unsigned pos
, const wxString
& item
, unsigned wm
);
31 // normally the control containing the items is this window itself but if
32 // the derived control is composed of several windows, this method can be
33 // overridden to return the real list/combobox control
34 virtual WXHWND
MSWGetItemsHWND() const { return GetHWND(); }
37 DECLARE_ABSTRACT_CLASS(wxControlWithItems
)
38 wxDECLARE_NO_COPY_CLASS(wxControlWithItems
);
41 #endif // _WX_MSW_CTRLSUB_H_