From 74505862d04cb1d8459d4a49a393381d388ee5bf Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 19 May 1999 09:08:27 +0000 Subject: [PATCH] Updated distrib. Corrected listbox dclick. Modified char/key event stuff. Added WXWIN_COMPATIBILITY_2 = 1 to setup.hin git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/gtk/copy_src | 10 ++++++++++ setup/setup.hin | 16 +++++++++++----- src/gtk/listbox.cpp | 5 +++++ src/gtk/window.cpp | 13 ++----------- src/gtk1/listbox.cpp | 5 +++++ src/gtk1/window.cpp | 13 ++----------- 6 files changed, 35 insertions(+), 27 deletions(-) diff --git a/distrib/gtk/copy_src b/distrib/gtk/copy_src index 486c8c1c2a..9b2a9a5d35 100755 --- a/distrib/gtk/copy_src +++ b/distrib/gtk/copy_src @@ -440,6 +440,16 @@ cp *.cpp ~/wxgtk_dist/wxGTK/samples/dynamic cp *.xpm ~/wxgtk_dist/wxGTK/samples/dynamic cd .. +echo Drawing sample.. + +cd drawing +mkdir ~/wxgtk_dist/wxGTK/samples/drawing +cp Makefile ~/wxgtk_dist/wxGTK/samples/drawing +cp Makefile.in ~/wxgtk_dist/wxGTK/samples/drawing +cp *.cpp ~/wxgtk_dist/wxGTK/samples/drawing +cp *.xpm ~/wxgtk_dist/wxGTK/samples/drawing +cd .. + echo Forty sample.. cd forty diff --git a/setup/setup.hin b/setup/setup.hin index 5a7f96a985..93620efefc 100644 --- a/setup/setup.hin +++ b/setup/setup.hin @@ -271,11 +271,17 @@ * Use Apple Ieee-double converter */ #define wxUSE_APPLE_IEEE 0 -/* Compatibility with 1.66 API. - Level 0: no backward compatibility, all new features - Level 1: wxDC, OnSize (etc.) compatibility, but - some new features such as event tables */ -#define WXWIN_COMPATIBILITY 0 +/* + * Compatibility with 1.66 API. + * Level 0: no backward compatibility, all new features + * Level 1: wxDC, OnSize (etc.) compatibility, but + * some new features such as event tables + */ +#define WXWIN_COMPATIBILITY 0 +/* + * Compatibility with 2.0 API. + */ +#define WXWIN_COMPATIBILITY_2 1 /* * Enables debugging: memory tracing, assert, etc., contains debug level */ diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index dc0d32c66b..50145c9978 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -457,6 +457,11 @@ void wxListBox::AppendCommon( const wxString &item ) (GtkSignalFunc)gtk_listbox_button_press_callback, (gpointer) this ); + gtk_signal_connect_after( GTK_OBJECT(list_item), + "button_release_event", + (GtkSignalFunc)gtk_listbox_button_release_callback, + (gpointer) this ); + if (m_hasCheckBoxes) { gtk_signal_connect( GTK_OBJECT(list_item), diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 1d6581c0bd..8a4523630a 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -42,7 +42,6 @@ #include "gtk/gtk.h" #include "gdk/gdkprivate.h" #include "gdk/gdkkeysyms.h" -#include "gdk/gdkx.h" #include "wx/gtk/win_gtk.h" //----------------------------------------------------------------------------- @@ -386,14 +385,6 @@ static long map_to_wx_keysym( KeySym keysym ) return (key_code); } -static long get_unmodified_wx_keysym( GdkEventKey *event ) -{ - KeyCode keycode = XKeysymToKeycode( GDK_DISPLAY(), event->keyval ); - KeySym keysym = XKeycodeToKeysym( GDK_DISPLAY(), keycode, 0 ); - - return (map_to_unmodified_wx_keysym( keysym )); -} - //----------------------------------------------------------------------------- // local code (see below) //----------------------------------------------------------------------------- @@ -568,7 +559,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e GdkModifierType state; if (gdk_event->window) gdk_window_get_pointer(gdk_event->window, &x, &y, &state); - long key_code = get_unmodified_wx_keysym( gdk_event ); + long key_code = map_to_unmodified_wx_keysym( gdk_event->keyval ); /* sending unknown key events doesn't really make sense */ if (key_code == 0) return FALSE; @@ -704,7 +695,7 @@ static gint gtk_window_key_release_callback( GtkWidget *widget, GdkEventKey *gdk printf( "\n" ); */ - long key_code = get_unmodified_wx_keysym( gdk_event ); + long key_code = map_to_unmodified_wx_keysym( gdk_event->keyval ); /* sending unknown key events doesn't really make sense */ if (key_code == 0) return FALSE; diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index dc0d32c66b..50145c9978 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -457,6 +457,11 @@ void wxListBox::AppendCommon( const wxString &item ) (GtkSignalFunc)gtk_listbox_button_press_callback, (gpointer) this ); + gtk_signal_connect_after( GTK_OBJECT(list_item), + "button_release_event", + (GtkSignalFunc)gtk_listbox_button_release_callback, + (gpointer) this ); + if (m_hasCheckBoxes) { gtk_signal_connect( GTK_OBJECT(list_item), diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 1d6581c0bd..8a4523630a 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -42,7 +42,6 @@ #include "gtk/gtk.h" #include "gdk/gdkprivate.h" #include "gdk/gdkkeysyms.h" -#include "gdk/gdkx.h" #include "wx/gtk/win_gtk.h" //----------------------------------------------------------------------------- @@ -386,14 +385,6 @@ static long map_to_wx_keysym( KeySym keysym ) return (key_code); } -static long get_unmodified_wx_keysym( GdkEventKey *event ) -{ - KeyCode keycode = XKeysymToKeycode( GDK_DISPLAY(), event->keyval ); - KeySym keysym = XKeycodeToKeysym( GDK_DISPLAY(), keycode, 0 ); - - return (map_to_unmodified_wx_keysym( keysym )); -} - //----------------------------------------------------------------------------- // local code (see below) //----------------------------------------------------------------------------- @@ -568,7 +559,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e GdkModifierType state; if (gdk_event->window) gdk_window_get_pointer(gdk_event->window, &x, &y, &state); - long key_code = get_unmodified_wx_keysym( gdk_event ); + long key_code = map_to_unmodified_wx_keysym( gdk_event->keyval ); /* sending unknown key events doesn't really make sense */ if (key_code == 0) return FALSE; @@ -704,7 +695,7 @@ static gint gtk_window_key_release_callback( GtkWidget *widget, GdkEventKey *gdk printf( "\n" ); */ - long key_code = get_unmodified_wx_keysym( gdk_event ); + long key_code = map_to_unmodified_wx_keysym( gdk_event->keyval ); /* sending unknown key events doesn't really make sense */ if (key_code == 0) return FALSE; -- 2.45.2