]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/textentrycmn.cpp
restore SetSelection(-1, -1) behaviour which was broken during wxTextEntry refactoring
[wxWidgets.git] / src / common / textentrycmn.cpp
index 67443dcdad8e91dfa18cd1784f1a2e8c6f3bf2bf..7324f6194c8ed8cded8842352b209c8eefb3dfc3 100644 (file)
 #if wxUSE_TEXTCTRL || wxUSE_COMBOBOX
 
 #ifndef WX_PRECOMP
+    #include "wx/window.h"
+    #include "wx/dataobj.h"
 #endif //WX_PRECOMP
 
 #include "wx/textentry.h"
+#include "wx/clipbrd.h"
 
 // ============================================================================
 // wxTextEntryBase implementation
@@ -97,7 +100,16 @@ bool wxTextEntryBase::CanCut() const
 
 bool wxTextEntryBase::CanPaste() const
 {
-    return IsEditable();
+    if ( IsEditable() )
+    {
+#if wxUSE_CLIPBOARD
+        // check if there is any text on the clipboard
+        if ( wxTheClipboard->IsSupported(wxDF_TEXT) )
+            return true;
+#endif // wxUSE_CLIPBOARD
+    }
+
+    return false;
 }
 
 #endif // wxUSE_TEXTCTRL || wxUSE_COMBOBOX