]>
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" | |
18 | #include "wx/object.h" | |
19 | #include "wx/list.h" | |
20 | #include "wx/control.h" | |
21 | ||
22 | //----------------------------------------------------------------------------- | |
23 | // classes | |
24 | //----------------------------------------------------------------------------- | |
25 | ||
26 | class wxChoice; | |
27 | ||
28 | //----------------------------------------------------------------------------- | |
29 | // global data | |
30 | //----------------------------------------------------------------------------- | |
31 | ||
32 | extern const char *wxChoiceNameStr; | |
33 | ||
34 | //----------------------------------------------------------------------------- | |
35 | // wxChoice | |
36 | //----------------------------------------------------------------------------- | |
37 | ||
29006414 | 38 | class wxChoice : public wxControl |
c801d85f | 39 | { |
29006414 | 40 | DECLARE_DYNAMIC_CLASS(wxChoice) |
c801d85f | 41 | |
fd0eed64 | 42 | public: |
29006414 VZ |
43 | wxChoice(); |
44 | wxChoice( wxWindow *parent, wxWindowID id, | |
45 | const wxPoint& pos = wxDefaultPosition, | |
46 | const wxSize& size = wxDefaultSize, | |
47 | int n = 0, const wxString choices[] = (const wxString *) NULL, | |
48 | long style = 0, | |
49 | const wxValidator& validator = wxDefaultValidator, | |
50 | const wxString& name = wxChoiceNameStr ) | |
51 | { | |
52 | Create(parent, id, pos, size, n, choices, style, validator, name); | |
53 | } | |
54 | ~wxChoice(); | |
55 | bool Create( wxWindow *parent, wxWindowID id, | |
56 | const wxPoint& pos = wxDefaultPosition, | |
57 | const wxSize& size = wxDefaultSize, | |
58 | int n = 0, const wxString choices[] = (wxString *) NULL, | |
59 | long style = 0, | |
60 | const wxValidator& validator = wxDefaultValidator, | |
61 | const wxString& name = wxChoiceNameStr ); | |
c801d85f | 62 | |
29006414 VZ |
63 | void Append( const wxString &item ); |
64 | void Append( const wxString &item, void* clientData ); | |
65 | void Append( const wxString &item, wxClientData* clientData ); | |
66 | ||
67 | void SetClientData( int n, void* clientData ); | |
68 | void* GetClientData( int n ); | |
69 | void SetClientObject( int n, wxClientData* clientData ); | |
70 | wxClientData* GetClientObject( int n ); | |
71 | ||
0de9b5b2 RR |
72 | void SetClientObject( wxClientData *data ) { wxControl::SetClientObject( data ); } |
73 | wxClientData *GetClientObject() const { return wxControl::GetClientObject(); } | |
74 | void SetClientData( void *data ) { wxControl::SetClientData( data ); } | |
75 | void *GetClientData() const { return wxControl::GetClientData(); } | |
76 | ||
29006414 VZ |
77 | void Clear(); |
78 | void Delete(int n); | |
79 | ||
80 | int FindString( const wxString &string ) const; | |
81 | int GetColumns() const; | |
82 | int GetSelection(); | |
83 | wxString GetString( int n ) const; | |
84 | wxString GetStringSelection() const; | |
85 | int Number() const; | |
86 | void SetColumns( int n = 1 ); | |
87 | void SetSelection( int n ); | |
88 | void SetStringSelection( const wxString &string ); | |
89 | ||
90 | // implementation | |
91 | ||
92 | wxList m_clientDataList; | |
93 | wxList m_clientObjectList; | |
94 | ||
95 | void AppendCommon( const wxString &item ); | |
96 | void ApplyWidgetStyle(); | |
c801d85f KB |
97 | }; |
98 | ||
99 | #endif // __GTKCHOICEH__ |