]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/os2/choice.h | |
3 | // Purpose: wxChoice class | |
4 | // Author: David Webster | |
5 | // Modified by: | |
6 | // Created: 10/13/99 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) David Webster | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_CHOICE_H_ | |
13 | #define _WX_CHOICE_H_ | |
14 | ||
15 | // ---------------------------------------------------------------------------- | |
16 | // Choice item | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
19 | class WXDLLEXPORT wxChoice: public wxChoiceBase | |
20 | { | |
21 | DECLARE_DYNAMIC_CLASS(wxChoice) | |
22 | ||
23 | public: | |
24 | // ctors | |
25 | inline wxChoice() { } | |
26 | virtual ~wxChoice(); | |
27 | ||
28 | inline wxChoice( wxWindow* pParent | |
29 | ,wxWindowID vId | |
30 | ,const wxPoint& rPos = wxDefaultPosition | |
31 | ,const wxSize& rSize = wxDefaultSize | |
32 | ,int n = 0 | |
33 | ,const wxString asChoices[] = NULL | |
34 | ,long lStyle = 0 | |
35 | ,const wxValidator& rValidator = wxDefaultValidator | |
36 | ,const wxString& rsName = wxChoiceNameStr | |
37 | ) | |
38 | { | |
39 | Create( pParent | |
40 | ,vId | |
41 | ,rPos | |
42 | ,rSize | |
43 | ,n | |
44 | ,asChoices | |
45 | ,lStyle | |
46 | ,rValidator | |
47 | ,rsName | |
48 | ); | |
49 | } | |
50 | ||
51 | inline wxChoice( wxWindow* pParent | |
52 | ,wxWindowID vId | |
53 | ,const wxPoint& rPos | |
54 | ,const wxSize& rSize | |
55 | ,const wxArrayString& asChoices | |
56 | ,long lStyle = 0 | |
57 | ,const wxValidator& rValidator = wxDefaultValidator | |
58 | ,const wxString& rsName = wxChoiceNameStr | |
59 | ) | |
60 | { | |
61 | Create( pParent | |
62 | ,vId | |
63 | ,rPos | |
64 | ,rSize | |
65 | ,asChoices | |
66 | ,lStyle | |
67 | ,rValidator | |
68 | ,rsName | |
69 | ); | |
70 | } | |
71 | ||
72 | bool Create( wxWindow* pParent | |
73 | ,wxWindowID vId | |
74 | ,const wxPoint& rPos = wxDefaultPosition | |
75 | ,const wxSize& rSize = wxDefaultSize | |
76 | ,int n = 0 | |
77 | ,const wxString asChoices[] = NULL | |
78 | ,long lStyle = 0 | |
79 | ,const wxValidator& rValidator = wxDefaultValidator | |
80 | ,const wxString& rsName = wxChoiceNameStr | |
81 | ); | |
82 | ||
83 | bool Create( wxWindow* pParent | |
84 | ,wxWindowID vId | |
85 | ,const wxPoint& rPos | |
86 | ,const wxSize& rSize | |
87 | ,const wxArrayString& asChoices | |
88 | ,long lStyle = 0 | |
89 | ,const wxValidator& rValidator = wxDefaultValidator | |
90 | ,const wxString& rsName = wxChoiceNameStr | |
91 | ); | |
92 | ||
93 | // | |
94 | // Implement base class virtuals | |
95 | // | |
96 | virtual void Delete(unsigned int n); | |
97 | virtual void Clear(void); | |
98 | ||
99 | virtual unsigned int GetCount() const; | |
100 | virtual int GetSelection(void) const; | |
101 | virtual int GetCurrentSelection(void) const { return GetSelection(); } | |
102 | virtual void SetSelection(int n); | |
103 | ||
104 | virtual wxString GetString(unsigned int n) const; | |
105 | virtual void SetString(unsigned int n, const wxString& rsStr); | |
106 | ||
107 | // | |
108 | // OS2 only | |
109 | // | |
110 | virtual bool OS2Command( WXUINT uParam | |
111 | ,WXWORD wId | |
112 | ); | |
113 | MRESULT OS2WindowProc( WXUINT uMsg | |
114 | ,WXWPARAM wParam | |
115 | ,WXLPARAM lParam | |
116 | ); | |
117 | ||
118 | protected: | |
119 | virtual int DoAppend(const wxString& rsItem); | |
120 | virtual int DoInsert(const wxString& rsItem, unsigned int pos); | |
121 | virtual void DoSetItemClientData(unsigned int n, void* pClientData); | |
122 | virtual void* DoGetItemClientData(unsigned int n) const; | |
123 | virtual void DoSetItemClientObject(unsigned int n, wxClientData* pClientData); | |
124 | virtual wxClientData* DoGetItemClientObject(unsigned int n) const; | |
125 | virtual wxSize DoGetBestSize(void) const; | |
126 | virtual void DoSetSize( int nX | |
127 | ,int nY | |
128 | ,int nWidth | |
129 | ,int nHeight | |
130 | ,int nsizeFlags = wxSIZE_AUTO | |
131 | ); | |
132 | void Free(void); | |
133 | }; // end of CLASS wxChoice | |
134 | ||
135 | #endif // _WX_CHOICE_H_ |