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