1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/choiccmn.cpp
3 // Purpose: common (to all ports) wxChoice functions
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWidgets team
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
29 #include "wx/choice.h"
34 const char wxChoiceNameStr
[] = "choice";
37 wxDEFINE_FLAGS( wxChoiceStyle
)
38 wxBEGIN_FLAGS( wxChoiceStyle
)
39 // new style border flags, we put them first to
40 // use them for streaming out
41 wxFLAGS_MEMBER(wxBORDER_SIMPLE
)
42 wxFLAGS_MEMBER(wxBORDER_SUNKEN
)
43 wxFLAGS_MEMBER(wxBORDER_DOUBLE
)
44 wxFLAGS_MEMBER(wxBORDER_RAISED
)
45 wxFLAGS_MEMBER(wxBORDER_STATIC
)
46 wxFLAGS_MEMBER(wxBORDER_NONE
)
48 // old style border flags
49 wxFLAGS_MEMBER(wxSIMPLE_BORDER
)
50 wxFLAGS_MEMBER(wxSUNKEN_BORDER
)
51 wxFLAGS_MEMBER(wxDOUBLE_BORDER
)
52 wxFLAGS_MEMBER(wxRAISED_BORDER
)
53 wxFLAGS_MEMBER(wxSTATIC_BORDER
)
54 wxFLAGS_MEMBER(wxBORDER
)
56 // standard window styles
57 wxFLAGS_MEMBER(wxTAB_TRAVERSAL
)
58 wxFLAGS_MEMBER(wxCLIP_CHILDREN
)
59 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW
)
60 wxFLAGS_MEMBER(wxWANTS_CHARS
)
61 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE
)
62 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB
)
63 wxFLAGS_MEMBER(wxVSCROLL
)
64 wxFLAGS_MEMBER(wxHSCROLL
)
66 wxEND_FLAGS( wxChoiceStyle
)
68 wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxChoice
, wxControl
, "wx/choice.h")
70 wxBEGIN_PROPERTIES_TABLE(wxChoice
)
71 wxEVENT_PROPERTY( Select
, wxEVT_COMMAND_CHOICE_SELECTED
, wxCommandEvent
)
73 wxPROPERTY( Font
, wxFont
, SetFont
, GetFont
, wxEMPTY_PARAMETER_VALUE
, \
74 0 /*flags*/, wxT("Helpstring"), wxT("group"))
75 wxPROPERTY_COLLECTION( Choices
, wxArrayString
, wxString
, AppendString
, \
76 GetStrings
, 0 /*flags*/, wxT("Helpstring"), wxT("group"))
77 wxPROPERTY( Selection
,int, SetSelection
, GetSelection
, wxEMPTY_PARAMETER_VALUE
, \
78 0 /*flags*/, wxT("Helpstring"), wxT("group"))
87 wxPROPERTY_FLAGS( WindowStyle
, wxChoiceStyle
, long, SetWindowStyleFlag
, \
88 GetWindowStyleFlag
, wxEMPTY_PARAMETER_VALUE
, 0 /*flags*/, \
89 wxT("Helpstring"), wxT("group")) // style
90 wxEND_PROPERTIES_TABLE()
92 wxEMPTY_HANDLERS_TABLE(wxChoice
)
94 wxCONSTRUCTOR_4( wxChoice
, wxWindow
*, Parent
, wxWindowID
, Id
, \
95 wxPoint
, Position
, wxSize
, Size
)
97 // ============================================================================
99 // ============================================================================
101 wxChoiceBase::~wxChoiceBase()
103 // this destructor is required for Darwin
106 // ----------------------------------------------------------------------------
108 // ----------------------------------------------------------------------------
110 void wxChoiceBase::Command(wxCommandEvent
& event
)
112 SetSelection(event
.GetInt());
113 (void)GetEventHandler()->ProcessEvent(event
);
116 #endif // wxUSE_CHOICE