]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/textctrl.cpp
Added imaggif.h, imaggif.cpp (wxImage GIF-reading support); candidate
[wxWidgets.git] / src / gtk1 / textctrl.cpp
index 88aae9151827a05c35dcab2453094e52beb5b55e..4da56a23e5cadb20ca2770c2fe5aad4fa35b2c48 100644 (file)
@@ -674,7 +674,7 @@ void wxTextCtrl::Cut()
 {
     wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
 
-#if (GTK_MINOR_VERSION == 1)
+#if (GTK_MINOR_VERSION > 0)
     gtk_editable_cut_clipboard( GTK_EDITABLE(m_text) );
 #else
     gtk_editable_cut_clipboard( GTK_EDITABLE(m_text), 0 );
@@ -685,7 +685,7 @@ void wxTextCtrl::Copy()
 {
     wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
 
-#if (GTK_MINOR_VERSION == 1)
+#if (GTK_MINOR_VERSION > 0)
     gtk_editable_copy_clipboard( GTK_EDITABLE(m_text) );
 #else
     gtk_editable_copy_clipboard( GTK_EDITABLE(m_text), 0 );
@@ -696,13 +696,78 @@ void wxTextCtrl::Paste()
 {
     wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
 
-#if (GTK_MINOR_VERSION == 1)
+#if (GTK_MINOR_VERSION > 0)
     gtk_editable_paste_clipboard( GTK_EDITABLE(m_text) );
 #else
     gtk_editable_paste_clipboard( GTK_EDITABLE(m_text), 0 );
 #endif
 }
 
+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
+    wxFAIL_MSG( "wxTextCtrl::Undo not implemented" );
+}
+
+void wxTextCtrl::Redo()
+{
+    // TODO
+    wxFAIL_MSG( "wxTextCtrl::Redo not implemented" );
+}
+
+bool wxTextCtrl::CanUndo() const
+{
+    // TODO
+    wxFAIL_MSG( "wxTextCtrl::CanUndo not implemented" );
+    return FALSE;
+}
+
+bool wxTextCtrl::CanRedo() const
+{
+    // TODO
+    wxFAIL_MSG( "wxTextCtrl::CanRedo not implemented" );
+    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;
+    wxFAIL_MSG( "wxTextCtrl::GetSelection not implemented" );
+}
+
+bool wxTextCtrl::IsEditable() const
+{
+    // TODO
+    wxFAIL_MSG( "wxTextCtrl::IsEditable not implemented" );
+    return FALSE;
+}
+
 void wxTextCtrl::Clear()
 {
     SetValue( "" );