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"
21 #include "wx/object.h"
22 #include "wx/control.h"
24 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
30 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
34 extern const char* wxComboBoxNameStr
;
35 extern const wxChar
* wxEmptyString
;
37 //-----------------------------------------------------------------------------
39 //-----------------------------------------------------------------------------
41 class wxComboBox
: public wxControl
43 DECLARE_DYNAMIC_CLASS(wxComboBox
)
47 inline wxComboBox() {}
48 inline wxComboBox(wxWindow
*parent
, wxWindowID id
,
49 const wxString
& value
= wxEmptyString
,
50 const wxPoint
& pos
= wxDefaultPosition
,
51 const wxSize
& size
= wxDefaultSize
,
52 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
54 const wxValidator
& validator
= wxDefaultValidator
,
55 const wxString
& name
= wxComboBoxNameStr
)
57 Create(parent
, id
, value
, pos
, size
, n
, choices
, style
, validator
, name
);
60 bool Create(wxWindow
*parent
, wxWindowID id
,
61 const wxString
& value
= wxEmptyString
,
62 const wxPoint
& pos
= wxDefaultPosition
,
63 const wxSize
& size
= wxDefaultSize
,
64 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
66 const wxValidator
& validator
= wxDefaultValidator
,
67 const wxString
& name
= wxComboBoxNameStr
);
69 void Append( const wxString
&item
);
70 void Append( const wxString
&item
, void* clientData
);
71 void Append( const wxString
&item
, wxClientData
* clientData
);
73 void SetClientData( int n
, void* clientData
);
74 void* GetClientData( int n
);
75 void SetClientObject( int n
, wxClientData
* clientData
);
76 wxClientData
* GetClientObject( int n
);
81 int FindString( const wxString
&item
);
82 int GetSelection() const;
83 wxString
GetString( int n
) const;
84 wxString
GetStringSelection() const;
86 void SetSelection( int n
);
87 void SetStringSelection( const wxString
&string
);
89 wxString
GetValue() const;
90 void SetValue(const wxString
& value
);
95 void SetInsertionPoint( long pos
);
96 void SetInsertionPointEnd();
97 long GetInsertionPoint() const;
98 long GetLastPosition() const;
99 void Replace( long from
, long to
, const wxString
& value
);
100 void Remove( long from
, long to
);
101 void SetSelection( long from
, long to
);
102 void SetEditable( bool editable
);
104 void OnSize( wxSizeEvent
&event
);
105 void OnChar( wxKeyEvent
&event
);
110 wxList m_clientDataList
;
111 wxList m_clientObjectList
;
113 void AppendCommon( const wxString
&item
);
114 GtkWidget
* GetConnectWidget();
115 bool IsOwnGtkWindow( GdkWindow
*window
);
116 void ApplyWidgetStyle();
118 DECLARE_EVENT_TABLE()