]>
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 | |
dcd307ee DW |
26 | inline wxChoice(wxWindow *parent, wxWindowID id, |
27 | const wxPoint& pos = wxDefaultPosition, | |
28 | const wxSize& size = wxDefaultSize, | |
29 | int n = 0, const wxString choices[] = NULL, | |
30 | long style = 0, | |
57c4d796 | 31 | #if wxUSE_VALIDATORS |
dcd307ee | 32 | const wxValidator& validator = wxDefaultValidator, |
57c4d796 | 33 | #endif |
dcd307ee DW |
34 | const wxString& name = wxChoiceNameStr) |
35 | { | |
36 | Create(parent, id, pos, size, n, choices, style, validator, name); | |
37 | } | |
0e320a79 | 38 | |
dcd307ee DW |
39 | bool Create(wxWindow *parent, wxWindowID id, |
40 | const wxPoint& pos = wxDefaultPosition, | |
41 | const wxSize& size = wxDefaultSize, | |
42 | int n = 0, const wxString choices[] = NULL, | |
43 | long style = 0, | |
57c4d796 | 44 | #if wxUSE_VALIDATORS |
dcd307ee | 45 | const wxValidator& validator = wxDefaultValidator, |
57c4d796 | 46 | #endif |
dcd307ee | 47 | const wxString& name = wxChoiceNameStr); |
0e320a79 | 48 | |
dcd307ee DW |
49 | // Implement base class virtuals |
50 | virtual int DoAppend(const wxString& item); | |
51 | virtual void Delete(int n); | |
52 | virtual void Clear(); | |
37f214d5 | 53 | |
dcd307ee DW |
54 | virtual int GetCount() const; |
55 | virtual int GetSelection() const ; | |
56 | virtual void SetSelection(int n); | |
37f214d5 | 57 | |
dcd307ee DW |
58 | virtual int FindString(const wxString& s) const; |
59 | virtual wxString GetString(int n) const ; | |
60 | virtual void SetString(int n, const wxString& s); | |
0e320a79 | 61 | |
dcd307ee DW |
62 | // OS2 only |
63 | virtual bool OS2Command(WXUINT param, WXWORD id); | |
a885d89a | 64 | MRESULT OS2WindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); |
0e320a79 DW |
65 | |
66 | protected: | |
dcd307ee DW |
67 | virtual void DoSetItemClientData( int n, void* clientData ); |
68 | virtual void* DoGetItemClientData( int n ) const; | |
69 | virtual void DoSetItemClientObject( int n, wxClientData* clientData ); | |
70 | virtual wxClientData* DoGetItemClientObject( int n ) const; | |
37f214d5 DW |
71 | |
72 | // OS2 implementation | |
e78c4d50 | 73 | virtual wxSize DoGetBestSize() const; |
37f214d5 DW |
74 | virtual void DoSetSize(int x, int y, |
75 | int width, int height, | |
76 | int sizeFlags = wxSIZE_AUTO); | |
0e320a79 DW |
77 | }; |
78 | ||
37f214d5 | 79 | #endif // _WX_CHOICE_H_ |