]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/choice.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxChoice class interface
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_CHOICE_H_BASE_
13 #define _WX_CHOICE_H_BASE_
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
20 #pragma interface "choicebase.h"
23 #include "wx/ctrlsub.h" // the base class
25 // ----------------------------------------------------------------------------
27 // ----------------------------------------------------------------------------
29 WXDLLEXPORT_DATA(extern const wxChar
*) wxChoiceNameStr
;
31 // ----------------------------------------------------------------------------
32 // wxChoice allows to select one of a non-modifiable list of strings
33 // ----------------------------------------------------------------------------
35 class WXDLLEXPORT wxChoiceBase
: public wxControlWithItems
38 // all generic methods are in wxControlWithItems
40 // single selection logic
41 virtual void SetSelection(int n
) = 0;
42 virtual bool SetStringSelection(const wxString
& s
);
44 // don't override this
45 virtual void Select(int n
) { SetSelection(n
); }
47 // set/get the number of columns in the control (as they're not supporte on
48 // most platforms, they do nothing by default)
49 virtual void SetColumns(int WXUNUSED(n
) = 1 ) { }
50 virtual int GetColumns() const { return 1 ; }
52 // emulate selecting the item event.GetInt()
53 void Command(wxCommandEvent
& event
);
57 // ----------------------------------------------------------------------------
58 // include the platform-dependent class definition
59 // ----------------------------------------------------------------------------
61 #if defined(__WXMSW__)
62 #include "wx/msw/choice.h"
63 #elif defined(__WXMOTIF__)
64 #include "wx/motif/choice.h"
65 #elif defined(__WXGTK__)
66 #include "wx/gtk/choice.h"
67 #elif defined(__WXQT__)
68 #include "wx/qt/choice.h"
69 #elif defined(__WXMAC__)
70 #include "wx/mac/choice.h"
71 #elif defined(__WXPM__)
72 #include "wx/os2/choice.h"
73 #elif defined(__WXSTUBS__)
74 #include "wx/stubs/choice.h"