+// ----------------------------------------------------------------------------
+// clipboard stuff
+// ----------------------------------------------------------------------------
+
+bool wxTextCtrlBase::CanCopy() const
+{
+ // can copy if there's a selection
+ long from, to;
+ GetSelection(&from, &to);
+ return from != to;
+}
+
+bool wxTextCtrlBase::CanCut() const
+{
+ // can cut if there's a selection and if we're not read only
+ return CanCopy() && IsEditable();
+}
+
+bool wxTextCtrlBase::CanPaste() const
+{
+ // can paste if we are not read only
+ return IsEditable();
+}
+
+// ----------------------------------------------------------------------------
+// misc
+// ----------------------------------------------------------------------------
+
+void wxTextCtrlBase::SelectAll()
+{
+ SetSelection(0, GetLastPosition());
+}
+
+#else // !wxUSE_TEXTCTRL
+
+// define this one even if !wxUSE_TEXTCTRL because it is also used by other
+// controls (wxComboBox and wxSpinCtrl)
+#include "wx/event.h"
+
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED)
+
+#endif // wxUSE_TEXTCTRL/!wxUSE_TEXTCTRL
+