]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/combobox.h
setup.h for makefile builds
[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"
ac57418f 20
c801d85f 21#include "wx/object.h"
c801d85f
KB
22#include "wx/control.h"
23
24//-----------------------------------------------------------------------------
25// classes
26//-----------------------------------------------------------------------------
27
28class wxComboBox;
29
7f4dc78d
RR
30//-----------------------------------------------------------------------------
31// global data
32//-----------------------------------------------------------------------------
33
34extern const char* wxComboBoxNameStr;
35extern const char* wxEmptyString;
36
c801d85f
KB
37//-----------------------------------------------------------------------------
38// wxComboBox
39//-----------------------------------------------------------------------------
40
fd0eed64 41class wxComboBox : public wxControl
7f4dc78d
RR
42{
43 DECLARE_DYNAMIC_CLASS(wxComboBox)
44
fd0eed64 45public:
7f4dc78d 46
fd0eed64 47 inline wxComboBox() {}
debe6624 48 inline wxComboBox(wxWindow *parent, wxWindowID id,
7f4dc78d
RR
49 const wxString& value = wxEmptyString,
50 const wxPoint& pos = wxDefaultPosition,
51 const wxSize& size = wxDefaultSize,
c67daf87 52 int n = 0, const wxString choices[] = (const wxString *) NULL,
debe6624 53 long style = 0,
6de97a3b 54 const wxValidator& validator = wxDefaultValidator,
7f4dc78d
RR
55 const wxString& name = wxComboBoxNameStr)
56 {
6de97a3b 57 Create(parent, id, value, pos, size, n, choices, style, validator, name);
7f4dc78d 58 }
fd0eed64 59 ~wxComboBox();
debe6624 60 bool Create(wxWindow *parent, wxWindowID id,
7f4dc78d
RR
61 const wxString& value = wxEmptyString,
62 const wxPoint& pos = wxDefaultPosition,
63 const wxSize& size = wxDefaultSize,
c67daf87 64 int n = 0, const wxString choices[] = (const wxString *) NULL,
debe6624 65 long style = 0,
6de97a3b 66 const wxValidator& validator = wxDefaultValidator,
7f4dc78d
RR
67 const wxString& name = wxComboBoxNameStr);
68
7f4dc78d 69 void Append( const wxString &item );
fd0eed64
RR
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();
debe6624 79 void Delete( int n );
fd0eed64 80
7f4dc78d 81 int FindString( const wxString &item );
fd0eed64 82 int GetSelection() const;
debe6624 83 wxString GetString( int n ) const;
fd0eed64
RR
84 wxString GetStringSelection() const;
85 int Number() const;
debe6624 86 void SetSelection( int n );
47908e25 87 void SetStringSelection( const wxString &string );
debe6624 88
fd0eed64 89 wxString GetValue() const;
7f4dc78d
RR
90 void SetValue(const wxString& value);
91
fd0eed64
RR
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 );
868a2826 103
b4071e91 104 void OnSize( wxSizeEvent &event );
fb9e1bc2 105 void OnChar( wxKeyEvent &event );
868a2826 106
fd0eed64 107// implementation
868a2826 108
fd0eed64
RR
109 bool m_alreadySent;
110 wxList m_clientDataList;
f5e27805 111 wxList m_clientObjectList;
b4071e91 112
fd0eed64
RR
113 void AppendCommon( const wxString &item );
114 GtkWidget* GetConnectWidget();
115 bool IsOwnGtkWindow( GdkWindow *window );
116 void ApplyWidgetStyle();
47908e25 117
b4071e91 118 DECLARE_EVENT_TABLE()
7f4dc78d
RR
119};
120
ac57418f
RR
121#endif
122
123 // __GTKCOMBOBOXH__