]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: choice.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
dbf858b5 | 5 | // Id: $Id$ |
01111366 | 6 | // Copyright: (c) 1998 Robert Roebling |
29006414 | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
c801d85f KB |
10 | #ifndef __GTKCHOICEH__ |
11 | #define __GTKCHOICEH__ | |
12 | ||
13 | #ifdef __GNUG__ | |
14 | #pragma interface | |
15 | #endif | |
16 | ||
17 | #include "wx/defs.h" | |
ce4169a4 | 18 | |
c801d85f KB |
19 | #include "wx/object.h" |
20 | #include "wx/list.h" | |
21 | #include "wx/control.h" | |
22 | ||
23 | //----------------------------------------------------------------------------- | |
24 | // classes | |
25 | //----------------------------------------------------------------------------- | |
26 | ||
27 | class wxChoice; | |
28 | ||
29 | //----------------------------------------------------------------------------- | |
30 | // global data | |
31 | //----------------------------------------------------------------------------- | |
32 | ||
33 | extern const char *wxChoiceNameStr; | |
34 | ||
35 | //----------------------------------------------------------------------------- | |
36 | // wxChoice | |
37 | //----------------------------------------------------------------------------- | |
38 | ||
29006414 | 39 | class wxChoice : public wxControl |
c801d85f | 40 | { |
29006414 | 41 | DECLARE_DYNAMIC_CLASS(wxChoice) |
c801d85f | 42 | |
fd0eed64 | 43 | public: |
29006414 VZ |
44 | wxChoice(); |
45 | wxChoice( wxWindow *parent, wxWindowID id, | |
46 | const wxPoint& pos = wxDefaultPosition, | |
47 | const wxSize& size = wxDefaultSize, | |
48 | int n = 0, const wxString choices[] = (const wxString *) NULL, | |
49 | long style = 0, | |
50 | const wxValidator& validator = wxDefaultValidator, | |
51 | const wxString& name = wxChoiceNameStr ) | |
52 | { | |
53 | Create(parent, id, pos, size, n, choices, style, validator, name); | |
54 | } | |
55 | ~wxChoice(); | |
56 | bool Create( wxWindow *parent, wxWindowID id, | |
57 | const wxPoint& pos = wxDefaultPosition, | |
58 | const wxSize& size = wxDefaultSize, | |
59 | int n = 0, const wxString choices[] = (wxString *) NULL, | |
60 | long style = 0, | |
61 | const wxValidator& validator = wxDefaultValidator, | |
62 | const wxString& name = wxChoiceNameStr ); | |
c801d85f | 63 | |
29006414 VZ |
64 | void Append( const wxString &item ); |
65 | void Append( const wxString &item, void* clientData ); | |
66 | void Append( const wxString &item, wxClientData* clientData ); | |
67 | ||
68 | void SetClientData( int n, void* clientData ); | |
69 | void* GetClientData( int n ); | |
70 | void SetClientObject( int n, wxClientData* clientData ); | |
71 | wxClientData* GetClientObject( int n ); | |
72 | ||
0de9b5b2 RR |
73 | void SetClientObject( wxClientData *data ) { wxControl::SetClientObject( data ); } |
74 | wxClientData *GetClientObject() const { return wxControl::GetClientObject(); } | |
75 | void SetClientData( void *data ) { wxControl::SetClientData( data ); } | |
76 | void *GetClientData() const { return wxControl::GetClientData(); } | |
77 | ||
29006414 VZ |
78 | void Clear(); |
79 | void Delete(int n); | |
80 | ||
81 | int FindString( const wxString &string ) const; | |
82 | int GetColumns() const; | |
83 | int GetSelection(); | |
84 | wxString GetString( int n ) const; | |
85 | wxString GetStringSelection() const; | |
86 | int Number() const; | |
87 | void SetColumns( int n = 1 ); | |
88 | void SetSelection( int n ); | |
89 | void SetStringSelection( const wxString &string ); | |
90 | ||
91 | // implementation | |
92 | ||
93 | wxList m_clientDataList; | |
94 | wxList m_clientObjectList; | |
95 | ||
953704c1 RR |
96 | void DisableEvents(); |
97 | void EnableEvents(); | |
29006414 VZ |
98 | void AppendCommon( const wxString &item ); |
99 | void ApplyWidgetStyle(); | |
c801d85f KB |
100 | }; |
101 | ||
ce4169a4 | 102 | |
c801d85f | 103 | #endif // __GTKCHOICEH__ |