]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/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 #if !USE_SHARED_LIBRARY
20 IMPLEMENT_DYNAMIC_CLASS(wxChoice
, wxControl
)
23 bool wxChoice::Create(wxWindow
*parent
, wxWindowID id
,
26 int n
, const wxString choices
[],
28 const wxValidator
& validator
,
32 SetValidator(validator
);
34 m_windowStyle
= style
;
36 if (parent
) parent
->AddChild(this);
39 m_windowId
= (int)NewControlId();
43 // TODO: create choice control
47 void wxChoice::Append(const wxString
& item
)
53 void wxChoice::Delete(int n
)
59 void wxChoice::Clear()
65 int wxChoice::GetSelection() const
71 void wxChoice::SetSelection(int n
)
76 int wxChoice::FindString(const wxString
& s
) const
82 wxString
wxChoice::GetString(int n
) const
88 void wxChoice::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
93 wxString
wxChoice::GetStringSelection () const
95 int sel
= GetSelection ();
97 return wxString(this->GetString (sel
));
102 bool wxChoice::SetStringSelection (const wxString
& s
)
104 int sel
= FindString (s
);
114 void wxChoice::Command(wxCommandEvent
& event
)
116 SetSelection (event
.GetInt());
117 ProcessCommand (event
);