]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/combobox.h
As small as possible reorganization within wxDateTime to please PCH in DLL build...
[wxWidgets.git] / include / wx / cocoa / combobox.h
CommitLineData
421a8431
DE
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/cocoa/combobox.h
3// Purpose: wxComboBox class
4// Author: David Elliott
5// Modified by:
6// Created: 2003/07/14
7// RCS-ID: $Id$
8// Copyright: (c) 2003 David Elliott
7d8268a1 9// Licence: wxWindows licence
421a8431
DE
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __WX_COCOA_COMBOBOX_H__
13#define __WX_COCOA_COMBOBOX_H__
14
421a8431
DE
15//#include "wx/cocoa/NSTableView.h"
16
17// ========================================================================
18// wxComboBox
19// ========================================================================
20class WXDLLEXPORT wxComboBox: public wxTextCtrl, public wxComboBoxBase //, protected wxCocoaNSTableView
21{
22 DECLARE_DYNAMIC_CLASS(wxComboBox)
23 DECLARE_EVENT_TABLE()
24// WX_DECLARE_COCOA_OWNER(NSComboBox,NSTextField,NSView)
25// ------------------------------------------------------------------------
26// initialization
27// ------------------------------------------------------------------------
28public:
29 wxComboBox() { }
30 wxComboBox(wxWindow *parent, wxWindowID winid,
31 const wxString& value = wxEmptyString,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize,
34 int n = 0, const wxString choices[] = NULL,
35 long style = 0,
36 const wxValidator& validator = wxDefaultValidator,
37 const wxString& name = wxComboBoxNameStr)
38 {
39 Create(parent, winid, value, pos, size, n, choices, style, validator, name);
40 }
584ad2a3
MB
41 wxComboBox(wxWindow *parent, wxWindowID winid,
42 const wxString& value,
43 const wxPoint& pos,
44 const wxSize& size,
45 const wxArrayString& choices,
46 long style = 0,
47 const wxValidator& validator = wxDefaultValidator,
48 const wxString& name = wxComboBoxNameStr)
49 {
50 Create(parent, winid, value, pos, size, choices, style,
51 validator, name);
52 }
421a8431
DE
53
54 bool Create(wxWindow *parent, wxWindowID winid,
55 const wxString& value = wxEmptyString,
56 const wxPoint& pos = wxDefaultPosition,
57 const wxSize& size = wxDefaultSize,
58 int n = 0, const wxString choices[] = NULL,
59 long style = 0,
60 const wxValidator& validator = wxDefaultValidator,
61 const wxString& name = wxComboBoxNameStr);
584ad2a3
MB
62 bool Create(wxWindow *parent, wxWindowID winid,
63 const wxString& value,
64 const wxPoint& pos,
65 const wxSize& size,
66 const wxArrayString& choices,
67 long style = 0,
68 const wxValidator& validator = wxDefaultValidator,
69 const wxString& name = wxComboBoxNameStr);
421a8431
DE
70 virtual ~wxComboBox();
71
72// ------------------------------------------------------------------------
73// Cocoa callbacks
74// ------------------------------------------------------------------------
75protected:
76// ------------------------------------------------------------------------
77// Implementation
78// ------------------------------------------------------------------------
79public:
80 // wxCombobox methods
81 virtual void SetSelection(int);
82 // Overlapping methods
83 virtual wxString GetStringSelection();
e92ea629
DE
84 // other methods
85 virtual void SetStringSelection(const wxString& selection);
421a8431
DE
86 // wxItemContainer
87 virtual void Clear();
88 virtual void Delete(int);
89 virtual int GetCount() const;
90 virtual wxString GetString(int) const;
91 virtual void SetString(int, const wxString&);
92 virtual int FindString(const wxString&) const;
93 virtual void Select(int) {}
94 virtual int GetSelection() const;
95 virtual int DoAppend(const wxString&);
96 virtual int DoInsert(const wxString&, int);
97 virtual void DoSetItemClientData(int, void*);
98 virtual void* DoGetItemClientData(int) const;
99 virtual void DoSetItemClientObject(int, wxClientData*);
100 virtual wxClientData* DoGetItemClientObject(int) const;
101 // wxComboBoxBase pure virtuals
102 virtual wxString GetValue() const
103 { return wxTextCtrl::GetValue(); }
104 virtual void SetValue(const wxString& value)
105 { return wxTextCtrl::SetValue(value); }
106 virtual void Cut() { wxTextCtrl::Cut(); }
107 virtual void Copy() { wxTextCtrl::Copy(); }
108 virtual void Paste() { wxTextCtrl::Paste(); }
109 virtual void SetInsertionPoint(long pos)
110 { wxTextCtrl::SetInsertionPoint(pos); }
111 virtual void SetInsertionPointEnd()
112 { wxTextCtrl::SetInsertionPointEnd(); }
113 virtual long GetInsertionPoint() const
114 { return wxTextCtrl::GetInsertionPoint(); }
7d8268a1 115 virtual wxTextPos GetLastPosition() const
421a8431
DE
116 { return wxTextCtrl::GetLastPosition(); }
117 virtual void Replace(long from, long to, const wxString& value)
118 { wxTextCtrl::Replace(from,to,value); }
119 virtual void SetSelection(long from, long to)
120 { wxTextCtrl::SetSelection(from,to); }
121 virtual void SetEditable(bool editable)
122 { wxTextCtrl::SetEditable(editable); }
150e31d2
JS
123 virtual bool IsEditable() const
124 { return !HasFlag(wxCB_READONLY); }
125 virtual void Undo()
126 { wxTextCtrl::Undo(); }
127 virtual void Redo()
128 { wxTextCtrl::Redo(); }
129 virtual void SelectAll()
130 { wxTextCtrl::SelectAll(); }
131 virtual bool CanCopy() const
132 { return wxTextCtrl::CanCopy(); }
b6e8e241 133 virtual bool CanCut() const
150e31d2
JS
134 { return wxTextCtrl::CanCut(); }
135 virtual bool CanPaste() const
136 { return wxTextCtrl::CanPaste(); }
137 virtual bool CanUndo() const
138 { return wxTextCtrl::CanUndo(); }
139 virtual bool CanRedo() const
140 { return wxTextCtrl::CanRedo(); }
421a8431
DE
141};
142
143#endif // __WX_COCOA_COMBOBOX_H__