1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __GTKCOMBOBOXH__
13 #define __GTKCOMBOBOXH__
16 #pragma interface "combobox.h"
23 #include "wx/object.h"
24 #include "wx/control.h"
26 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
34 //-----------------------------------------------------------------------------
36 extern const char* wxComboBoxNameStr
;
37 extern const char* wxEmptyString
;
39 //-----------------------------------------------------------------------------
41 //-----------------------------------------------------------------------------
43 class wxComboBox
: public wxControl
45 DECLARE_DYNAMIC_CLASS(wxComboBox
)
49 inline wxComboBox() {}
50 inline wxComboBox(wxWindow
*parent
, wxWindowID id
,
51 const wxString
& value
= wxEmptyString
,
52 const wxPoint
& pos
= wxDefaultPosition
,
53 const wxSize
& size
= wxDefaultSize
,
54 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
56 const wxValidator
& validator
= wxDefaultValidator
,
57 const wxString
& name
= wxComboBoxNameStr
)
59 Create(parent
, id
, value
, pos
, size
, n
, choices
, style
, validator
, name
);
62 bool Create(wxWindow
*parent
, wxWindowID id
,
63 const wxString
& value
= wxEmptyString
,
64 const wxPoint
& pos
= wxDefaultPosition
,
65 const wxSize
& size
= wxDefaultSize
,
66 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
68 const wxValidator
& validator
= wxDefaultValidator
,
69 const wxString
& name
= wxComboBoxNameStr
);
71 void Append( const wxString
&item
);
72 void Append( const wxString
&item
, void* clientData
);
73 void Append( const wxString
&item
, wxClientData
* clientData
);
75 void SetClientData( int n
, void* clientData
);
76 void* GetClientData( int n
);
77 void SetClientObject( int n
, wxClientData
* clientData
);
78 wxClientData
* GetClientObject( int n
);
83 int FindString( const wxString
&item
);
84 int GetSelection() const;
85 wxString
GetString( int n
) const;
86 wxString
GetStringSelection() const;
88 void SetSelection( int n
);
89 void SetStringSelection( const wxString
&string
);
91 wxString
GetValue() const;
92 void SetValue(const wxString
& value
);
97 void SetInsertionPoint( long pos
);
98 void SetInsertionPointEnd();
99 long GetInsertionPoint() const;
100 long GetLastPosition() const;
101 void Replace( long from
, long to
, const wxString
& value
);
102 void Remove( long from
, long to
);
103 void SetSelection( long from
, long to
);
104 void SetEditable( bool editable
);
106 void OnSize( wxSizeEvent
&event
);
111 wxList m_clientDataList
;
112 wxList m_clientObjectList
;
114 void AppendCommon( const wxString
&item
);
115 GtkWidget
* GetConnectWidget();
116 bool IsOwnGtkWindow( GdkWindow
*window
);
117 void ApplyWidgetStyle();
119 DECLARE_EVENT_TABLE()