]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/choice.h
SetEventData for a few widgets
[wxWidgets.git] / include / wx / gtk1 / 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
11 #ifndef __GTKCHOICEH__
12 #define __GTKCHOICEH__
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "wx/defs.h"
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
39 class wxChoice: public wxControl
40 {
41 DECLARE_DYNAMIC_CLASS(wxChoice)
42
43 public:
44
45 wxChoice();
46 inline wxChoice( wxWindow *parent, wxWindowID id,
47 const wxPoint& pos = wxDefaultPosition,
48 const wxSize& size = wxDefaultSize,
49 int n = 0, const wxString choices[] = (const wxString *) NULL,
50 long style = 0,
51 const wxValidator& validator = wxDefaultValidator,
52 const wxString& name = wxChoiceNameStr )
53 {
54 Create(parent, id, pos, size, n, choices, style, validator, name);
55 }
56 ~wxChoice();
57 bool Create( wxWindow *parent, wxWindowID id,
58 const wxPoint& pos = wxDefaultPosition,
59 const wxSize& size = wxDefaultSize,
60 int n = 0, const wxString choices[] = (wxString *) NULL,
61 long style = 0,
62 const wxValidator& validator = wxDefaultValidator,
63 const wxString& name = wxChoiceNameStr );
64
65 void Append( const wxString &item );
66 void Append( const wxString &item, void* clientData );
67 void Append( const wxString &item, wxClientData* clientData );
68
69 void SetClientData( int n, void* clientData );
70 void* GetClientData( int n );
71 void SetClientObject( int n, wxClientData* clientData );
72 wxClientData* GetClientObject( int n );
73
74 void Clear();
75 void Delete(int n);
76
77 int FindString( const wxString &string ) const;
78 int GetColumns() const;
79 int GetSelection();
80 wxString GetString( int n ) const;
81 wxString GetStringSelection() const;
82 int Number() const;
83 void SetColumns( int n = 1 );
84 void SetSelection( int n );
85 void SetStringSelection( const wxString &string );
86
87 // implementation
88
89 wxList m_clientDataList;
90
91 void AppendCommon( const wxString &item );
92 void ApplyWidgetStyle();
93 };
94
95 #endif // __GTKCHOICEH__