]>
git.saurik.com Git - wxWidgets.git/blob - src/qt/choice.cpp
1 /////////////////////////////////////////////////////////////////////////////
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "choice.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/choice.h"
19 IMPLEMENT_DYNAMIC_CLASS(wxChoice
, wxControl
)
21 bool wxChoice::Create(wxWindow
*parent
, wxWindowID id
,
24 int n
, const wxString choices
[],
26 const wxValidator
& validator
,
30 SetValidator(validator
);
32 m_windowStyle
= style
;
34 if (parent
) parent
->AddChild(this);
37 m_windowId
= (int)NewControlId();
41 // TODO: create choice control
45 void wxChoice::Append(const wxString
& item
)
51 void wxChoice::Delete(int n
)
57 void wxChoice::Clear()
63 int wxChoice::GetSelection() const
69 void wxChoice::SetSelection(int n
)
74 int wxChoice::FindString(const wxString
& s
) const
80 wxString
wxChoice::GetString(int n
) const
86 void wxChoice::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
91 wxString
wxChoice::GetStringSelection () const
93 int sel
= GetSelection ();
95 return wxString(this->GetString (sel
));
100 bool wxChoice::SetStringSelection (const wxString
& s
)
102 int sel
= FindString (s
);
112 void wxChoice::Command(wxCommandEvent
& event
)
114 SetSelection (event
.GetInt());
115 ProcessCommand (event
);