]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/cocoa/textctrl.mm
Keep order of nodes when wxHashMap is resized; this ensures
[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:MakeDefaultNSRect(size)]);
40 [m_cocoaNSView release];
41 [GetNSTextField() setStringValue:[NSString stringWithCString:value.c_str()]];
42 [GetNSControl() sizeToFit];
43 NSRect currentFrame = [m_cocoaNSView frame];
44 if(currentFrame.size.width < 70)
45 {
46 currentFrame.size.width = 70;
47 [m_cocoaNSView setFrame:currentFrame];
48 }
49 if(m_parent)
50 m_parent->CocoaAddChild(this);
51 SetInitialFrameRect(pos,size);
52 return true;
53}
54
55wxTextCtrl::~wxTextCtrl()
56{
57 DisassociateNSTextField(m_cocoaNSView);
58}
59
60void wxTextCtrl::Cocoa_didChangeText(void)
61{
62}
63
64void wxTextCtrl::AppendText(wxString const&)
65{
66}
67
68void wxTextCtrl::SetEditable(bool)
69{
70}
71
72void wxTextCtrl::DiscardEdits()
73{
74}
75
76void wxTextCtrl::SetSelection(long, long)
77{
78}
79
80void wxTextCtrl::ShowPosition(long)
81{
82}
83
84void wxTextCtrl::SetInsertionPoint(long)
85{
86}
87
88void wxTextCtrl::SetInsertionPointEnd()
89{
90}
91
92void wxTextCtrl::Cut()
93{
94}
95
96void wxTextCtrl::Copy()
97{
98}
99
100void wxTextCtrl::Redo()
101{
102}
103
104void wxTextCtrl::Undo()
105{
106}
107
108void wxTextCtrl::Clear()
109{
110}
111
112void wxTextCtrl::Paste()
113{
114}
115
116void wxTextCtrl::Remove(long, long)
117{
118}
119
120void wxTextCtrl::Replace(long, long, wxString const&)
121{
122}
123
124void wxTextCtrl::SetValue(wxString const& value)
125{
126 wxAutoNSAutoreleasePool pool;
127 [GetNSTextField() setStringValue: wxNSStringWithWxString(value)];
128}
129
130void wxTextCtrl::WriteText(wxString const&)
131{
132}
133
134bool wxTextCtrl::IsEditable() const
135{
136 return true;
137}
138
139bool wxTextCtrl::IsModified() const
140{
141 return false;
142}
143
144wxString wxTextCtrl::GetLineText(long) const
145{
146 return wxEmptyString;
147}
148
149void wxTextCtrl::GetSelection(long*, long*) const
150{
151}
152
153bool wxTextCtrl::PositionToXY(long, long*, long*) const
154{
155 return false;
156}
157
158long wxTextCtrl::XYToPosition(long, long) const
159{
160 return 0;
161}
162
163int wxTextCtrl::GetLineLength(long) const
164{
165 return 0;
166}
167
168long wxTextCtrl::GetLastPosition() const
169{
170 return 0;
171}
172
173int wxTextCtrl::GetNumberOfLines() const
174{
175 return 0;
176}
177
178long wxTextCtrl::GetInsertionPoint() const
179{
180 return 0;
181}
182
183bool wxTextCtrl::CanRedo() const
184{
185 return false;
186}
187
188bool wxTextCtrl::CanUndo() const
189{
190 return false;
191}
192
193wxString wxTextCtrl::GetValue() const
194{
195 wxAutoNSAutoreleasePool pool;
196 return wxString([[GetNSTextField() stringValue] lossyCString]);
197}
198