]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/choice.h
wxControl and wxChoice derive from the base classes under wxGTK too now
[wxWidgets.git] / include / wx / gtk / choice.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: choice.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef __GTKCHOICEH__
11 #define __GTKCHOICEH__
12
13 #ifdef __GNUG__
14 #pragma interface "choice.h"
15 #endif
16
17 //-----------------------------------------------------------------------------
18 // wxChoice
19 //-----------------------------------------------------------------------------
20
21 class wxChoice : public wxChoiceBase
22 {
23 public:
24 wxChoice();
25 wxChoice( wxWindow *parent, wxWindowID id,
26 const wxPoint& pos = wxDefaultPosition,
27 const wxSize& size = wxDefaultSize,
28 int n = 0, const wxString choices[] = (const wxString *) 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 ~wxChoice();
36 bool Create( wxWindow *parent, wxWindowID id,
37 const wxPoint& pos = wxDefaultPosition,
38 const wxSize& size = wxDefaultSize,
39 int n = 0, const wxString choices[] = (wxString *) NULL,
40 long style = 0,
41 const wxValidator& validator = wxDefaultValidator,
42 const wxString& name = wxChoiceNameStr );
43
44 // implement base class pure virtuals
45 void Delete(int n);
46 void Clear();
47
48 int GetSelection() const;
49 void SetSelection( int n );
50
51 virtual int GetCount() const;
52 int FindString( const wxString &string ) const;
53 wxString GetString( int n ) const;
54
55 // implementation
56 wxList m_clientDataList;
57 wxList m_clientObjectList;
58
59 void DisableEvents();
60 void EnableEvents();
61 void AppendCommon( const wxString &item );
62 void ApplyWidgetStyle();
63
64 protected:
65 virtual int DoAppend(const wxString& item);
66
67 virtual void DoSetClientData( int n, void* clientData );
68 virtual void* DoGetClientData( int n ) const;
69 virtual void DoSetClientObject( int n, wxClientData* clientData );
70 virtual wxClientData* DoGetClientObject( int n ) const;
71
72 private:
73 DECLARE_DYNAMIC_CLASS(wxChoice)
74 };
75
76
77 #endif // __GTKCHOICEH__