]>
Commit | Line | Data |
---|---|---|
fb896a32 DE |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: cocoa/textctrl.mm | |
3 | // Purpose: wxTextCtrl | |
4 | // Author: David Elliott | |
5 | // Modified by: | |
6 | // Created: 2003/03/16 | |
7 | // RCS-ID: $Id: | |
8 | // Copyright: (c) 2003 David Elliott | |
9 | // Licence: wxWindows license | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #include "wx/app.h" | |
13 | #include "wx/textctrl.h" | |
14 | ||
15 | #import <Foundation/NSString.h> | |
16 | #import <AppKit/NSTextField.h> | |
17 | ||
18 | IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl) | |
19 | BEGIN_EVENT_TABLE(wxTextCtrl, wxControl) | |
20 | END_EVENT_TABLE() | |
21 | WX_IMPLEMENT_COCOA_OWNER(wxTextCtrl,NSTextField,NSControl,NSView) | |
22 | ||
23 | bool wxTextCtrl::Create(wxWindow *parent, wxWindowID winid, | |
24 | const wxString& value, | |
25 | const wxPoint& pos, | |
26 | const wxSize& size, | |
27 | long style, | |
28 | const wxValidator& validator, | |
29 | const wxString& name) | |
30 | { | |
31 | if(!CreateControl(parent,winid,pos,size,style,validator,name)) | |
32 | return false; | |
33 | m_cocoaNSView = NULL; | |
34 | SetNSTextField([[NSTextField alloc] initWithFrame:NSMakeRect(0,0,30,30)]); | |
35 | [m_cocoaNSView release]; | |
36 | [GetNSTextField() setStringValue:[NSString stringWithCString:value.c_str()]]; | |
37 | [GetNSControl() sizeToFit]; | |
38 | if(m_parent) | |
39 | m_parent->CocoaAddChild(this); | |
40 | return true; | |
41 | } | |
42 | ||
43 | wxTextCtrl::~wxTextCtrl() | |
44 | { | |
45 | CocoaRemoveFromParent(); | |
46 | SetNSTextField(NULL); | |
47 | } | |
48 | ||
49 | void wxTextCtrl::Cocoa_didChangeText(void) | |
50 | { | |
51 | } | |
52 | ||
53 | void wxTextCtrl::AppendText(wxString const&) | |
54 | { | |
55 | } | |
56 | ||
57 | void wxTextCtrl::SetEditable(bool) | |
58 | { | |
59 | } | |
60 | ||
61 | void wxTextCtrl::DiscardEdits() | |
62 | { | |
63 | } | |
64 | ||
65 | void wxTextCtrl::SetSelection(long, long) | |
66 | { | |
67 | } | |
68 | ||
69 | void wxTextCtrl::ShowPosition(long) | |
70 | { | |
71 | } | |
72 | ||
73 | void wxTextCtrl::SetInsertionPoint(long) | |
74 | { | |
75 | } | |
76 | ||
77 | void wxTextCtrl::SetInsertionPointEnd() | |
78 | { | |
79 | } | |
80 | ||
81 | void wxTextCtrl::Cut() | |
82 | { | |
83 | } | |
84 | ||
85 | void wxTextCtrl::Copy() | |
86 | { | |
87 | } | |
88 | ||
89 | void wxTextCtrl::Redo() | |
90 | { | |
91 | } | |
92 | ||
93 | void wxTextCtrl::Undo() | |
94 | { | |
95 | } | |
96 | ||
97 | void wxTextCtrl::Clear() | |
98 | { | |
99 | } | |
100 | ||
101 | void wxTextCtrl::Paste() | |
102 | { | |
103 | } | |
104 | ||
105 | void wxTextCtrl::Remove(long, long) | |
106 | { | |
107 | } | |
108 | ||
109 | void wxTextCtrl::Replace(long, long, wxString const&) | |
110 | { | |
111 | } | |
112 | ||
113 | void wxTextCtrl::SetValue(wxString const&) | |
114 | { | |
115 | } | |
116 | ||
117 | void wxTextCtrl::WriteText(wxString const&) | |
118 | { | |
119 | } | |
120 | ||
121 | bool wxTextCtrl::IsEditable() const | |
122 | { | |
123 | return true; | |
124 | } | |
125 | ||
126 | bool wxTextCtrl::IsModified() const | |
127 | { | |
128 | return false; | |
129 | } | |
130 | ||
131 | wxString wxTextCtrl::GetLineText(long) const | |
132 | { | |
133 | return wxEmptyString; | |
134 | } | |
135 | ||
136 | void wxTextCtrl::GetSelection(long*, long*) const | |
137 | { | |
138 | } | |
139 | ||
140 | bool wxTextCtrl::PositionToXY(long, long*, long*) const | |
141 | { | |
142 | return false; | |
143 | } | |
144 | ||
145 | long wxTextCtrl::XYToPosition(long, long) const | |
146 | { | |
147 | return 0; | |
148 | } | |
149 | ||
150 | int wxTextCtrl::GetLineLength(long) const | |
151 | { | |
152 | return 0; | |
153 | } | |
154 | ||
155 | long wxTextCtrl::GetLastPosition() const | |
156 | { | |
157 | return 0; | |
158 | } | |
159 | ||
160 | int wxTextCtrl::GetNumberOfLines() const | |
161 | { | |
162 | return 0; | |
163 | } | |
164 | ||
165 | long wxTextCtrl::GetInsertionPoint() const | |
166 | { | |
167 | return 0; | |
168 | } | |
169 | ||
170 | bool wxTextCtrl::CanRedo() const | |
171 | { | |
172 | return false; | |
173 | } | |
174 | ||
175 | bool wxTextCtrl::CanUndo() const | |
176 | { | |
177 | return false; | |
178 | } | |
179 | ||
180 | wxString wxTextCtrl::GetValue() const | |
181 | { | |
182 | return wxEmptyString; | |
183 | } | |
184 |