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
)
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
,
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
);
76 int FindString( const wxString
&string
) const;
77 int GetColumns() const;
79 wxString
GetString( int n
) const;
80 wxString
GetStringSelection() const;
82 void SetColumns( int n
= 1 );
83 void SetSelection( int n
);
84 void SetStringSelection( const wxString
&string
);
88 wxList m_clientDataList
;
89 wxList m_clientObjectList
;
91 void AppendCommon( const wxString
&item
);
92 void ApplyWidgetStyle();
95 #endif // __GTKCHOICEH__