]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/combobox.h
1. new wxList code
[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 #include "wx/object.h"
21 #include "wx/control.h"
22
23 //-----------------------------------------------------------------------------
24 // classes
25 //-----------------------------------------------------------------------------
26
27 class wxComboBox;
28
29 //-----------------------------------------------------------------------------
30 // global data
31 //-----------------------------------------------------------------------------
32
33 extern const char* wxComboBoxNameStr;
34 extern const char* wxEmptyString;
35
36 //-----------------------------------------------------------------------------
37 // wxComboBox
38 //-----------------------------------------------------------------------------
39
40 class wxComboBox : public wxControl
41 {
42 DECLARE_DYNAMIC_CLASS(wxComboBox)
43
44 public:
45
46 inline wxComboBox() {}
47 inline wxComboBox(wxWindow *parent, wxWindowID id,
48 const wxString& value = wxEmptyString,
49 const wxPoint& pos = wxDefaultPosition,
50 const wxSize& size = wxDefaultSize,
51 int n = 0, const wxString choices[] = (const wxString *) NULL,
52 long style = 0,
53 const wxValidator& validator = wxDefaultValidator,
54 const wxString& name = wxComboBoxNameStr)
55 {
56 Create(parent, id, value, pos, size, n, choices, style, validator, name);
57 }
58 ~wxComboBox();
59 bool Create(wxWindow *parent, wxWindowID id,
60 const wxString& value = wxEmptyString,
61 const wxPoint& pos = wxDefaultPosition,
62 const wxSize& size = wxDefaultSize,
63 int n = 0, const wxString choices[] = (const wxString *) NULL,
64 long style = 0,
65 const wxValidator& validator = wxDefaultValidator,
66 const wxString& name = wxComboBoxNameStr);
67
68 void Append( const wxString &item );
69 void Append( const wxString &item, void* clientData );
70 void Append( const wxString &item, wxClientData* clientData );
71
72 void SetClientData( int n, void* clientData );
73 void* GetClientData( int n );
74 void SetClientObject( int n, wxClientData* clientData );
75 wxClientData* GetClientObject( int n );
76
77 void Clear();
78 void Delete( int n );
79
80 int FindString( const wxString &item );
81 int GetSelection() const;
82 wxString GetString( int n ) const;
83 wxString GetStringSelection() const;
84 int Number() const;
85 void SetSelection( int n );
86 void SetStringSelection( const wxString &string );
87
88 wxString GetValue() const;
89 void SetValue(const wxString& value);
90
91 void Copy();
92 void Cut();
93 void Paste();
94 void SetInsertionPoint( long pos );
95 void SetInsertionPointEnd();
96 long GetInsertionPoint() const;
97 long GetLastPosition() const;
98 void Replace( long from, long to, const wxString& value );
99 void Remove( long from, long to );
100 void SetSelection( long from, long to );
101 void SetEditable( bool editable );
102
103 void OnSize( wxSizeEvent &event );
104
105 // implementation
106
107 bool m_alreadySent;
108 wxList m_clientDataList;
109 wxList m_clientObjectList;
110
111 void AppendCommon( const wxString &item );
112 GtkWidget* GetConnectWidget();
113 bool IsOwnGtkWindow( GdkWindow *window );
114 void ApplyWidgetStyle();
115
116 DECLARE_EVENT_TABLE()
117 };
118
119 #endif // __GTKCOMBOBOXH__