]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: combobox.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
5 | // Created: 01/02/97 | |
5ebd1fb2 | 6 | // Id: $Id$ |
c801d85f KB |
7 | // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | ||
12 | #ifndef __GTKCOMBOBOXH__ | |
13 | #define __GTKCOMBOBOXH__ | |
14 | ||
15 | #ifdef __GNUG__ | |
5ebd1fb2 | 16 | #pragma interface "combobox.h" |
c801d85f KB |
17 | #endif |
18 | ||
19 | #include "wx/defs.h" | |
20 | #include "wx/object.h" | |
c801d85f KB |
21 | #include "wx/control.h" |
22 | ||
23 | //----------------------------------------------------------------------------- | |
24 | // classes | |
25 | //----------------------------------------------------------------------------- | |
26 | ||
27 | class wxComboBox; | |
28 | ||
7f4dc78d RR |
29 | //----------------------------------------------------------------------------- |
30 | // global data | |
31 | //----------------------------------------------------------------------------- | |
32 | ||
33 | extern const char* wxComboBoxNameStr; | |
34 | extern const char* wxEmptyString; | |
35 | ||
c801d85f KB |
36 | //----------------------------------------------------------------------------- |
37 | // wxComboBox | |
38 | //----------------------------------------------------------------------------- | |
39 | ||
7f4dc78d RR |
40 | class wxComboBox: public wxControl |
41 | { | |
42 | DECLARE_DYNAMIC_CLASS(wxComboBox) | |
43 | ||
44 | public: | |
45 | inline wxComboBox(void) {} | |
46 | ||
47 | inline wxComboBox(wxWindow *parent, const wxWindowID id, | |
48 | const wxString& value = wxEmptyString, | |
49 | const wxPoint& pos = wxDefaultPosition, | |
50 | const wxSize& size = wxDefaultSize, | |
51 | const int n = 0, const wxString choices[] = NULL, | |
52 | const long style = 0, | |
53 | const wxString& name = wxComboBoxNameStr) | |
54 | { | |
55 | Create(parent, id, value, pos, size, n, choices, style, name); | |
56 | } | |
57 | ||
58 | bool Create(wxWindow *parent, const wxWindowID id, | |
59 | const wxString& value = wxEmptyString, | |
60 | const wxPoint& pos = wxDefaultPosition, | |
61 | const wxSize& size = wxDefaultSize, | |
62 | const int n = 0, const wxString choices[] = NULL, | |
63 | const long style = 0, | |
64 | const wxString& name = wxComboBoxNameStr); | |
65 | ||
66 | // List functions | |
67 | void Clear(void); | |
68 | void Append( const wxString &item ); | |
69 | void Append( const wxString &item, char* clientData ); | |
70 | void Delete( const int n ); | |
71 | int FindString( const wxString &item ); | |
72 | char* GetClientData( const int n ); | |
73 | void SetClientData( const int n, char * clientData ); | |
74 | int GetSelection(void) const; | |
75 | wxString GetString( const int n ) const; | |
76 | wxString GetStringSelection(void) const; | |
77 | int Number(void) const; | |
53010e52 | 78 | void SetSelection( const int n ); |
7f4dc78d RR |
79 | |
80 | // Text field functions | |
81 | wxString GetValue(void) const ; | |
82 | void SetValue(const wxString& value); | |
83 | ||
84 | // Clipboard operations | |
85 | void Copy(void); | |
86 | void Cut(void); | |
87 | void Paste(void); | |
88 | void SetInsertionPoint(const long pos); | |
89 | void SetInsertionPointEnd(void); | |
90 | long GetInsertionPoint(void) const ; | |
91 | long GetLastPosition(void) const ; | |
92 | void Replace(const long from, const long to, const wxString& value); | |
93 | void Remove(const long from, const long to); | |
94 | void SetSelection(const long from, const long to); | |
95 | void SetEditable(const bool editable); | |
96 | ||
97 | private: | |
98 | ||
99 | wxList m_clientData; | |
100 | ||
101 | }; | |
102 | ||
c801d85f | 103 | #endif // __GTKCOMBOBOXH__ |