Hack for wxWidgets failure to open menu on MSW.
This commit is contained in:
parent
38cdafd407
commit
13aa503614
|
@ -27,6 +27,18 @@
|
|||
#include <tool/action_menu.h>
|
||||
|
||||
|
||||
CONDITIONAL_MENU::CONDITIONAL_MENU( bool isContextMenu, TOOL_INTERACTIVE* aTool ) :
|
||||
m_isContextMenu( isContextMenu )
|
||||
{
|
||||
m_tool = aTool;
|
||||
|
||||
// wxWidgets 3.0.4 on MSW checks for an empty menu before running the MENU_OPEN
|
||||
// event. Add a dummy item to ensure that the event is dispatched. Evaluate()
|
||||
// will clear the menu before evaluating all the items anyway.
|
||||
Append( wxID_ANY, wxT( "dummy menu for MSW" ) );
|
||||
}
|
||||
|
||||
|
||||
ACTION_MENU* CONDITIONAL_MENU::create() const
|
||||
{
|
||||
CONDITIONAL_MENU* clone = new CONDITIONAL_MENU( m_isContextMenu, m_tool );
|
||||
|
|
|
@ -42,12 +42,7 @@ public:
|
|||
///> Constant to indicate that we do not care about an ENTRY location in the menu.
|
||||
static const int ANY_ORDER = -1;
|
||||
|
||||
|
||||
CONDITIONAL_MENU( bool isContextMenu, TOOL_INTERACTIVE* aTool ) :
|
||||
m_isContextMenu( isContextMenu )
|
||||
{
|
||||
m_tool = aTool;
|
||||
}
|
||||
CONDITIONAL_MENU( bool isContextMenu, TOOL_INTERACTIVE* aTool );
|
||||
|
||||
ACTION_MENU* create() const override;
|
||||
|
||||
|
|
Loading…
Reference in New Issue