]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: 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 | WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr; | |
16 | ||
17 | // Choice item | |
18 | class WXDLLEXPORT wxChoice: public wxChoiceBase | |
19 | { | |
20 | DECLARE_DYNAMIC_CLASS(wxChoice) | |
21 | ||
22 | public: | |
23 | // ctors | |
24 | inline wxChoice() { } | |
25 | ||
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, | |
31 | const wxValidator& validator = wxDefaultValidator, | |
32 | const wxString& name = wxChoiceNameStr) | |
33 | { | |
34 | Create(parent, id, pos, size, n, choices, style, validator, name); | |
35 | } | |
36 | ||
37 | bool Create(wxWindow *parent, wxWindowID id, | |
38 | const wxPoint& pos = wxDefaultPosition, | |
39 | const wxSize& size = wxDefaultSize, | |
40 | int n = 0, const wxString choices[] = NULL, | |
41 | long style = 0, | |
42 | const wxValidator& validator = wxDefaultValidator, | |
43 | const wxString& name = wxChoiceNameStr); | |
44 | ||
45 | // Implement base class virtuals | |
46 | virtual int DoAppend(const wxString& item); | |
47 | virtual void Delete(int n); | |
48 | virtual void Clear(); | |
49 | ||
50 | virtual int GetCount() const; | |
51 | virtual int GetSelection() const ; | |
52 | virtual void SetSelection(int n); | |
53 | ||
54 | virtual int FindString(const wxString& s) const; | |
55 | virtual wxString GetString(int n) const ; | |
56 | virtual void SetString(int n, const wxString& s); | |
57 | ||
58 | // OS2 only | |
59 | virtual bool OS2Command(WXUINT param, WXWORD id); | |
60 | MRESULT OS2WindowProc(HWND hwnd, WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); | |
61 | ||
62 | protected: | |
63 | virtual void DoSetItemClientData( int n, void* clientData ); | |
64 | virtual void* DoGetItemClientData( int n ) const; | |
65 | virtual void DoSetItemClientObject( int n, wxClientData* clientData ); | |
66 | virtual wxClientData* DoGetItemClientObject( int n ) const; | |
67 | ||
68 | // OS2 implementation | |
69 | virtual wxSize DoGetBestSize(); | |
70 | virtual void DoSetSize(int x, int y, | |
71 | int width, int height, | |
72 | int sizeFlags = wxSIZE_AUTO); | |
73 | private: | |
74 | // Virtual function hiding supression | |
75 | /* | |
76 | inline virtual void DoSetClientData( void *data ) | |
77 | { wxWindowBase::DoSetClientData(data); } | |
78 | inline virtual void DoSetClientObject( wxClientData *data ) | |
79 | { wxWindowBase::DoSetClientObject(data); } | |
80 | inline virtual wxClientData *DoGetClientObject() const | |
81 | { return(wxWindowBase::DoGetClientObject());} | |
82 | inline virtual void *DoGetClientData() const | |
83 | { return(wxWindowBase::DoGetClientData());} | |
84 | */ | |
85 | }; | |
86 | ||
87 | #endif // _WX_CHOICE_H_ |