1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        src/qt/textentry.cpp
3 // Author:      Peter Most, Mariano Reingart
4 // Copyright:   (c) 2010 wxWidgets dev team
5 // Licence:     wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
7 
8 // For compilers that support precompilation, includes "wx.h".
9 #include "wx/wxprec.h"
10 
11 #include "wx/textentry.h"
12 
wxTextEntry()13 wxTextEntry::wxTextEntry()
14 {
15 }
16 
WriteText(const wxString & WXUNUSED (text))17 void wxTextEntry::WriteText(const wxString& WXUNUSED(text))
18 {
19 }
20 
Remove(long from,long to)21 void wxTextEntry::Remove(long from, long to)
22 {
23     const long insertionPoint = GetInsertionPoint();
24     wxString string = GetValue();
25     string.erase(from, to - from);
26     SetValue(string);
27     SetInsertionPoint( std::min(insertionPoint, static_cast<long>(string.length())) );
28 }
29 
Copy()30 void wxTextEntry::Copy()
31 {
32 }
33 
Cut()34 void wxTextEntry::Cut()
35 {
36 }
37 
Paste()38 void wxTextEntry::Paste()
39 {
40 }
41 
Undo()42 void wxTextEntry::Undo()
43 {
44 }
45 
Redo()46 void wxTextEntry::Redo()
47 {
48 }
49 
CanUndo() const50 bool wxTextEntry::CanUndo() const
51 {
52     return false;
53 }
54 
CanRedo() const55 bool wxTextEntry::CanRedo() const
56 {
57     return false;
58 }
59 
SetInsertionPoint(long WXUNUSED (pos))60 void wxTextEntry::SetInsertionPoint(long WXUNUSED(pos))
61 {
62 }
63 
GetInsertionPoint() const64 long wxTextEntry::GetInsertionPoint() const
65 {
66     return 0;
67 }
68 
GetLastPosition() const69 long wxTextEntry::GetLastPosition() const
70 {
71     return GetValue().length();
72 }
73 
SetSelection(long WXUNUSED (from),long WXUNUSED (to))74 void wxTextEntry::SetSelection(long WXUNUSED(from), long WXUNUSED(to))
75 {
76     wxFAIL_MSG("wxTextEntry::SetSelection should be overriden");
77 }
78 
GetSelection(long * from,long * to) const79 void wxTextEntry::GetSelection(long *from, long *to) const
80 {
81     // no unified get selection method in Qt (overriden in textctrl & combobox)
82     // only called if no selection
83     // If the return values from and to are the same, there is no
84     // selection.
85     {
86         *from =
87         *to = GetInsertionPoint();
88     }
89 }
90 
IsEditable() const91 bool wxTextEntry::IsEditable() const
92 {
93     return false;
94 }
95 
SetEditable(bool WXUNUSED (editable))96 void wxTextEntry::SetEditable(bool WXUNUSED(editable))
97 {
98 }
99 
DoGetValue() const100 wxString wxTextEntry::DoGetValue() const
101 {
102     return wxString();
103 }
104 
DoSetValue(const wxString & WXUNUSED (value),int WXUNUSED (flags))105 void wxTextEntry::DoSetValue(const wxString &WXUNUSED(value), int WXUNUSED(flags))
106 {
107 }
108 
GetEditableWindow()109 wxWindow *wxTextEntry::GetEditableWindow()
110 {
111     return NULL;
112 }
113 
114