]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/combobox.h
A bit more DnD and clipbrd updates
[wxWidgets.git] / include / wx / gtk1 / 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
fd0eed64 40class wxComboBox : public wxControl
7f4dc78d
RR
41{
42 DECLARE_DYNAMIC_CLASS(wxComboBox)
43
fd0eed64 44public:
7f4dc78d 45
fd0eed64 46 inline wxComboBox() {}
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 }
fd0eed64 58 ~wxComboBox();
debe6624 59 bool Create(wxWindow *parent, wxWindowID id,
7f4dc78d
RR
60 const wxString& value = wxEmptyString,
61 const wxPoint& pos = wxDefaultPosition,
62 const wxSize& size = wxDefaultSize,
c67daf87 63 int n = 0, const wxString choices[] = (const wxString *) NULL,
debe6624 64 long style = 0,
6de97a3b 65 const wxValidator& validator = wxDefaultValidator,
7f4dc78d
RR
66 const wxString& name = wxComboBoxNameStr);
67
7f4dc78d 68 void Append( const wxString &item );
fd0eed64
RR
69 void Append( const wxString &item, void* clientData );
70 void Append( const wxString &item, wxClientData* clientData );
71
72 void SetClientData( int n, void* clientData );
73 void* GetClientData( int n );
74 void SetClientObject( int n, wxClientData* clientData );
75 wxClientData* GetClientObject( int n );
76
77 void Clear();
debe6624 78 void Delete( int n );
fd0eed64 79
7f4dc78d 80 int FindString( const wxString &item );
fd0eed64 81 int GetSelection() const;
debe6624 82 wxString GetString( int n ) const;
fd0eed64
RR
83 wxString GetStringSelection() const;
84 int Number() const;
debe6624 85 void SetSelection( int n );
47908e25 86 void SetStringSelection( const wxString &string );
debe6624 87
fd0eed64 88 wxString GetValue() const;
7f4dc78d
RR
89 void SetValue(const wxString& value);
90
fd0eed64
RR
91 void Copy();
92 void Cut();
93 void Paste();
94 void SetInsertionPoint( long pos );
95 void SetInsertionPointEnd();
96 long GetInsertionPoint() const;
97 long GetLastPosition() const;
98 void Replace( long from, long to, const wxString& value );
99 void Remove( long from, long to );
100 void SetSelection( long from, long to );
101 void SetEditable( bool editable );
868a2826 102
b4071e91 103 void OnSize( wxSizeEvent &event );
868a2826 104
fd0eed64 105// implementation
868a2826 106
fd0eed64
RR
107 bool m_alreadySent;
108 wxList m_clientDataList;
f5e27805 109 wxList m_clientObjectList;
b4071e91 110
fd0eed64
RR
111 void AppendCommon( const wxString &item );
112 GtkWidget* GetConnectWidget();
113 bool IsOwnGtkWindow( GdkWindow *window );
114 void ApplyWidgetStyle();
47908e25 115
b4071e91 116 DECLARE_EVENT_TABLE()
7f4dc78d
RR
117};
118
c801d85f 119#endif // __GTKCOMBOBOXH__