1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef __GTKCHOICEH__
11 #define __GTKCHOICEH__
19 #include "wx/object.h"
21 #include "wx/control.h"
23 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
29 //-----------------------------------------------------------------------------
31 //-----------------------------------------------------------------------------
33 extern const char *wxChoiceNameStr
;
35 //-----------------------------------------------------------------------------
37 //-----------------------------------------------------------------------------
39 class wxChoice
: public wxControl
41 DECLARE_DYNAMIC_CLASS(wxChoice
)
45 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
,
50 const wxValidator
& validator
= wxDefaultValidator
,
51 const wxString
& name
= wxChoiceNameStr
)
53 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
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
,
61 const wxValidator
& validator
= wxDefaultValidator
,
62 const wxString
& name
= wxChoiceNameStr
);
64 void Append( const wxString
&item
);
65 void Append( const wxString
&item
, void* clientData
);
66 void Append( const wxString
&item
, wxClientData
* clientData
);
68 void SetClientData( int n
, void* clientData
);
69 void* GetClientData( int n
);
70 void SetClientObject( int n
, wxClientData
* clientData
);
71 wxClientData
* GetClientObject( int n
);
73 void SetClientObject( wxClientData
*data
) { wxControl::SetClientObject( data
); }
74 wxClientData
*GetClientObject() const { return wxControl::GetClientObject(); }
75 void SetClientData( void *data
) { wxControl::SetClientData( data
); }
76 void *GetClientData() const { return wxControl::GetClientData(); }
81 int FindString( const wxString
&string
) const;
82 int GetColumns() const;
84 wxString
GetString( int n
) const;
85 wxString
GetStringSelection() const;
87 void SetColumns( int n
= 1 );
88 void SetSelection( int n
);
89 void SetStringSelection( const wxString
&string
);
93 wxList m_clientDataList
;
94 wxList m_clientObjectList
;
96 void AppendCommon( const wxString
&item
);
97 void ApplyWidgetStyle();
101 #endif // __GTKCHOICEH__