]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/combobox.h
* New function wxObjectInputStream::Recall()
[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, Julian Smart and Markus Holzem
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 inline wxComboBox(void) {}
46
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 bool Create(wxWindow *parent, wxWindowID id,
59 const wxString& value = wxEmptyString,
60 const wxPoint& pos = wxDefaultPosition,
61 const wxSize& size = wxDefaultSize,
62 int n = 0, const wxString choices[] = (const wxString *) NULL,
63 long style = 0,
64 const wxValidator& validator = wxDefaultValidator,
65 const wxString& name = wxComboBoxNameStr);
66
67 // List functions
68 void Clear(void);
69 void Append( const wxString &item );
70 void Append( const wxString &item, char* clientData );
71 void Delete( int n );
72 int FindString( const wxString &item );
73 char* GetClientData( int n );
74 void SetClientData( int n, char * clientData );
75 int GetSelection(void) const;
76 wxString GetString( int n ) const;
77 wxString GetStringSelection(void) const;
78 int Number(void) const;
79 void SetSelection( int n );
80 void SetStringSelection( const wxString &string );
81
82 // Text field functions
83 wxString GetValue(void) const ;
84 void SetValue(const wxString& value);
85
86 // Clipboard operations
87 void Copy(void);
88 void Cut(void);
89 void Paste(void);
90 void SetInsertionPoint(long pos);
91 void SetInsertionPointEnd(void);
92 long GetInsertionPoint(void) const ;
93 long GetLastPosition(void) const ;
94 void Replace(long from, long to, const wxString& value);
95 void Remove(long from, long to);
96 void SetSelection(long from, long to);
97 void SetEditable(bool editable);
98
99 private:
100
101 wxList m_clientData;
102
103 public:
104
105 bool m_alreadySent;
106 };
107
108 #endif // __GTKCOMBOBOXH__