]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/carbon/combobox.h
typo
[wxWidgets.git] / include / wx / mac / carbon / combobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/carbon/combobox.h
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
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_COMBOBOX_H_
13 #define _WX_COMBOBOX_H_
14
15 #include "wx/choice.h"
16
17 WXDLLEXPORT_DATA(extern const wxChar) wxComboBoxNameStr[];
18
19 // forward declaration of private implementation classes
20
21 class wxComboBoxText ;
22 class wxComboBoxChoice ;
23
24 // Combobox item
25 class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase
26 {
27 DECLARE_DYNAMIC_CLASS(wxComboBox)
28
29 public:
30 wxComboBox() ;
31 virtual ~wxComboBox();
32
33 // forward these functions to all subcontrols
34 virtual bool Enable(bool enable = true);
35 virtual bool Show(bool show = true);
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 ;
86 int GetCurrentSelection() const { return GetSelection(); }
87 virtual void SetSelection(int n);
88 virtual int FindString(const wxString& s, bool bCase = false) const;
89 virtual wxString GetString(int n) const ;
90 virtual wxString GetStringSelection() const ;
91 virtual void SetString(int n, const wxString& s) ;
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 ;
104 virtual wxTextPos GetLastPosition() const ;
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);
109 virtual int GetCount() const ;
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
123 wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
124
125 wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST
126
127 WX_DECLARE_CONTROL_CONTAINER();
128 protected:
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
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
144 wxComboBoxText* m_text;
145 wxComboBoxChoice* m_choice;
146
147 DECLARE_EVENT_TABLE()
148 };
149
150 #endif
151 // _WX_COMBOBOX_H_