]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/choice.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxChoice class interface
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWidgets team
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_CHOICE_H_BASE_
13 #define _WX_CHOICE_H_BASE_
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
20 #pragma interface "choicebase.h"
25 #include "wx/ctrlsub.h" // the base class
27 // ----------------------------------------------------------------------------
29 // ----------------------------------------------------------------------------
31 extern WXDLLEXPORT_DATA(const wxChar
*) wxChoiceNameStr
;
33 // ----------------------------------------------------------------------------
34 // wxChoice allows to select one of a non-modifiable list of strings
35 // ----------------------------------------------------------------------------
37 class WXDLLEXPORT wxChoiceBase
: public wxControlWithItems
41 virtual ~wxChoiceBase();
43 // all generic methods are in wxControlWithItems
45 // single selection logic
46 virtual void SetSelection(int n
) = 0;
47 virtual bool SetStringSelection(const wxString
& s
);
49 // don't override this
50 virtual void Select(int n
) { SetSelection(n
); }
52 // set/get the number of columns in the control (as they're not supported on
53 // most platforms, they do nothing by default)
54 virtual void SetColumns(int WXUNUSED(n
) = 1 ) { }
55 virtual int GetColumns() const { return 1 ; }
57 // emulate selecting the item event.GetInt()
58 void Command(wxCommandEvent
& event
);
61 DECLARE_NO_COPY_CLASS(wxChoiceBase
)
64 // ----------------------------------------------------------------------------
65 // include the platform-dependent class definition
66 // ----------------------------------------------------------------------------
68 #if defined(__WXUNIVERSAL__)
69 #include "wx/univ/choice.h"
70 #elif defined(__SMARTPHONE__) && defined(__WXWINCE__)
71 #include "wx/msw/wince/choicece.h"
72 #elif defined(__WXMSW__)
73 #include "wx/msw/choice.h"
74 #elif defined(__WXMOTIF__)
75 #include "wx/motif/choice.h"
76 #elif defined(__WXGTK__)
77 #include "wx/gtk/choice.h"
78 #elif defined(__WXMAC__)
79 #include "wx/mac/choice.h"
80 #elif defined(__WXCOCOA__)
81 #include "wx/cocoa/choice.h"
82 #elif defined(__WXPM__)
83 #include "wx/os2/choice.h"
86 #endif // wxUSE_CHOICE