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