]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/combobox.h
Made icons configurable via a wxMApp virtual function. Tested on wxGTK only,
[wxWidgets.git] / include / wx / gtk / combobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: combobox.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Created: 01/02/97
6 // Id: $Id$
7 // Copyright: (c) 1998 Robert Roebling
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11
12 #ifndef __GTKCOMBOBOXH__
13 #define __GTKCOMBOBOXH__
14
15 #ifdef __GNUG__
16 #pragma interface "combobox.h"
17 #endif
18
19 #include "wx/defs.h"
20
21 #if wxUSE_COMBOBOX
22
23 #include "wx/object.h"
24 #include "wx/control.h"
25
26 //-----------------------------------------------------------------------------
27 // classes
28 //-----------------------------------------------------------------------------
29
30 class wxComboBox;
31
32 //-----------------------------------------------------------------------------
33 // global data
34 //-----------------------------------------------------------------------------
35
36 extern const char* wxComboBoxNameStr;
37 extern const wxChar* wxEmptyString;
38
39 //-----------------------------------------------------------------------------
40 // wxComboBox
41 //-----------------------------------------------------------------------------
42
43 class wxComboBox : public wxControl
44 {
45 DECLARE_DYNAMIC_CLASS(wxComboBox)
46
47 public:
48
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,
55 long style = 0,
56 const wxValidator& validator = wxDefaultValidator,
57 const wxString& name = wxComboBoxNameStr)
58 {
59 Create(parent, id, value, pos, size, n, choices, style, validator, name);
60 }
61 ~wxComboBox();
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,
67 long style = 0,
68 const wxValidator& validator = wxDefaultValidator,
69 const wxString& name = wxComboBoxNameStr);
70
71 void Append( const wxString &item );
72 void Append( const wxString &item, void* clientData );
73 void Append( const wxString &item, wxClientData* clientData );
74
75 void SetClientData( int n, void* clientData );
76 void* GetClientData( int n );
77 void SetClientObject( int n, wxClientData* clientData );
78 wxClientData* GetClientObject( int n );
79
80 void SetClientObject( wxClientData *data ) { wxControl::SetClientObject( data ); }
81 wxClientData *GetClientObject() const { return wxControl::GetClientObject(); }
82 void SetClientData( void *data ) { wxControl::SetClientData( data ); }
83 void *GetClientData() const { return wxControl::GetClientData(); }
84
85 void Clear();
86 void Delete( int n );
87
88 int FindString( const wxString &item );
89 int GetSelection() const;
90 wxString GetString( int n ) const;
91 wxString GetStringSelection() const;
92 int Number() const;
93 void SetSelection( int n );
94 void SetStringSelection( const wxString &string );
95
96 wxString GetValue() const;
97 void SetValue(const wxString& value);
98
99 void Copy();
100 void Cut();
101 void Paste();
102 void SetInsertionPoint( long pos );
103 void SetInsertionPointEnd();
104 long GetInsertionPoint() const;
105 long GetLastPosition() const;
106 void Replace( long from, long to, const wxString& value );
107 void Remove( long from, long to );
108 void SetSelection( long from, long to );
109 void SetEditable( bool editable );
110
111 void OnSize( wxSizeEvent &event );
112 void OnChar( wxKeyEvent &event );
113
114 // implementation
115
116 bool m_alreadySent;
117 wxList m_clientDataList;
118 wxList m_clientObjectList;
119
120 void AppendCommon( const wxString &item );
121 GtkWidget* GetConnectWidget();
122 bool IsOwnGtkWindow( GdkWindow *window );
123 void ApplyWidgetStyle();
124
125 DECLARE_EVENT_TABLE()
126 };
127
128 #endif
129
130 #endif
131
132 // __GTKCOMBOBOXH__