Complete wxEVT_MENU_{OPEN,CLOSE} implementation in wxMSW and wxOSX.
Set the wxMenu correctly for wxEVT_MENU_CLOSE events in wxMSW. Set the menu id correctly to allow wxMenuEvent::IsPopup() to work for both wxEVT_MENU_OPEN and wxEVT_MENU_CLOSE in wxOSX. Closes #11313. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70151 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -452,16 +452,25 @@ void wxMenu::HandleMenuItemHighlighted( wxMenuItem* item )
|
||||
DoHandleMenuEvent( wxevent );
|
||||
}
|
||||
|
||||
void wxMenu::DoHandleMenuOpenedOrClosed(wxEventType evtType)
|
||||
{
|
||||
// Popup menu being currently shown or NULL, defined in wincmn.cpp.
|
||||
extern wxMenu *wxCurrentPopupMenu;
|
||||
|
||||
// Set the id to allow wxMenuEvent::IsPopup() to work correctly.
|
||||
int menuid = this == wxCurrentPopupMenu ? wxID_ANY : 0;
|
||||
wxMenuEvent wxevent(evtType, menuid, this);
|
||||
DoHandleMenuEvent( wxevent );
|
||||
}
|
||||
|
||||
void wxMenu::HandleMenuOpened()
|
||||
{
|
||||
wxMenuEvent wxevent(wxEVT_MENU_OPEN, 0, this);
|
||||
DoHandleMenuEvent( wxevent );
|
||||
DoHandleMenuOpenedOrClosed(wxEVT_MENU_OPEN);
|
||||
}
|
||||
|
||||
void wxMenu::HandleMenuClosed()
|
||||
{
|
||||
wxMenuEvent wxevent(wxEVT_MENU_CLOSE, 0, this);
|
||||
DoHandleMenuEvent( wxevent );
|
||||
DoHandleMenuOpenedOrClosed(wxEVT_MENU_CLOSE);
|
||||
}
|
||||
|
||||
bool wxMenu::DoHandleMenuEvent(wxEvent& wxevent)
|
||||
|
||||
Reference in New Issue
Block a user