[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] A GUI test for pasting
From: |
Vaclav Slavik |
Subject: |
Re: [lmi] A GUI test for pasting |
Date: |
Mon, 3 Mar 2008 15:34:30 +0100 |
User-agent: |
KMail/1.9.9 |
Greg Chicares wrote:
> I've implemented that, in msw-specific function
> void send_paste_message_to(wxWindow const& w)
> added here:
>
> http://cvs.sv.gnu.org/viewvc/lmi/lmi/main_wx.cpp?r1=1.96&r2=1.97&vi
>ew=patch
>
> Could I ask you to write a wxGTK implementation for this
> particular case, if that's relatively easy to do?
Here it is:
Index: Makefile.am
===================================================================
RCS file: /sources/lmi/lmi/Makefile.am,v
retrieving revision 1.35
diff -u -u -r1.35 Makefile.am
--- Makefile.am 14 Feb 2008 15:06:10 -0000 1.35
+++ Makefile.am 3 Mar 2008 14:25:42 -0000
@@ -257,7 +257,7 @@
wx_checks.cpp \
wx_utility.cpp
-lmi_wx_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CXXFLAGS) $(XMLWRAPP_FLAGS)
$(LIBXSLT_CFLAGS) $(LIBXML_CFLAGS)
+lmi_wx_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CXXFLAGS) $(XMLWRAPP_FLAGS)
$(GTK_CFLAGS) $(LIBXSLT_CFLAGS) $(LIBXML_CFLAGS)
# $(CGICC_INCLUDE_FLAGS)
if LMI_MSW
@@ -273,6 +273,7 @@
liblmi.la \
libwx_new.la \
$(XMLWRAPP_LIBS) \
+ $(GTK_LIBS) \
$(LIBXSLT_LIBS) \
$(LIBXML_LIBS) \
$(BOOST_LIBS) \
Index: configure.ac
===================================================================
RCS file: /sources/lmi/lmi/configure.ac,v
retrieving revision 1.34
diff -u -u -r1.34 configure.ac
--- configure.ac 18 Feb 2008 17:41:27 -0000 1.34
+++ configure.ac 3 Mar 2008 14:25:42 -0000
@@ -437,6 +437,11 @@
dnl indicates the directory path where sources could be found
AC_SUBST(LMI_BOOSTFS_SRC)
+dnl --- GTK+ (required) -------------------
+if test "$USE_LINUX" = "1"; then
+ PKG_CHECK_MODULES(GTK, gtk+-2.0)
+fi
+
dnl --- libxml (required) -------------------
PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.6.0)
Index: main_wx.cpp
===================================================================
RCS file: /sources/lmi/lmi/main_wx.cpp,v
retrieving revision 1.101
diff -u -u -r1.101 main_wx.cpp
--- main_wx.cpp 2 Mar 2008 03:07:23 -0000 1.101
+++ main_wx.cpp 3 Mar 2008 14:25:42 -0000
@@ -101,6 +101,10 @@
#include <stdexcept>
#include <string>
+#if defined __WXGTK__
+# include <gtk/gtk.h>
+#endif
+
#if !defined LMI_MSW
# include "lmi.xpm"
#endif // !defined LMI_MSW
@@ -956,7 +960,7 @@
void send_paste_message_to(wxWindow const& w)
{
#if defined __WXGTK__
- warning() << "Not yet implemented." << LMI_FLUSH;
+ g_signal_emit_by_name(w.m_focusWidget, "paste_clipboard");
#elif defined __WXMSW__
::SendMessage(reinterpret_cast<HWND>(w.GetHandle()), WM_PASTE, 0, 0);
#else // Unsupported platform.
(That's the same thing GTK+ does internally.) Alternatively, it could use
"reinterpret_cast<GtkWidget*>(w.GetHandle())" instead of "w.m_focusWidget"
(which is wxGTK implementation detail, unlike GetHandle), but then it
would be less generic, it wouldn't work with multiline text controls.
Vaclav
--
PGP key: 0x465264C9, available from http://pgp.mit.edu/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [lmi] A GUI test for pasting,
Vaclav Slavik <=