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
);
78 void SetClientObject( wxClientData
*data
) { wxControl::SetClientObject( data
); }
79 wxClientData
*GetClientObject() const { return wxControl::GetClientObject(); }
80 void SetClientData( void *data
) { wxControl::SetClientData( data
); }
81 void *GetClientData() const { return wxControl::GetClientData(); }
86 int FindString( const wxString
&item
);
87 int GetSelection() const;
88 wxString
GetString( int n
) const;
89 wxString
GetStringSelection() const;
91 void SetSelection( int n
);
92 void SetStringSelection( const wxString
&string
);
94 wxString
GetValue() const;
95 void SetValue(const wxString
& value
);
100 void SetInsertionPoint( long pos
);
101 void SetInsertionPointEnd();
102 long GetInsertionPoint() const;
103 long GetLastPosition() const;
104 void Replace( long from
, long to
, const wxString
& value
);
105 void Remove( long from
, long to
);
106 void SetSelection( long from
, long to
);
107 void SetEditable( bool editable
);
109 void OnSize( wxSizeEvent
&event
);
110 void OnChar( wxKeyEvent
&event
);
115 wxList m_clientDataList
;
116 wxList m_clientObjectList
;
118 void AppendCommon( const wxString
&item
);
119 GtkWidget
* GetConnectWidget();
120 bool IsOwnGtkWindow( GdkWindow
*window
);
121 void ApplyWidgetStyle();
123 DECLARE_EVENT_TABLE()