]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/combobox.h
wxWave class for wxGTK (linux)
[wxWidgets.git] / include / wx / gtk / combobox.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: combobox.h
3// Purpose:
4// Author: Robert Roebling
5// Created: 01/02/97
5ebd1fb2 6// Id: $Id$
dbf858b5 7// Copyright: (c) 1998 Robert Roebling
c801d85f
KB
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
27class wxComboBox;
28
7f4dc78d
RR
29//-----------------------------------------------------------------------------
30// global data
31//-----------------------------------------------------------------------------
32
33extern const char* wxComboBoxNameStr;
34extern const char* wxEmptyString;
35
c801d85f
KB
36//-----------------------------------------------------------------------------
37// wxComboBox
38//-----------------------------------------------------------------------------
39
7f4dc78d
RR
40class wxComboBox: public wxControl
41{
42 DECLARE_DYNAMIC_CLASS(wxComboBox)
43
44 public:
45 inline wxComboBox(void) {}
46
debe6624 47 inline wxComboBox(wxWindow *parent, wxWindowID id,
7f4dc78d
RR
48 const wxString& value = wxEmptyString,
49 const wxPoint& pos = wxDefaultPosition,
50 const wxSize& size = wxDefaultSize,
c67daf87 51 int n = 0, const wxString choices[] = (const wxString *) NULL,
debe6624 52 long style = 0,
6de97a3b 53 const wxValidator& validator = wxDefaultValidator,
7f4dc78d
RR
54 const wxString& name = wxComboBoxNameStr)
55 {
6de97a3b 56 Create(parent, id, value, pos, size, n, choices, style, validator, name);
7f4dc78d 57 }
debe6624 58 bool Create(wxWindow *parent, wxWindowID id,
7f4dc78d
RR
59 const wxString& value = wxEmptyString,
60 const wxPoint& pos = wxDefaultPosition,
61 const wxSize& size = wxDefaultSize,
c67daf87 62 int n = 0, const wxString choices[] = (const wxString *) NULL,
debe6624 63 long style = 0,
6de97a3b 64 const wxValidator& validator = wxDefaultValidator,
7f4dc78d
RR
65 const wxString& name = wxComboBoxNameStr);
66
7f4dc78d
RR
67 void Clear(void);
68 void Append( const wxString &item );
69 void Append( const wxString &item, char* clientData );
debe6624 70 void Delete( int n );
7f4dc78d 71 int FindString( const wxString &item );
debe6624
JS
72 char* GetClientData( int n );
73 void SetClientData( int n, char * clientData );
7f4dc78d 74 int GetSelection(void) const;
debe6624 75 wxString GetString( int n ) const;
7f4dc78d
RR
76 wxString GetStringSelection(void) const;
77 int Number(void) const;
debe6624 78 void SetSelection( int n );
47908e25 79 void SetStringSelection( const wxString &string );
debe6624 80
7f4dc78d
RR
81 wxString GetValue(void) const ;
82 void SetValue(const wxString& value);
83
7f4dc78d
RR
84 void Copy(void);
85 void Cut(void);
86 void Paste(void);
debe6624 87 void SetInsertionPoint(long pos);
7f4dc78d
RR
88 void SetInsertionPointEnd(void);
89 long GetInsertionPoint(void) const ;
90 long GetLastPosition(void) const ;
debe6624
JS
91 void Replace(long from, long to, const wxString& value);
92 void Remove(long from, long to);
93 void SetSelection(long from, long to);
94 void SetEditable(bool editable);
868a2826
RR
95
96 void SetFont( const wxFont &font );
b4071e91 97 void OnSize( wxSizeEvent &event );
fc54776e 98 void SetBackgroundColour( const wxColour &colour );
868a2826
RR
99
100 // implementation
debe6624 101
868a2826
RR
102 bool m_alreadySent;
103
7f4dc78d
RR
104 private:
105
47908e25 106 wxList m_clientData;
b4071e91
RR
107
108 GtkWidget* GetConnectWidget(void);
109 bool IsOwnGtkWindow( GdkWindow *window );
47908e25 110
b4071e91 111 DECLARE_EVENT_TABLE()
7f4dc78d
RR
112};
113
c801d85f 114#endif // __GTKCOMBOBOXH__