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 wxChar
*wxChoiceNameStr
;
35 //-----------------------------------------------------------------------------
37 //-----------------------------------------------------------------------------
39 class wxChoice
: public wxControl
43 wxChoice( wxWindow
*parent
, wxWindowID id
,
44 const wxPoint
& pos
= wxDefaultPosition
,
45 const wxSize
& size
= wxDefaultSize
,
46 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
48 const wxValidator
& validator
= wxDefaultValidator
,
49 const wxString
& name
= wxChoiceNameStr
)
51 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
54 bool Create( wxWindow
*parent
, wxWindowID id
,
55 const wxPoint
& pos
= wxDefaultPosition
,
56 const wxSize
& size
= wxDefaultSize
,
57 int n
= 0, const wxString choices
[] = (wxString
*) NULL
,
59 const wxValidator
& validator
= wxDefaultValidator
,
60 const wxString
& name
= wxChoiceNameStr
);
62 void Append( const wxString
&item
);
63 void Append( const wxString
&item
, void* clientData
);
64 void Append( const wxString
&item
, wxClientData
* clientData
);
66 void SetClientData( int n
, void* clientData
);
67 void* GetClientData( int n
);
68 void SetClientObject( int n
, wxClientData
* clientData
);
69 wxClientData
* GetClientObject( int n
);
71 void SetClientObject( wxClientData
*data
) { wxControl::SetClientObject( data
); }
72 wxClientData
*GetClientObject() const { return wxControl::GetClientObject(); }
73 void SetClientData( void *data
) { wxControl::SetClientData( data
); }
74 void *GetClientData() const { return wxControl::GetClientData(); }
79 int FindString( const wxString
&string
) const;
80 int GetColumns() const;
82 wxString
GetString( int n
) const;
83 wxString
GetStringSelection() const;
85 void SetColumns( int n
= 1 );
86 void SetSelection( int n
);
87 void SetStringSelection( const wxString
&string
);
91 wxList m_clientDataList
;
92 wxList m_clientObjectList
;
96 void AppendCommon( const wxString
&item
);
97 void ApplyWidgetStyle();
100 DECLARE_DYNAMIC_CLASS(wxChoice
)
104 #endif // __GTKCHOICEH__