1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __GTKCOMBOBOXH__
13 #define __GTKCOMBOBOXH__
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "combobox.h"
23 #include "wx/object.h"
25 //-----------------------------------------------------------------------------
27 //-----------------------------------------------------------------------------
31 //-----------------------------------------------------------------------------
33 //-----------------------------------------------------------------------------
35 extern const wxChar
* wxComboBoxNameStr
;
36 extern const wxChar
* wxEmptyString
;
38 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
42 class wxComboBox
: public wxControl
, public wxComboBoxBase
45 inline wxComboBox() {}
46 inline wxComboBox(wxWindow
*parent
, wxWindowID id
,
47 const wxString
& value
= wxEmptyString
,
48 const wxPoint
& pos
= wxDefaultPosition
,
49 const wxSize
& size
= wxDefaultSize
,
50 int n
= 0, const wxString choices
[] = (const wxString
*) NULL
,
52 const wxValidator
& validator
= wxDefaultValidator
,
53 const wxString
& name
= wxComboBoxNameStr
)
55 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
);
72 virtual int FindString( const wxString
&item
) const;
73 int GetSelection() const;
74 wxString
GetString( int n
) const;
75 wxString
GetStringSelection() const;
77 int Number() const { return GetCount(); }
78 void SetSelection( int n
);
79 void Select( int n
) { return SetSelection( n
); }
80 void SetStringSelection( const wxString
&string
);
81 void SetString(int n
, const wxString
&text
);
83 wxString
GetValue() const;
84 void SetValue(const wxString
& value
);
89 void SetInsertionPoint( long pos
);
90 void SetInsertionPointEnd() { SetInsertionPoint( -1 ); }
91 long GetInsertionPoint() const;
92 long GetLastPosition() const;
93 void Remove(long from
, long to
) { Replace(from
, to
, wxEmptyString
); }
94 void Replace( long from
, long to
, const wxString
& value
);
95 void SetSelection( long from
, long to
);
96 void SetEditable( bool editable
);
100 virtual void SetFocus();
102 void OnSize( wxSizeEvent
&event
);
103 void OnChar( wxKeyEvent
&event
);
106 wxList m_clientDataList
;
107 wxList m_clientObjectList
;
110 void DisableEvents();
112 GtkWidget
* GetConnectWidget();
113 bool IsOwnGtkWindow( GdkWindow
*window
);
114 void ApplyWidgetStyle();
116 wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST
119 virtual int DoAppend(const wxString
& item
);
120 virtual int DoInsert(const wxString
& item
, int pos
);
122 virtual void DoSetItemClientData( int n
, void* clientData
);
123 virtual void* DoGetItemClientData( int n
) const;
124 virtual void DoSetItemClientObject( int n
, wxClientData
* clientData
);
125 virtual wxClientData
* DoGetItemClientObject( int n
) const;
127 virtual wxSize
DoGetBestSize() const;
130 DECLARE_DYNAMIC_CLASS_NO_COPY(wxComboBox
)
131 DECLARE_EVENT_TABLE()