1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/choice.cpp
4 // Author: William Osborne - minimal working wxPalmOS port
7 // Copyright: (c) William Osborne
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // For compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
28 #include "wx/choice.h"
34 #include "wx/settings.h"
37 #if wxUSE_EXTENDED_RTTI
38 WX_DEFINE_FLAGS( wxChoiceStyle
)
40 wxBEGIN_FLAGS( wxChoiceStyle
)
41 // new style border flags, we put them first to
42 // use them for streaming out
43 wxFLAGS_MEMBER(wxBORDER_SIMPLE
)
44 wxFLAGS_MEMBER(wxBORDER_SUNKEN
)
45 wxFLAGS_MEMBER(wxBORDER_DOUBLE
)
46 wxFLAGS_MEMBER(wxBORDER_RAISED
)
47 wxFLAGS_MEMBER(wxBORDER_STATIC
)
48 wxFLAGS_MEMBER(wxBORDER_NONE
)
50 // old style border flags
51 wxFLAGS_MEMBER(wxSIMPLE_BORDER
)
52 wxFLAGS_MEMBER(wxSUNKEN_BORDER
)
53 wxFLAGS_MEMBER(wxDOUBLE_BORDER
)
54 wxFLAGS_MEMBER(wxRAISED_BORDER
)
55 wxFLAGS_MEMBER(wxSTATIC_BORDER
)
56 wxFLAGS_MEMBER(wxBORDER
)
58 // standard window styles
59 wxFLAGS_MEMBER(wxTAB_TRAVERSAL
)
60 wxFLAGS_MEMBER(wxCLIP_CHILDREN
)
61 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW
)
62 wxFLAGS_MEMBER(wxWANTS_CHARS
)
63 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE
)
64 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB
)
65 wxFLAGS_MEMBER(wxVSCROLL
)
66 wxFLAGS_MEMBER(wxHSCROLL
)
68 wxEND_FLAGS( wxChoiceStyle
)
70 IMPLEMENT_DYNAMIC_CLASS_XTI(wxChoice
, wxControl
,"wx/choice.h")
72 wxBEGIN_PROPERTIES_TABLE(wxChoice
)
73 wxEVENT_PROPERTY( Select
, wxEVT_COMMAND_CHOICE_SELECTED
, wxCommandEvent
)
75 wxPROPERTY( Font
, wxFont
, SetFont
, GetFont
, EMPTY_MACROVALUE
, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
76 wxPROPERTY_COLLECTION( Choices
, wxArrayString
, wxString
, AppendString
, GetStrings
, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
77 wxPROPERTY( Selection
,int, SetSelection
, GetSelection
, EMPTY_MACROVALUE
, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
78 wxPROPERTY_FLAGS( WindowStyle
, wxChoiceStyle
, long , SetWindowStyleFlag
, GetWindowStyleFlag
, EMPTY_MACROVALUE
, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
79 wxEND_PROPERTIES_TABLE()
81 wxBEGIN_HANDLERS_TABLE(wxChoice
)
82 wxEND_HANDLERS_TABLE()
84 wxCONSTRUCTOR_4( wxChoice
, wxWindow
* , Parent
, wxWindowID
, Id
, wxPoint
, Position
, wxSize
, Size
)
86 IMPLEMENT_DYNAMIC_CLASS(wxChoice
, wxControlWithItems
)
89 // ============================================================================
91 // ============================================================================
93 // ----------------------------------------------------------------------------
95 // ----------------------------------------------------------------------------
97 bool wxChoice::Create(wxWindow
*parent
,
101 int n
, const wxString choices
[],
103 const wxValidator
& validator
,
104 const wxString
& name
)
109 bool wxChoice::CreateAndInit(wxWindow
*parent
,
113 int n
, const wxString choices
[],
115 const wxValidator
& validator
,
116 const wxString
& name
)
121 bool wxChoice::Create(wxWindow
*parent
,
125 const wxArrayString
& choices
,
127 const wxValidator
& validator
,
128 const wxString
& name
)
133 wxChoice::~wxChoice()
137 // ----------------------------------------------------------------------------
138 // adding/deleting items to/from the list
139 // ----------------------------------------------------------------------------
141 int wxChoice::DoInsertItems(const wxArrayStringsAdapter
& items
,
144 wxClientDataType type
)
149 void wxChoice::DoDeleteOneItem(unsigned int n
)
153 void wxChoice::DoClear()
157 void wxChoice::Free()
161 // ----------------------------------------------------------------------------
163 // ----------------------------------------------------------------------------
165 int wxChoice::GetSelection() const
170 void wxChoice::SetSelection(int n
)
174 // ----------------------------------------------------------------------------
175 // string list functions
176 // ----------------------------------------------------------------------------
178 unsigned int wxChoice::GetCount() const
183 void wxChoice::SetString(unsigned int n
, const wxString
& s
)
187 wxString
wxChoice::GetString(unsigned int n
) const
189 return wxEmptyString
;
192 // ----------------------------------------------------------------------------
194 // ----------------------------------------------------------------------------
196 void wxChoice::DoSetItemClientData(unsigned int n
, void* clientData
)
200 void* wxChoice::DoGetItemClientData(unsigned int n
) const
205 // ----------------------------------------------------------------------------
206 // wxMSW specific helpers
207 // ----------------------------------------------------------------------------
209 void wxChoice::UpdateVisibleHeight()
213 void wxChoice::DoMoveWindow(int x
, int y
, int width
, int height
)
217 void wxChoice::DoGetSize(int *w
, int *h
) const
221 void wxChoice::DoSetSize(int x
, int y
,
222 int width
, int height
,
227 wxSize
wxChoice::DoGetBestSize() const
232 #endif // wxUSE_CHOICE