Applied patch [ 681262 ] Add EVT_MENU_OPEN support for GTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -161,6 +161,24 @@ static wxString wxReplaceUnderscore( const wxString& title )
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// activate message from GTK
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
static void gtk_menu_open_callback( GtkWidget *widget, wxMenu *menu )
|
||||||
|
{
|
||||||
|
if (g_isIdle) wxapp_install_idle_handler();
|
||||||
|
|
||||||
|
wxMenuEvent event( wxEVT_MENU_OPEN, -1 );
|
||||||
|
event.SetEventObject( menu );
|
||||||
|
|
||||||
|
if (menu->GetEventHandler()->ProcessEvent(event))
|
||||||
|
return;
|
||||||
|
|
||||||
|
wxWindow *win = menu->GetInvokingWindow();
|
||||||
|
if (win) win->GetEventHandler()->ProcessEvent( event );
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxMenuBar
|
// wxMenuBar
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -392,6 +410,10 @@ bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
gtk_signal_connect( GTK_OBJECT(menu->m_owner), "activate",
|
||||||
|
GTK_SIGNAL_FUNC(gtk_menu_open_callback),
|
||||||
|
(gpointer)menu );
|
||||||
|
|
||||||
// m_invokingWindow is set after wxFrame::SetMenuBar(). This call enables
|
// m_invokingWindow is set after wxFrame::SetMenuBar(). This call enables
|
||||||
// addings menu later on.
|
// addings menu later on.
|
||||||
if (m_invokingWindow)
|
if (m_invokingWindow)
|
||||||
|
@@ -161,6 +161,24 @@ static wxString wxReplaceUnderscore( const wxString& title )
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// activate message from GTK
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
static void gtk_menu_open_callback( GtkWidget *widget, wxMenu *menu )
|
||||||
|
{
|
||||||
|
if (g_isIdle) wxapp_install_idle_handler();
|
||||||
|
|
||||||
|
wxMenuEvent event( wxEVT_MENU_OPEN, -1 );
|
||||||
|
event.SetEventObject( menu );
|
||||||
|
|
||||||
|
if (menu->GetEventHandler()->ProcessEvent(event))
|
||||||
|
return;
|
||||||
|
|
||||||
|
wxWindow *win = menu->GetInvokingWindow();
|
||||||
|
if (win) win->GetEventHandler()->ProcessEvent( event );
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxMenuBar
|
// wxMenuBar
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -392,6 +410,10 @@ bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
gtk_signal_connect( GTK_OBJECT(menu->m_owner), "activate",
|
||||||
|
GTK_SIGNAL_FUNC(gtk_menu_open_callback),
|
||||||
|
(gpointer)menu );
|
||||||
|
|
||||||
// m_invokingWindow is set after wxFrame::SetMenuBar(). This call enables
|
// m_invokingWindow is set after wxFrame::SetMenuBar(). This call enables
|
||||||
// addings menu later on.
|
// addings menu later on.
|
||||||
if (m_invokingWindow)
|
if (m_invokingWindow)
|
||||||
|
Reference in New Issue
Block a user