set event object correctly for the menu events
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22557 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -729,6 +729,10 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
|
|||||||
pm = pm->GetParent();
|
pm = pm->GetParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: why do we have to call wxFrame::GetEventHandler() directly here?
|
||||||
|
// normally wxMenu::SendEvent() should be enough, if it doesn't work
|
||||||
|
// in wxGTK then we have a bug in wxMenu::GetInvokingWindow() which
|
||||||
|
// should be fixed instead of working around it here...
|
||||||
if (frame)
|
if (frame)
|
||||||
{
|
{
|
||||||
// If it is attached then let the frame send the event.
|
// If it is attached then let the frame send the event.
|
||||||
@@ -738,6 +742,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
|
|||||||
commandEvent.SetEventObject(frame);
|
commandEvent.SetEventObject(frame);
|
||||||
if (item->IsCheckable())
|
if (item->IsCheckable())
|
||||||
commandEvent.SetInt(item->IsChecked());
|
commandEvent.SetInt(item->IsChecked());
|
||||||
|
commandEvent.SetEventObject(menu);
|
||||||
|
|
||||||
frame->GetEventHandler()->ProcessEvent(commandEvent);
|
frame->GetEventHandler()->ProcessEvent(commandEvent);
|
||||||
}
|
}
|
||||||
|
@@ -729,6 +729,10 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
|
|||||||
pm = pm->GetParent();
|
pm = pm->GetParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: why do we have to call wxFrame::GetEventHandler() directly here?
|
||||||
|
// normally wxMenu::SendEvent() should be enough, if it doesn't work
|
||||||
|
// in wxGTK then we have a bug in wxMenu::GetInvokingWindow() which
|
||||||
|
// should be fixed instead of working around it here...
|
||||||
if (frame)
|
if (frame)
|
||||||
{
|
{
|
||||||
// If it is attached then let the frame send the event.
|
// If it is attached then let the frame send the event.
|
||||||
@@ -738,6 +742,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
|
|||||||
commandEvent.SetEventObject(frame);
|
commandEvent.SetEventObject(frame);
|
||||||
if (item->IsCheckable())
|
if (item->IsCheckable())
|
||||||
commandEvent.SetInt(item->IsChecked());
|
commandEvent.SetInt(item->IsChecked());
|
||||||
|
commandEvent.SetEventObject(menu);
|
||||||
|
|
||||||
frame->GetEventHandler()->ProcessEvent(commandEvent);
|
frame->GetEventHandler()->ProcessEvent(commandEvent);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user