From cd743a6f71653cc0cfa5c0377aae26c906650620 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 5 Feb 1999 19:07:42 +0000 Subject: [PATCH] libjpeg not used by default (it didn't even link) no menu's help texts disappear again now that is git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1614 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- configure | 2 +- configure.in | 2 +- src/gtk/menu.cpp | 33 +++++++++++++++++++++++++++++++++ src/gtk1/menu.cpp | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 04fd49fbfb..167c981c99 100755 --- a/configure +++ b/configure @@ -4856,7 +4856,7 @@ DEFAULT_wxUSE_IOSTREAMH=1 DEFAULT_wxUSE_ZLIB=1 DEFAULT_wxUSE_LIBPNG=1 -DEFAULT_wxUSE_LIBJPEG=1 +DEFAULT_wxUSE_LIBJPEG=0 DEFAULT_wxUSE_ODBC=1 DEFAULT_wxUSE_TIMEDATE=1 diff --git a/configure.in b/configure.in index fca457f346..c76a980805 100644 --- a/configure.in +++ b/configure.in @@ -749,7 +749,7 @@ DEFAULT_wxUSE_IOSTREAMH=1 DEFAULT_wxUSE_ZLIB=1 DEFAULT_wxUSE_LIBPNG=1 -DEFAULT_wxUSE_LIBJPEG=1 +DEFAULT_wxUSE_LIBJPEG=0 DEFAULT_wxUSE_ODBC=1 DEFAULT_wxUSE_TIMEDATE=1 diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 110c8f958f..faa9236de7 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -298,6 +298,27 @@ static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu ) if (win) win->GetEventHandler()->ProcessEvent( event ); } +//----------------------------------------------------------------------------- +// "deselect" +//----------------------------------------------------------------------------- + +static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu ) +{ + int id = menu->FindMenuIdByMenuItem(widget); + + wxASSERT( id != -1 ); // should find it! + + if (!menu->IsEnabled(id)) return; + + wxMenuEvent event( wxEVT_MENU_HIGHLIGHT, -1 ); + event.SetEventObject( menu ); + + if (menu->GetEventHandler()->ProcessEvent(event)) return; + + wxWindow *win = menu->GetInvokingWindow(); + if (win) win->GetEventHandler()->ProcessEvent( event ); +} + //----------------------------------------------------------------------------- // wxMenuItem //----------------------------------------------------------------------------- @@ -433,6 +454,10 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool GTK_SIGNAL_FUNC(gtk_menu_hilight_callback), (gpointer*)this ); + gtk_signal_connect( GTK_OBJECT(menuItem), "deselect", + GTK_SIGNAL_FUNC(gtk_menu_nolight_callback), + (gpointer*)this ); + gtk_menu_append( GTK_MENU(m_menu), menuItem ); gtk_widget_show( menuItem ); m_items.Append( mitem ); @@ -449,6 +474,14 @@ void wxMenu::Append( int id, const wxString &text, wxMenu *subMenu, const wxStri mitem->SetMenuItem(menuItem); mitem->SetSubMenu(subMenu); + gtk_signal_connect( GTK_OBJECT(menuItem), "select", + GTK_SIGNAL_FUNC(gtk_menu_hilight_callback), + (gpointer*)this ); + + gtk_signal_connect( GTK_OBJECT(menuItem), "deselect", + GTK_SIGNAL_FUNC(gtk_menu_nolight_callback), + (gpointer*)this ); + gtk_menu_item_set_submenu( GTK_MENU_ITEM(menuItem), subMenu->m_menu ); gtk_menu_append( GTK_MENU(m_menu), menuItem ); gtk_widget_show( menuItem ); diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index 110c8f958f..faa9236de7 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -298,6 +298,27 @@ static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu ) if (win) win->GetEventHandler()->ProcessEvent( event ); } +//----------------------------------------------------------------------------- +// "deselect" +//----------------------------------------------------------------------------- + +static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu ) +{ + int id = menu->FindMenuIdByMenuItem(widget); + + wxASSERT( id != -1 ); // should find it! + + if (!menu->IsEnabled(id)) return; + + wxMenuEvent event( wxEVT_MENU_HIGHLIGHT, -1 ); + event.SetEventObject( menu ); + + if (menu->GetEventHandler()->ProcessEvent(event)) return; + + wxWindow *win = menu->GetInvokingWindow(); + if (win) win->GetEventHandler()->ProcessEvent( event ); +} + //----------------------------------------------------------------------------- // wxMenuItem //----------------------------------------------------------------------------- @@ -433,6 +454,10 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool GTK_SIGNAL_FUNC(gtk_menu_hilight_callback), (gpointer*)this ); + gtk_signal_connect( GTK_OBJECT(menuItem), "deselect", + GTK_SIGNAL_FUNC(gtk_menu_nolight_callback), + (gpointer*)this ); + gtk_menu_append( GTK_MENU(m_menu), menuItem ); gtk_widget_show( menuItem ); m_items.Append( mitem ); @@ -449,6 +474,14 @@ void wxMenu::Append( int id, const wxString &text, wxMenu *subMenu, const wxStri mitem->SetMenuItem(menuItem); mitem->SetSubMenu(subMenu); + gtk_signal_connect( GTK_OBJECT(menuItem), "select", + GTK_SIGNAL_FUNC(gtk_menu_hilight_callback), + (gpointer*)this ); + + gtk_signal_connect( GTK_OBJECT(menuItem), "deselect", + GTK_SIGNAL_FUNC(gtk_menu_nolight_callback), + (gpointer*)this ); + gtk_menu_item_set_submenu( GTK_MENU_ITEM(menuItem), subMenu->m_menu ); gtk_menu_append( GTK_MENU(m_menu), menuItem ); gtk_widget_show( menuItem ); -- 2.45.2