1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef __GTKCHOICEH__
11 #define __GTKCHOICEH__
18 #include "wx/object.h"
20 #include "wx/control.h"
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
30 //-----------------------------------------------------------------------------
32 extern const char *wxChoiceNameStr
;
34 //-----------------------------------------------------------------------------
36 //-----------------------------------------------------------------------------
38 class wxChoice
: public wxControl
40 DECLARE_DYNAMIC_CLASS(wxChoice
)
44 wxChoice( wxWindow
*parent
, wxWindowID id
,
45 const wxPoint
& pos
= wxDefaultPosition
,
46 const wxSize
& size
= wxDefaultSize
,
47 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
49 const wxValidator
& validator
= wxDefaultValidator
,
50 const wxString
& name
= wxChoiceNameStr
)
52 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
55 bool Create( wxWindow
*parent
, wxWindowID id
,
56 const wxPoint
& pos
= wxDefaultPosition
,
57 const wxSize
& size
= wxDefaultSize
,
58 int n
= 0, const wxString choices
[] = (wxString
*) NULL
,
60 const wxValidator
& validator
= wxDefaultValidator
,
61 const wxString
& name
= wxChoiceNameStr
);
63 void Append( const wxString
&item
);
64 void Append( const wxString
&item
, void* clientData
);
65 void Append( const wxString
&item
, wxClientData
* clientData
);
67 void SetClientData( int n
, void* clientData
);
68 void* GetClientData( int n
);
69 void SetClientObject( int n
, wxClientData
* clientData
);
70 wxClientData
* GetClientObject( int n
);
72 void SetClientObject( wxClientData
*data
) { wxControl::SetClientObject( data
); }
73 wxClientData
*GetClientObject() const { return wxControl::GetClientObject(); }
74 void SetClientData( void *data
) { wxControl::SetClientData( data
); }
75 void *GetClientData() const { return wxControl::GetClientData(); }
80 int FindString( const wxString
&string
) const;
81 int GetColumns() const;
83 wxString
GetString( int n
) const;
84 wxString
GetStringSelection() const;
86 void SetColumns( int n
= 1 );
87 void SetSelection( int n
);
88 void SetStringSelection( const wxString
&string
);
92 wxList m_clientDataList
;
93 wxList m_clientObjectList
;
95 void AppendCommon( const wxString
&item
);
96 void ApplyWidgetStyle();
99 #endif // __GTKCHOICEH__