]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/choice.h
Tried to fix wxPanel bug (windows now set the panel current focus window on deletion);
[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
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
38 class wxChoice: public wxControl
39 {
40 DECLARE_DYNAMIC_CLASS(wxChoice)
41
42 public:
43
44 wxChoice();
45 inline 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 );
63
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
73 void Clear();
74 void Delete(int n);
75
76 int FindString( const wxString &string ) const;
77 int GetColumns() const;
78 int GetSelection();
79 wxString GetString( int n ) const;
80 wxString GetStringSelection() const;
81 int Number() const;
82 void SetColumns( int n = 1 );
83 void SetSelection( int n );
84 void SetStringSelection( const wxString &string );
85
86 // implementation
87
88 wxList m_clientDataList;
89 wxList m_clientObjectList;
90
91 void AppendCommon( const wxString &item );
92 void ApplyWidgetStyle();
93 };
94
95 #endif // __GTKCHOICEH__