]>
Commit | Line | Data |
---|---|---|
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 | #include "wx/object.h" | |
22 | #include "wx/control.h" | |
23 | ||
24 | //----------------------------------------------------------------------------- | |
25 | // classes | |
26 | //----------------------------------------------------------------------------- | |
27 | ||
28 | class wxComboBox; | |
29 | ||
30 | //----------------------------------------------------------------------------- | |
31 | // global data | |
32 | //----------------------------------------------------------------------------- | |
33 | ||
34 | extern const char* wxComboBoxNameStr; | |
35 | extern const char* wxEmptyString; | |
36 | ||
37 | //----------------------------------------------------------------------------- | |
38 | // wxComboBox | |
39 | //----------------------------------------------------------------------------- | |
40 | ||
41 | class wxComboBox : public wxControl | |
42 | { | |
43 | DECLARE_DYNAMIC_CLASS(wxComboBox) | |
44 | ||
45 | public: | |
46 | ||
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, | |
53 | long style = 0, | |
54 | const wxValidator& validator = wxDefaultValidator, | |
55 | const wxString& name = wxComboBoxNameStr) | |
56 | { | |
57 | Create(parent, id, value, pos, size, n, choices, style, validator, name); | |
58 | } | |
59 | ~wxComboBox(); | |
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, | |
65 | long style = 0, | |
66 | const wxValidator& validator = wxDefaultValidator, | |
67 | const wxString& name = wxComboBoxNameStr); | |
68 | ||
69 | void Append( const wxString &item ); | |
70 | void Append( const wxString &item, void* clientData ); | |
71 | void Append( const wxString &item, wxClientData* clientData ); | |
72 | ||
73 | void SetClientData( int n, void* clientData ); | |
74 | void* GetClientData( int n ); | |
75 | void SetClientObject( int n, wxClientData* clientData ); | |
76 | wxClientData* GetClientObject( int n ); | |
77 | ||
78 | void Clear(); | |
79 | void Delete( int n ); | |
80 | ||
81 | int FindString( const wxString &item ); | |
82 | int GetSelection() const; | |
83 | wxString GetString( int n ) const; | |
84 | wxString GetStringSelection() const; | |
85 | int Number() const; | |
86 | void SetSelection( int n ); | |
87 | void SetStringSelection( const wxString &string ); | |
88 | ||
89 | wxString GetValue() const; | |
90 | void SetValue(const wxString& value); | |
91 | ||
92 | void Copy(); | |
93 | void Cut(); | |
94 | void Paste(); | |
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 ); | |
103 | ||
104 | void OnSize( wxSizeEvent &event ); | |
105 | void OnChar( wxKeyEvent &event ); | |
106 | ||
107 | // implementation | |
108 | ||
109 | bool m_alreadySent; | |
110 | wxList m_clientDataList; | |
111 | wxList m_clientObjectList; | |
112 | ||
113 | void AppendCommon( const wxString &item ); | |
114 | GtkWidget* GetConnectWidget(); | |
115 | bool IsOwnGtkWindow( GdkWindow *window ); | |
116 | void ApplyWidgetStyle(); | |
117 | ||
118 | DECLARE_EVENT_TABLE() | |
119 | }; | |
120 | ||
121 | #endif | |
122 | ||
123 | // __GTKCOMBOBOXH__ |