]>
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 | 14 | |
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
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 | 25 | public: |
8d99be5f VZ |
26 | // ctors |
27 | wxChoice() { } | |
8ee9d618 | 28 | virtual ~wxChoice(); |
8d99be5f VZ |
29 | |
30 | wxChoice(wxWindow *parent, | |
31 | wxWindowID id, | |
32 | const wxPoint& pos = wxDefaultPosition, | |
33 | const wxSize& size = wxDefaultSize, | |
34 | int n = 0, const wxString choices[] = NULL, | |
35 | long style = 0, | |
36 | const wxValidator& validator = wxDefaultValidator, | |
37 | const wxString& name = wxChoiceNameStr) | |
bfc6fde4 VZ |
38 | { |
39 | Create(parent, id, pos, size, n, choices, style, validator, name); | |
40 | } | |
41 | ||
8d99be5f VZ |
42 | bool Create(wxWindow *parent, |
43 | wxWindowID id, | |
44 | const wxPoint& pos = wxDefaultPosition, | |
45 | const wxSize& size = wxDefaultSize, | |
46 | int n = 0, const wxString choices[] = NULL, | |
47 | long style = 0, | |
48 | const wxValidator& validator = wxDefaultValidator, | |
49 | const wxString& name = wxChoiceNameStr); | |
50 | ||
51 | // implement base class pure virtuals | |
4cd056a7 | 52 | virtual int DoAppend(const wxString& item); |
243dbf1a | 53 | virtual int DoInsert(const wxString& item, int pos); |
bfc6fde4 VZ |
54 | virtual void Delete(int n); |
55 | virtual void Clear(); | |
8d99be5f VZ |
56 | |
57 | virtual int GetCount() const; | |
58 | virtual int GetSelection() const; | |
bfc6fde4 | 59 | virtual void SetSelection(int n); |
bfc6fde4 | 60 | |
8d99be5f VZ |
61 | virtual int FindString(const wxString& s) const; |
62 | virtual wxString GetString(int n) const; | |
6c8a980f | 63 | virtual void SetString(int n, const wxString& s); |
bfc6fde4 | 64 | |
8d99be5f | 65 | // MSW only |
bfc6fde4 | 66 | virtual bool MSWCommand(WXUINT param, WXWORD id); |
bfc6fde4 | 67 | long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); |
f6bcfd97 BP |
68 | virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, |
69 | WXUINT message, WXWPARAM wParam, WXLPARAM lParam); | |
bbcdf8bc JS |
70 | |
71 | protected: | |
18c50997 | 72 | virtual void DoMoveWindow(int x, int y, int width, int height); |
6c8a980f VZ |
73 | virtual void DoSetItemClientData( int n, void* clientData ); |
74 | virtual void* DoGetItemClientData( int n ) const; | |
75 | virtual void DoSetItemClientObject( int n, wxClientData* clientData ); | |
76 | virtual wxClientData* DoGetItemClientObject( int n ) const; | |
bbcdf8bc | 77 | |
8d99be5f | 78 | // MSW implementation |
882a8f40 | 79 | virtual wxSize DoGetBestSize() const; |
bfc6fde4 | 80 | virtual void DoSetSize(int x, int y, |
4438caf4 VZ |
81 | int width, int height, |
82 | int sizeFlags = wxSIZE_AUTO); | |
8ee9d618 VZ |
83 | |
84 | // free all memory we have (used by Clear() and dtor) | |
85 | void Free(); | |
fc7a2a60 VZ |
86 | |
87 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxChoice) | |
2bda0e17 KB |
88 | }; |
89 | ||
8d99be5f | 90 | #endif // _WX_CHOICE_H_ |