]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/cocoa/textctrl.mm
Stub for wxRegion constructor taking a wxRect
[wxWidgets.git] / src / cocoa / textctrl.mm
... / ...
CommitLineData
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#include "wx/cocoa/string.h"
16
17#include "wx/cocoa/autorelease.h"
18
19#import <Foundation/NSString.h>
20#import <AppKit/NSTextField.h>
21
22IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl)
23BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
24END_EVENT_TABLE()
25WX_IMPLEMENT_COCOA_OWNER(wxTextCtrl,NSTextField,NSControl,NSView)
26
27bool wxTextCtrl::Create(wxWindow *parent, wxWindowID winid,
28 const wxString& value,
29 const wxPoint& pos,
30 const wxSize& size,
31 long style,
32 const wxValidator& validator,
33 const wxString& name)
34{
35 wxAutoNSAutoreleasePool pool;
36 if(!CreateControl(parent,winid,pos,size,style,validator,name))
37 return false;
38 m_cocoaNSView = NULL;
39 SetNSTextField([[NSTextField alloc] initWithFrame:NSMakeRect(0,0,30,30)]);
40 [m_cocoaNSView release];
41 [GetNSTextField() setStringValue:[NSString stringWithCString:value.c_str()]];
42 [GetNSControl() sizeToFit];
43 if(m_parent)
44 m_parent->CocoaAddChild(this);
45 return true;
46}
47
48wxTextCtrl::~wxTextCtrl()
49{
50 DisassociateNSTextField(m_cocoaNSView);
51}
52
53void wxTextCtrl::Cocoa_didChangeText(void)
54{
55}
56
57void wxTextCtrl::AppendText(wxString const&)
58{
59}
60
61void wxTextCtrl::SetEditable(bool)
62{
63}
64
65void wxTextCtrl::DiscardEdits()
66{
67}
68
69void wxTextCtrl::SetSelection(long, long)
70{
71}
72
73void wxTextCtrl::ShowPosition(long)
74{
75}
76
77void wxTextCtrl::SetInsertionPoint(long)
78{
79}
80
81void wxTextCtrl::SetInsertionPointEnd()
82{
83}
84
85void wxTextCtrl::Cut()
86{
87}
88
89void wxTextCtrl::Copy()
90{
91}
92
93void wxTextCtrl::Redo()
94{
95}
96
97void wxTextCtrl::Undo()
98{
99}
100
101void wxTextCtrl::Clear()
102{
103}
104
105void wxTextCtrl::Paste()
106{
107}
108
109void wxTextCtrl::Remove(long, long)
110{
111}
112
113void wxTextCtrl::Replace(long, long, wxString const&)
114{
115}
116
117void wxTextCtrl::SetValue(wxString const& value)
118{
119 wxAutoNSAutoreleasePool pool;
120 [GetNSTextField() setStringValue: wxNSStringWithWxString(value)];
121}
122
123void wxTextCtrl::WriteText(wxString const&)
124{
125}
126
127bool wxTextCtrl::IsEditable() const
128{
129 return true;
130}
131
132bool wxTextCtrl::IsModified() const
133{
134 return false;
135}
136
137wxString wxTextCtrl::GetLineText(long) const
138{
139 return wxEmptyString;
140}
141
142void wxTextCtrl::GetSelection(long*, long*) const
143{
144}
145
146bool wxTextCtrl::PositionToXY(long, long*, long*) const
147{
148 return false;
149}
150
151long wxTextCtrl::XYToPosition(long, long) const
152{
153 return 0;
154}
155
156int wxTextCtrl::GetLineLength(long) const
157{
158 return 0;
159}
160
161long wxTextCtrl::GetLastPosition() const
162{
163 return 0;
164}
165
166int wxTextCtrl::GetNumberOfLines() const
167{
168 return 0;
169}
170
171long wxTextCtrl::GetInsertionPoint() const
172{
173 return 0;
174}
175
176bool wxTextCtrl::CanRedo() const
177{
178 return false;
179}
180
181bool wxTextCtrl::CanUndo() const
182{
183 return false;
184}
185
186wxString wxTextCtrl::GetValue() const
187{
188 wxAutoNSAutoreleasePool pool;
189 return wxString([[GetNSTextField() stringValue] lossyCString]);
190}
191