]>
Commit | Line | Data |
---|---|---|
2bda0e17 KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: choice.h | |
3 | // Purpose: wxChoice class | |
4 | // Author: Julian Smart | |
8d99be5f | 5 | // Modified by: Vadim Zeitlin to derive from wxChoiceBase |
2bda0e17 KB |
6 | // Created: 01/02/97 |
7 | // RCS-ID: $Id$ | |
bbcdf8bc | 8 | // Copyright: (c) Julian Smart |
8d99be5f | 9 | // Licence: wxWindows licence |
2bda0e17 KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
bbcdf8bc JS |
12 | #ifndef _WX_CHOICE_H_ |
13 | #define _WX_CHOICE_H_ | |
2bda0e17 KB |
14 | |
15 | #ifdef __GNUG__ | |
8d99be5f | 16 | #pragma interface "choice.h" |
2bda0e17 KB |
17 | #endif |
18 | ||
8d99be5f | 19 | // ---------------------------------------------------------------------------- |
2bda0e17 | 20 | // Choice item |
8d99be5f VZ |
21 | // ---------------------------------------------------------------------------- |
22 | ||
23 | class WXDLLEXPORT wxChoice : public wxChoiceBase | |
2bda0e17 | 24 | { |
bfc6fde4 VZ |
25 | DECLARE_DYNAMIC_CLASS(wxChoice) |
26 | ||
27 | public: | |
8d99be5f VZ |
28 | // ctors |
29 | wxChoice() { } | |
8ee9d618 | 30 | virtual ~wxChoice(); |
8d99be5f VZ |
31 | |
32 | wxChoice(wxWindow *parent, | |
33 | wxWindowID id, | |
34 | const wxPoint& pos = wxDefaultPosition, | |
35 | const wxSize& size = wxDefaultSize, | |
36 | int n = 0, const wxString choices[] = NULL, | |
37 | long style = 0, | |
38 | const wxValidator& validator = wxDefaultValidator, | |
39 | const wxString& name = wxChoiceNameStr) | |
bfc6fde4 VZ |
40 | { |
41 | Create(parent, id, pos, size, n, choices, style, validator, name); | |
42 | } | |
43 | ||
8d99be5f VZ |
44 | bool Create(wxWindow *parent, |
45 | wxWindowID id, | |
46 | const wxPoint& pos = wxDefaultPosition, | |
47 | const wxSize& size = wxDefaultSize, | |
48 | int n = 0, const wxString choices[] = NULL, | |
49 | long style = 0, | |
50 | const wxValidator& validator = wxDefaultValidator, | |
51 | const wxString& name = wxChoiceNameStr); | |
52 | ||
53 | // implement base class pure virtuals | |
4cd056a7 | 54 | virtual int DoAppend(const wxString& item); |
243dbf1a | 55 | virtual int DoInsert(const wxString& item, int pos); |
bfc6fde4 VZ |
56 | virtual void Delete(int n); |
57 | virtual void Clear(); | |
8d99be5f VZ |
58 | |
59 | virtual int GetCount() const; | |
60 | virtual int GetSelection() const; | |
bfc6fde4 | 61 | virtual void SetSelection(int n); |
bfc6fde4 | 62 | |
8d99be5f VZ |
63 | virtual int FindString(const wxString& s) const; |
64 | virtual wxString GetString(int n) const; | |
6c8a980f | 65 | virtual void SetString(int n, const wxString& s); |
bfc6fde4 | 66 | |
8d99be5f | 67 | // MSW only |
bfc6fde4 | 68 | virtual bool MSWCommand(WXUINT param, WXWORD id); |
bfc6fde4 | 69 | long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); |
f6bcfd97 BP |
70 | virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, |
71 | WXUINT message, WXWPARAM wParam, WXLPARAM lParam); | |
bbcdf8bc JS |
72 | |
73 | protected: | |
18c50997 | 74 | virtual void DoMoveWindow(int x, int y, int width, int height); |
6c8a980f VZ |
75 | virtual void DoSetItemClientData( int n, void* clientData ); |
76 | virtual void* DoGetItemClientData( int n ) const; | |
77 | virtual void DoSetItemClientObject( int n, wxClientData* clientData ); | |
78 | virtual wxClientData* DoGetItemClientObject( int n ) const; | |
bbcdf8bc | 79 | |
8d99be5f | 80 | // MSW implementation |
882a8f40 | 81 | virtual wxSize DoGetBestSize() const; |
bfc6fde4 | 82 | virtual void DoSetSize(int x, int y, |
4438caf4 VZ |
83 | int width, int height, |
84 | int sizeFlags = wxSIZE_AUTO); | |
8ee9d618 VZ |
85 | |
86 | // free all memory we have (used by Clear() and dtor) | |
87 | void Free(); | |
2bda0e17 KB |
88 | }; |
89 | ||
8d99be5f | 90 | #endif // _WX_CHOICE_H_ |