]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stubs/textctrl.cpp
Chnaged text id for clipboard to "text/plain"
[wxWidgets.git] / src / stubs / textctrl.cpp
index 6083ace113eb3907d59ff34cb95513b1e75af78d..a43a38acc97c13df0c17439ce3902020413b8975 100644 (file)
@@ -211,6 +211,11 @@ void wxTextCtrl::WriteText(const wxString& text)
     // TODO write text to control
 }
 
+void wxTextCtrl::AppendText(const wxString& text)
+{
+    // TODO append text to control
+}
+
 void wxTextCtrl::Clear()
 {
     // TODO
@@ -262,10 +267,65 @@ wxString wxTextCtrl::GetLineText(long lineNo) const
     return wxString("");
 }
 
-/*
- * Text item
- */
+bool wxTextCtrl::CanCopy() const
+{
+    // Can copy if there's a selection
+    long from, to;
+    GetSelection(& from, & to);
+    return (from != to) ;
+}
+
+bool wxTextCtrl::CanCut() const
+{
+    // Can cut if there's a selection
+    long from, to;
+    GetSelection(& from, & to);
+    return (from != to) ;
+}
+
+bool wxTextCtrl::CanPaste() const
+{
+    return IsEditable() ;
+}
+
+// Undo/redo
+void wxTextCtrl::Undo()
+{
+    // TODO
+}
+
+void wxTextCtrl::Redo()
+{
+    // TODO
+}
+
+bool wxTextCtrl::CanUndo() const
+{
+    // TODO
+    return FALSE;
+}
+
+bool wxTextCtrl::CanRedo() const
+{
+    // TODO
+    return FALSE;
+}
+
+// If the return values from and to are the same, there is no
+// selection.
+void wxTextCtrl::GetSelection(long* from, long* to) const
+{
+    // TODO
+    *from = 0;
+    *to = 0;
+}
+
+bool wxTextCtrl::IsEditable() const
+{
+    // TODO
+    return FALSE;
+}
+
 void wxTextCtrl::Command(wxCommandEvent & event)
 {
     SetValue (event.GetString());
@@ -336,7 +396,7 @@ int wxTextCtrl::overflow(int c)
   txt[plen] = (char)c;     // append c
   txt[plen+xtra] = '\0';   // append '\0' or overwrite c
     // If the put area already contained \0, output will be truncated there
-  WriteText(txt);
+  AppendText(txt);
     delete[] txt;
   }
 
@@ -390,7 +450,7 @@ int wxTextCtrl::underflow()
 
 wxTextCtrl& wxTextCtrl::operator<<(const wxString& s)
 {
-    WriteText(s);
+    AppendText(s);
     return *this;
 }
 
@@ -398,7 +458,7 @@ wxTextCtrl& wxTextCtrl::operator<<(float f)
 {
     wxString str;
     str.Printf("%.2f", f);
-    WriteText(str);
+    AppendText(str);
     return *this;
 }
 
@@ -406,7 +466,7 @@ wxTextCtrl& wxTextCtrl::operator<<(double d)
 {
     wxString str;
     str.Printf("%.2f", d);
-    WriteText(str);
+    AppendText(str);
     return *this;
 }
 
@@ -414,7 +474,7 @@ wxTextCtrl& wxTextCtrl::operator<<(int i)
 {
     wxString str;
     str.Printf("%d", i);
-    WriteText(str);
+    AppendText(str);
     return *this;
 }
 
@@ -422,7 +482,7 @@ wxTextCtrl& wxTextCtrl::operator<<(long i)
 {
     wxString str;
     str.Printf("%ld", i);
-    WriteText(str);
+    AppendText(str);
     return *this;
 }
 
@@ -432,7 +492,7 @@ wxTextCtrl& wxTextCtrl::operator<<(const char c)
 
     buf[0] = c;
     buf[1] = 0;
-    WriteText(buf);
+    AppendText(buf);
     return *this;
 }