1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxChoice class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "choice.h"
19 #include "wx/control.h"
21 WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr
;
24 class WXDLLEXPORT wxChoice
: public wxControl
26 DECLARE_DYNAMIC_CLASS(wxChoice
)
32 inline wxChoice(wxWindow
*parent
, wxWindowID id
,
33 const wxPoint
& pos
= wxDefaultPosition
,
34 const wxSize
& size
= wxDefaultSize
,
35 int n
= 0, const wxString choices
[] = NULL
,
37 const wxValidator
& validator
= wxDefaultValidator
,
38 const wxString
& name
= wxChoiceNameStr
)
40 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
43 bool Create(wxWindow
*parent
, wxWindowID id
,
44 const wxPoint
& pos
= wxDefaultPosition
,
45 const wxSize
& size
= wxDefaultSize
,
46 int n
= 0, const wxString choices
[] = NULL
,
48 const wxValidator
& validator
= wxDefaultValidator
,
49 const wxString
& name
= wxChoiceNameStr
);
51 virtual void Append(const wxString
& item
);
52 virtual void Delete(int n
);
54 virtual int GetSelection() const ;
55 virtual void SetSelection(int n
);
56 virtual int FindString(const wxString
& s
) const;
57 virtual wxString
GetString(int n
) const ;
59 virtual void SetSize(int x
, int y
, int width
, int height
, int sizeFlags
= wxSIZE_AUTO
);
60 virtual void SetSize(const wxRect
& rect
, int sizeFlags
= wxSIZE_AUTO
)
61 { wxWindow::SetSize(rect
, sizeFlags
); }
62 virtual void SetSize(const wxSize
& size
) { wxWindow::SetSize(size
); }
63 virtual void SetSize(int width
, int height
) { SetSize(-1, -1, width
, height
, wxSIZE_USE_EXISTING
); }
65 virtual wxString
GetStringSelection() const ;
66 virtual bool SetStringSelection(const wxString
& sel
);
68 virtual inline int Number() const { return m_noStrings
; }
69 virtual void Command(wxCommandEvent
& event
);
71 virtual void SetColumns(int n
= 1 );
72 virtual int GetColumns() const ;
77 virtual void ChangeFont(bool keepOriginalSize
= TRUE
);
78 virtual void ChangeBackgroundColour();
79 virtual void ChangeForegroundColour();
80 WXWidget
GetTopWidget() const { return m_formWidget
; }
81 WXWidget
GetMainWidget() const { return m_buttonWidget
; }
85 WXWidget m_menuWidget
;
86 WXWidget m_buttonWidget
;
87 WXWidget
* m_widgetList
;
88 WXWidget m_formWidget
;
89 wxStringList m_stringList
;