]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/carbon/combobox.h
typo
[wxWidgets.git] / include / wx / mac / carbon / combobox.h
CommitLineData
8cf73271 1/////////////////////////////////////////////////////////////////////////////
853dcc57 2// Name: wx/mac/carbon/combobox.h
8cf73271
SC
3// Purpose: wxComboBox class
4// Author: Stefan Csomor
5// Modified by:
6// Created: 1998-01-01
7// RCS-ID: $Id$
8// Copyright: (c) Stefan Csomor
65571936 9// Licence: wxWindows licence
8cf73271
SC
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_COMBOBOX_H_
13#define _WX_COMBOBOX_H_
14
8cf73271
SC
15#include "wx/choice.h"
16
63ec432b 17WXDLLEXPORT_DATA(extern const wxChar) wxComboBoxNameStr[];
8cf73271 18
18274a51
SC
19// forward declaration of private implementation classes
20
21class wxComboBoxText ;
22class wxComboBoxChoice ;
23
8cf73271
SC
24// Combobox item
25class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase
26{
27 DECLARE_DYNAMIC_CLASS(wxComboBox)
28
29 public:
1de43645 30 wxComboBox() ;
8cf73271 31 virtual ~wxComboBox();
8cf73271
SC
32
33 // forward these functions to all subcontrols
7d8268a1
WS
34 virtual bool Enable(bool enable = true);
35 virtual bool Show(bool show = true);
8cf73271
SC
36
37 // callback functions
38 virtual void DelegateTextChanged( const wxString& value );
39 virtual void DelegateChoice( const wxString& value );
40
41 inline wxComboBox(wxWindow *parent, wxWindowID id,
42 const wxString& value = wxEmptyString,
43 const wxPoint& pos = wxDefaultPosition,
44 const wxSize& size = wxDefaultSize,
45 int n = 0, const wxString choices[] = NULL,
46 long style = 0,
47 const wxValidator& validator = wxDefaultValidator,
48 const wxString& name = wxComboBoxNameStr)
49 {
50 Create(parent, id, value, pos, size, n, choices, style, validator, name);
51 }
52 inline wxComboBox(wxWindow *parent, wxWindowID id,
53 const wxString& value,
54 const wxPoint& pos,
55 const wxSize& size,
56 const wxArrayString& choices,
57 long style = 0,
58 const wxValidator& validator = wxDefaultValidator,
59 const wxString& name = wxComboBoxNameStr)
60 {
61 Create(parent, id, value, pos, size, choices, style, validator, name);
62 }
63
64 bool Create(wxWindow *parent, wxWindowID id,
65 const wxString& value = wxEmptyString,
66 const wxPoint& pos = wxDefaultPosition,
67 const wxSize& size = wxDefaultSize,
68 int n = 0, const wxString choices[] = NULL,
69 long style = 0,
70 const wxValidator& validator = wxDefaultValidator,
71 const wxString& name = wxComboBoxNameStr);
72 bool Create(wxWindow *parent, wxWindowID id,
73 const wxString& value,
74 const wxPoint& pos,
75 const wxSize& size,
76 const wxArrayString& choices,
77 long style = 0,
78 const wxValidator& validator = wxDefaultValidator,
79 const wxString& name = wxComboBoxNameStr);
80
81 // List functions
82 virtual void Delete(int n);
83 virtual void Clear();
84
85 virtual int GetSelection() const ;
befb44cf 86 int GetCurrentSelection() const { return GetSelection(); }
8cf73271 87 virtual void SetSelection(int n);
853dcc57 88 virtual int FindString(const wxString& s, bool bCase = false) const;
8cf73271
SC
89 virtual wxString GetString(int n) const ;
90 virtual wxString GetStringSelection() const ;
91 virtual void SetString(int n, const wxString& s) ;
8cf73271
SC
92
93 // Text field functions
94 virtual wxString GetValue() const ;
95 virtual void SetValue(const wxString& value);
96
97 // Clipboard operations
98 virtual void Copy();
99 virtual void Cut();
100 virtual void Paste();
101 virtual void SetInsertionPoint(long pos);
102 virtual void SetInsertionPointEnd();
103 virtual long GetInsertionPoint() const ;
7d8268a1 104 virtual wxTextPos GetLastPosition() const ;
8cf73271
SC
105 virtual void Replace(long from, long to, const wxString& value);
106 virtual void Remove(long from, long to);
107 virtual void SetSelection(long from, long to);
108 virtual void SetEditable(bool editable);
9a159a1d 109 virtual int GetCount() const ;
150e31d2
JS
110
111 virtual bool IsEditable() const ;
112
113 virtual void Undo() ;
114 virtual void Redo() ;
115 virtual void SelectAll() ;
116
117 virtual bool CanCopy() const ;
118 virtual bool CanCut() const ;
119 virtual bool CanPaste() const ;
120 virtual bool CanUndo() const ;
121 virtual bool CanRedo() const ;
122
336a6aba 123 wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
8cf73271
SC
124
125 wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST
126
1de43645 127 WX_DECLARE_CONTROL_CONTAINER();
8cf73271 128protected:
6f02a879
VZ
129 // override the base class virtuals involved in geometry calculations
130 virtual wxSize DoGetBestSize() const;
131 virtual void DoMoveWindow(int x, int y, int width, int height);
132
8cf73271
SC
133 virtual int DoAppend(const wxString& item) ;
134 virtual int DoInsert(const wxString& item, int pos) ;
135
136 virtual void DoSetItemClientData(int n, void* clientData) ;
137 virtual void* DoGetItemClientData(int n) const ;
138 virtual void DoSetItemClientObject(int n, wxClientData* clientData) ;
139 virtual wxClientData* DoGetItemClientObject(int n) const ;
140
141 void FreeData();
142
143 // the subcontrols
18274a51
SC
144 wxComboBoxText* m_text;
145 wxComboBoxChoice* m_choice;
1de43645
SC
146
147 DECLARE_EVENT_TABLE()
8cf73271
SC
148};
149
150#endif
151 // _WX_COMBOBOX_H_