]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/combobox.h
Added wxTopLevelWindow::HasFocus() as discussed.
[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
65571936 9// Licence: wxWindows licence
421a8431
DE
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __WX_COCOA_COMBOBOX_H__
13#define __WX_COCOA_COMBOBOX_H__
14
15#include "wx/textctrl.h"
16
17//#include "wx/cocoa/NSTableView.h"
18
19// ========================================================================
20// wxComboBox
21// ========================================================================
22class WXDLLEXPORT wxComboBox: public wxTextCtrl, public wxComboBoxBase //, protected wxCocoaNSTableView
23{
24 DECLARE_DYNAMIC_CLASS(wxComboBox)
25 DECLARE_EVENT_TABLE()
26// WX_DECLARE_COCOA_OWNER(NSComboBox,NSTextField,NSView)
27// ------------------------------------------------------------------------
28// initialization
29// ------------------------------------------------------------------------
30public:
31 wxComboBox() { }
32 wxComboBox(wxWindow *parent, wxWindowID winid,
33 const wxString& value = wxEmptyString,
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize,
36 int n = 0, const wxString choices[] = NULL,
37 long style = 0,
38 const wxValidator& validator = wxDefaultValidator,
39 const wxString& name = wxComboBoxNameStr)
40 {
41 Create(parent, winid, value, pos, size, n, choices, style, validator, name);
42 }
584ad2a3
MB
43 wxComboBox(wxWindow *parent, wxWindowID winid,
44 const wxString& value,
45 const wxPoint& pos,
46 const wxSize& size,
47 const wxArrayString& choices,
48 long style = 0,
49 const wxValidator& validator = wxDefaultValidator,
50 const wxString& name = wxComboBoxNameStr)
51 {
52 Create(parent, winid, value, pos, size, choices, style,
53 validator, name);
54 }
421a8431
DE
55
56 bool Create(wxWindow *parent, wxWindowID winid,
57 const wxString& value = wxEmptyString,
58 const wxPoint& pos = wxDefaultPosition,
59 const wxSize& size = wxDefaultSize,
60 int n = 0, const wxString choices[] = NULL,
61 long style = 0,
62 const wxValidator& validator = wxDefaultValidator,
63 const wxString& name = wxComboBoxNameStr);
584ad2a3
MB
64 bool Create(wxWindow *parent, wxWindowID winid,
65 const wxString& value,
66 const wxPoint& pos,
67 const wxSize& size,
68 const wxArrayString& choices,
69 long style = 0,
70 const wxValidator& validator = wxDefaultValidator,
71 const wxString& name = wxComboBoxNameStr);
421a8431
DE
72 virtual ~wxComboBox();
73
74// ------------------------------------------------------------------------
75// Cocoa callbacks
76// ------------------------------------------------------------------------
77protected:
78// ------------------------------------------------------------------------
79// Implementation
80// ------------------------------------------------------------------------
81public:
82 // wxCombobox methods
83 virtual void SetSelection(int);
84 // Overlapping methods
85 virtual wxString GetStringSelection();
e92ea629
DE
86 // other methods
87 virtual void SetStringSelection(const wxString& selection);
421a8431
DE
88 // wxItemContainer
89 virtual void Clear();
90 virtual void Delete(int);
91 virtual int GetCount() const;
92 virtual wxString GetString(int) const;
93 virtual void SetString(int, const wxString&);
94 virtual int FindString(const wxString&) const;
95 virtual void Select(int) {}
96 virtual int GetSelection() const;
97 virtual int DoAppend(const wxString&);
98 virtual int DoInsert(const wxString&, int);
99 virtual void DoSetItemClientData(int, void*);
100 virtual void* DoGetItemClientData(int) const;
101 virtual void DoSetItemClientObject(int, wxClientData*);
102 virtual wxClientData* DoGetItemClientObject(int) const;
103 // wxComboBoxBase pure virtuals
104 virtual wxString GetValue() const
105 { return wxTextCtrl::GetValue(); }
106 virtual void SetValue(const wxString& value)
107 { return wxTextCtrl::SetValue(value); }
108 virtual void Cut() { wxTextCtrl::Cut(); }
109 virtual void Copy() { wxTextCtrl::Copy(); }
110 virtual void Paste() { wxTextCtrl::Paste(); }
111 virtual void SetInsertionPoint(long pos)
112 { wxTextCtrl::SetInsertionPoint(pos); }
113 virtual void SetInsertionPointEnd()
114 { wxTextCtrl::SetInsertionPointEnd(); }
115 virtual long GetInsertionPoint() const
116 { return wxTextCtrl::GetInsertionPoint(); }
117 virtual long GetLastPosition() const
118 { return wxTextCtrl::GetLastPosition(); }
119 virtual void Replace(long from, long to, const wxString& value)
120 { wxTextCtrl::Replace(from,to,value); }
121 virtual void SetSelection(long from, long to)
122 { wxTextCtrl::SetSelection(from,to); }
123 virtual void SetEditable(bool editable)
124 { wxTextCtrl::SetEditable(editable); }
125};
126
127#endif // __WX_COCOA_COMBOBOX_H__