]>
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 | inline wxChoice() { } | |
24 | ||
25 | inline wxChoice(wxWindow *parent, wxWindowID id, | |
26 | const wxPoint& pos = wxDefaultPosition, | |
27 | const wxSize& size = wxDefaultSize, | |
28 | int n = 0, const wxString choices[] = NULL, | |
29 | long style = 0, | |
30 | const wxValidator& validator = wxDefaultValidator, | |
31 | const wxString& name = wxChoiceNameStr) | |
32 | { | |
33 | Create(parent, id, pos, size, n, choices, style, validator, name); | |
34 | } | |
35 | ||
36 | bool Create(wxWindow *parent, wxWindowID id, | |
37 | const wxPoint& pos = wxDefaultPosition, | |
38 | const wxSize& size = wxDefaultSize, | |
39 | int n = 0, const wxString choices[] = NULL, | |
40 | long style = 0, | |
41 | const wxValidator& validator = wxDefaultValidator, | |
42 | const wxString& name = wxChoiceNameStr); | |
43 | ||
44 | virtual int DoAppend(const wxString& item); | |
45 | virtual void Delete(int n); | |
46 | virtual void Clear(); | |
47 | ||
48 | virtual int GetCount() const; | |
49 | virtual int GetSelection() const ; | |
50 | virtual void SetSelection(int n); | |
51 | ||
52 | virtual int FindString(const wxString& s) const; | |
53 | virtual wxString GetString(int n) const ; | |
54 | ||
55 | // OS2 only | |
56 | virtual bool OS2Command(WXUINT param, WXWORD id); | |
57 | MRESULT OS2WindowProc(HWND hwnd, WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); | |
58 | ||
59 | protected: | |
60 | virtual void DoSetClientData( int n, void* clientData ); | |
61 | virtual void* DoGetClientData( int n ) const; | |
62 | virtual void DoSetClientObject( int n, wxClientData* clientData ); | |
63 | virtual wxClientData* DoGetClientObject( int n ) const; | |
64 | ||
65 | // OS2 implementation | |
66 | virtual wxSize DoGetBestSize(); | |
67 | virtual void DoSetSize(int x, int y, | |
68 | int width, int height, | |
69 | int sizeFlags = wxSIZE_AUTO); | |
70 | private: | |
71 | // Virtual function hiding supression | |
72 | inline virtual void DoSetClientData( void *data ) | |
73 | { wxWindowBase::DoSetClientData(data); } | |
74 | inline virtual void DoSetClientObject( wxClientData *data ) | |
75 | { wxWindowBase::DoSetClientObject(data); } | |
76 | inline virtual wxClientData *DoGetClientObject() const | |
77 | { return(wxWindowBase::DoGetClientObject());} | |
78 | inline virtual void *DoGetClientData() const | |
79 | { return(wxWindowBase::DoGetClientData());} | |
80 | }; | |
81 | ||
82 | #endif // _WX_CHOICE_H_ |