]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/choice.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/choice.h
3 // Purpose: wxChoice class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 class WXDLLEXPORT wxChoice
: public wxChoiceBase
21 DECLARE_DYNAMIC_CLASS(wxChoice
)
25 inline wxChoice() { Init(); }
28 inline wxChoice( wxWindow
* pParent
30 ,const wxPoint
& rPos
= wxDefaultPosition
31 ,const wxSize
& rSize
= wxDefaultSize
33 ,const wxString asChoices
[] = NULL
35 ,const wxValidator
& rValidator
= wxDefaultValidator
36 ,const wxString
& rsName
= wxChoiceNameStr
52 inline wxChoice( wxWindow
* pParent
56 ,const wxArrayString
& asChoices
58 ,const wxValidator
& rValidator
= wxDefaultValidator
59 ,const wxString
& rsName
= wxChoiceNameStr
74 bool Create( wxWindow
* pParent
76 ,const wxPoint
& rPos
= wxDefaultPosition
77 ,const wxSize
& rSize
= wxDefaultSize
79 ,const wxString asChoices
[] = NULL
81 ,const wxValidator
& rValidator
= wxDefaultValidator
82 ,const wxString
& rsName
= wxChoiceNameStr
85 bool Create( wxWindow
* pParent
89 ,const wxArrayString
& asChoices
91 ,const wxValidator
& rValidator
= wxDefaultValidator
92 ,const wxString
& rsName
= wxChoiceNameStr
96 // Implement base class virtuals
98 virtual void Delete(unsigned int n
);
99 virtual void Clear(void);
101 virtual unsigned int GetCount() const;
102 virtual int GetSelection(void) const;
103 virtual int GetCurrentSelection(void) const;
104 virtual void SetSelection(int n
);
106 virtual wxString
GetString(unsigned int n
) const;
107 virtual void SetString(unsigned int n
, const wxString
& rsStr
);
112 virtual bool OS2Command( WXUINT uParam
115 MRESULT
OS2WindowProc( WXUINT uMsg
121 // common part of all ctors
122 void Init() { m_lastAcceptedSelection
= wxID_NONE
; }
124 virtual int DoAppend(const wxString
& rsItem
);
125 virtual int DoInsert(const wxString
& rsItem
, unsigned int pos
);
126 virtual void DoSetItemClientData(unsigned int n
, void* pClientData
);
127 virtual void* DoGetItemClientData(unsigned int n
) const;
128 virtual void DoSetItemClientObject(unsigned int n
, wxClientData
* pClientData
);
129 virtual wxClientData
* DoGetItemClientObject(unsigned int n
) const;
130 virtual wxSize
DoGetBestSize(void) const;
131 virtual void DoSetSize( int nX
135 ,int nsizeFlags
= wxSIZE_AUTO
139 // last "completed" selection, i.e. not the transient one while the user is
140 // browsing the popup list: this is only used when != wxID_NONE which is
141 // the case while the drop down is opened
142 int m_lastAcceptedSelection
;
143 }; // end of CLASS wxChoice
145 #endif // _WX_CHOICE_H_