]>
git.saurik.com Git - wxWidgets.git/blob - src/univ/choice.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/univ/choice.cpp
3 // Purpose: wxChoice implementation
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 #include "wx/wxprec.h"
27 #include "wx/choice.h"
30 #include "wx/arrstr.h"
33 BEGIN_EVENT_TABLE(wxChoice
, wxComboBox
)
34 EVT_COMBOBOX(wxID_ANY
, wxChoice::OnComboBox
)
37 wxChoice::wxChoice(wxWindow
*parent
, wxWindowID id
,
40 const wxArrayString
& choices
,
42 const wxValidator
& validator
,
45 Create(parent
, id
, pos
, size
, choices
, style
, validator
, name
);
48 bool wxChoice::Create(wxWindow
*parent
, wxWindowID id
,
51 const wxArrayString
& choices
,
53 const wxValidator
& validator
,
56 wxCArrayString
chs(choices
);
58 return Create(parent
, id
, pos
, size
, chs
.GetCount(), chs
.GetStrings(),
59 style
, validator
, name
);
62 bool wxChoice::Create(wxWindow
*parent
, wxWindowID id
,
65 int n
, const wxString choices
[],
67 const wxValidator
& validator
,
73 return wxComboBox::Create(parent
, id
, value
,
74 pos
, size
, n
, choices
,
75 wxCB_READONLY
, validator
, name
);
79 void wxChoice::OnComboBox(wxCommandEvent
& event
)
81 if ( event
.GetId() == GetId() )
83 event
.SetEventType(wxEVT_CHOICE
);
85 GetEventHandler()->ProcessEvent(event
);
91 #endif // wxUSE_CHOICE