]>
git.saurik.com Git - wxWidgets.git/blob - src/qt/textctrl.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "textctrl.h"
15 #include "wx/textctrl.h"
18 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
22 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl
,wxControl
)
25 BEGIN_EVENT_TABLE(wxTextCtrl
, wxControl
)
26 // EVT_CHAR(wxTextCtrl::OnChar)
29 wxTextCtrl::wxTextCtrl(void) : streambuf()
37 wxTextCtrl::wxTextCtrl( wxWindow
*parent
, wxWindowID id
, const wxString
&value
,
38 const wxPoint
&pos
, const wxSize
&size
,
39 int style
, const wxString
&name
) : streambuf()
45 Create( parent
, id
, value
, pos
, size
, style
, name
);
48 bool wxTextCtrl::Create( wxWindow
*parent
, wxWindowID id
, const wxString
&value
,
49 const wxPoint
&pos
, const wxSize
&size
,
50 int style
, const wxString
&name
)
55 wxString
wxTextCtrl::GetValue(void) const
60 void wxTextCtrl::SetValue( const wxString
&value
)
64 void wxTextCtrl::WriteText( const wxString
&text
)
68 bool wxTextCtrl::LoadFile( const wxString
&WXUNUSED(file
) )
73 bool wxTextCtrl::SaveFile( const wxString
&WXUNUSED(file
) )
79 wxString wxTextCtrl::GetLineText( long lineNo ) const
84 void wxTextCtrl::OnDropFiles( wxDropFilesEvent &event )
88 long wxTextCtrl::PositionToXY( long pos, long *x, long *y ) const
92 long wxTextCtrl::XYToPosition( long x, long y )
96 int wxTextCtrl::GetNumberOfLines(void)
101 void wxTextCtrl::SetInsertionPoint( long pos
)
105 void wxTextCtrl::SetInsertionPointEnd(void)
109 void wxTextCtrl::SetEditable( bool editable
)
113 void wxTextCtrl::SetSelection( long from
, long to
)
117 void wxTextCtrl::ShowPosition( long WXUNUSED(pos
) )
121 long wxTextCtrl::GetInsertionPoint(void) const
125 long wxTextCtrl::GetLastPosition(void) const
129 void wxTextCtrl::Remove( long from
, long to
)
133 void wxTextCtrl::Replace( long from
, long to
, const wxString
&value
)
137 void wxTextCtrl::Cut(void)
141 void wxTextCtrl::Copy(void)
145 void wxTextCtrl::Paste(void)
149 void wxTextCtrl::Delete(void)
153 void wxTextCtrl::OnChar( wxKeyEvent
&WXUNUSED(event
) )
157 int wxTextCtrl::overflow( int WXUNUSED(c
) )
159 int len
= pptr() - pbase();
160 char *txt
= new char[len
+1];
161 strncpy(txt
, pbase(), len
);
164 setp(pbase(), epptr());
169 int wxTextCtrl::sync(void)
171 int len
= pptr() - pbase();
172 char *txt
= new char[len
+1];
173 strncpy(txt
, pbase(), len
);
176 setp(pbase(), epptr());
181 int wxTextCtrl::underflow(void)
186 wxTextCtrl
& wxTextCtrl::operator<<(const wxString
& s
)
192 wxTextCtrl
& wxTextCtrl::operator<<(float f
)
194 static char buf
[100];
195 sprintf(buf
, "%.2f", f
);
200 wxTextCtrl
& wxTextCtrl::operator<<(double d
)
202 static char buf
[100];
203 sprintf(buf
, "%.2f", d
);
208 wxTextCtrl
& wxTextCtrl::operator<<(int i
)
210 static char buf
[100];
211 sprintf(buf
, "%i", i
);
216 wxTextCtrl
& wxTextCtrl::operator<<(long i
)
218 static char buf
[100];
219 sprintf(buf
, "%ld", i
);
224 wxTextCtrl
& wxTextCtrl::operator<<(const char c
)