From bbde2e29991c2fb79b0c1c86352b18572f1cab77 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 14 Jul 2004 20:25:56 +0000 Subject: [PATCH] re-enabled and fixed wxTextCtrl::Cut,Copy,Paste with GTK+ 2 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28239 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/textctrl.cpp | 21 +++++++++++++++------ src/gtk1/textctrl.cpp | 21 +++++++++++++++------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 1a9ae3ca2d..ced9cf41e8 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1157,27 +1157,36 @@ void wxTextCtrl::Cut() { wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); -#ifndef __WXGTK20__ - gtk_editable_cut_clipboard( GTK_EDITABLE(m_text) DUMMY_CLIPBOARD_ARG ); +#ifdef __WXGTK20__ + if (m_windowStyle & wxTE_MULTILINE) + g_signal_emit_by_name(m_text, "cut-clipboard"); + else #endif + gtk_editable_cut_clipboard(GTK_EDITABLE(m_text) DUMMY_CLIPBOARD_ARG); } void wxTextCtrl::Copy() { wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); -#ifndef __WXGTK20__ - gtk_editable_copy_clipboard( GTK_EDITABLE(m_text) DUMMY_CLIPBOARD_ARG ); +#ifdef __WXGTK20__ + if (m_windowStyle & wxTE_MULTILINE) + g_signal_emit_by_name(m_text, "copy-clipboard"); + else #endif + gtk_editable_copy_clipboard(GTK_EDITABLE(m_text) DUMMY_CLIPBOARD_ARG); } void wxTextCtrl::Paste() { wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); -#ifndef __WXGTK20__ - gtk_editable_paste_clipboard( GTK_EDITABLE(m_text) DUMMY_CLIPBOARD_ARG ); +#ifdef __WXGTK20__ + if (m_windowStyle & wxTE_MULTILINE) + g_signal_emit_by_name(m_text, "paste-clipboard"); + else #endif + gtk_editable_paste_clipboard(GTK_EDITABLE(m_text) DUMMY_CLIPBOARD_ARG); } // Undo/redo diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 1a9ae3ca2d..ced9cf41e8 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -1157,27 +1157,36 @@ void wxTextCtrl::Cut() { wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); -#ifndef __WXGTK20__ - gtk_editable_cut_clipboard( GTK_EDITABLE(m_text) DUMMY_CLIPBOARD_ARG ); +#ifdef __WXGTK20__ + if (m_windowStyle & wxTE_MULTILINE) + g_signal_emit_by_name(m_text, "cut-clipboard"); + else #endif + gtk_editable_cut_clipboard(GTK_EDITABLE(m_text) DUMMY_CLIPBOARD_ARG); } void wxTextCtrl::Copy() { wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); -#ifndef __WXGTK20__ - gtk_editable_copy_clipboard( GTK_EDITABLE(m_text) DUMMY_CLIPBOARD_ARG ); +#ifdef __WXGTK20__ + if (m_windowStyle & wxTE_MULTILINE) + g_signal_emit_by_name(m_text, "copy-clipboard"); + else #endif + gtk_editable_copy_clipboard(GTK_EDITABLE(m_text) DUMMY_CLIPBOARD_ARG); } void wxTextCtrl::Paste() { wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); -#ifndef __WXGTK20__ - gtk_editable_paste_clipboard( GTK_EDITABLE(m_text) DUMMY_CLIPBOARD_ARG ); +#ifdef __WXGTK20__ + if (m_windowStyle & wxTE_MULTILINE) + g_signal_emit_by_name(m_text, "paste-clipboard"); + else #endif + gtk_editable_paste_clipboard(GTK_EDITABLE(m_text) DUMMY_CLIPBOARD_ARG); } // Undo/redo -- 2.45.2