]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/choice.h
Changed two conflicting defines in defs.h
[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_clientList;
57
58 void DisableEvents();
59 void EnableEvents();
60 void AppendCommon( const wxString &item );
61 void ApplyWidgetStyle();
62
63 protected:
64 virtual int DoAppend(const wxString& item);
65
66 virtual void DoSetClientData( int n, void* clientData );
67 virtual void* DoGetClientData( int n ) const;
68 virtual void DoSetClientObject( int n, wxClientData* clientData );
69 virtual wxClientData* DoGetClientObject( int n ) const;
70
71 // the above virtuals hide these virtuals in wxChoiceBase
72 virtual void DoSetClientData(void* clientData )
73 { wxWindowBase::DoSetClientData(clientData); };
74 virtual void* DoGetClientData() const
75 { return(wxWindowBase::DoGetClientData()); };
76 virtual void DoSetClientObject( wxClientData* clientData )
77 { wxWindowBase::DoSetClientObject(clientData); };
78 virtual wxClientData* DoGetClientObject() const
79 { return(wxWindowBase::DoGetClientObject()); };
80
81 private:
82 DECLARE_DYNAMIC_CLASS(wxChoice)
83 };
84
85
86 #endif // __GTKCHOICEH__