Gerbview, gerbview_selection_tool.cpp: add missing code to rebuild the view menu.
This commit is contained in:
parent
5137b54bd8
commit
ab6521ff9e
|
@ -149,6 +149,22 @@ GERBVIEW_SELECTION_TOOL::GERBVIEW_SELECTION_TOOL() :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int GERBVIEW_SELECTION_TOOL::UpdateMenu( const TOOL_EVENT& aEvent )
|
||||||
|
{
|
||||||
|
ACTION_MENU* actionMenu = aEvent.Parameter<ACTION_MENU*>();
|
||||||
|
CONDITIONAL_MENU* conditionalMenu = dynamic_cast<CONDITIONAL_MENU*>( actionMenu );
|
||||||
|
|
||||||
|
if( conditionalMenu )
|
||||||
|
conditionalMenu->Evaluate( m_selection );
|
||||||
|
|
||||||
|
if( actionMenu )
|
||||||
|
actionMenu->UpdateAll();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL()
|
GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL()
|
||||||
{
|
{
|
||||||
getView()->Remove( &m_selection );
|
getView()->Remove( &m_selection );
|
||||||
|
@ -457,6 +473,7 @@ bool GERBVIEW_SELECTION_TOOL::selectMultiple()
|
||||||
|
|
||||||
void GERBVIEW_SELECTION_TOOL::setTransitions()
|
void GERBVIEW_SELECTION_TOOL::setTransitions()
|
||||||
{
|
{
|
||||||
|
Go( &GERBVIEW_SELECTION_TOOL::UpdateMenu, ACTIONS::updateMenu.MakeEvent() );
|
||||||
Go( &GERBVIEW_SELECTION_TOOL::Main, GERBVIEW_ACTIONS::selectionActivate.MakeEvent() );
|
Go( &GERBVIEW_SELECTION_TOOL::Main, GERBVIEW_ACTIONS::selectionActivate.MakeEvent() );
|
||||||
Go( &GERBVIEW_SELECTION_TOOL::CursorSelection, GERBVIEW_ACTIONS::selectionCursor.MakeEvent() );
|
Go( &GERBVIEW_SELECTION_TOOL::CursorSelection, GERBVIEW_ACTIONS::selectionCursor.MakeEvent() );
|
||||||
Go( &GERBVIEW_SELECTION_TOOL::ClearSelection, GERBVIEW_ACTIONS::selectionClear.MakeEvent() );
|
Go( &GERBVIEW_SELECTION_TOOL::ClearSelection, GERBVIEW_ACTIONS::selectionClear.MakeEvent() );
|
||||||
|
|
|
@ -58,6 +58,9 @@ public:
|
||||||
/// @copydoc TOOL_BASE::Reset()
|
/// @copydoc TOOL_BASE::Reset()
|
||||||
void Reset( RESET_REASON aReason ) override;
|
void Reset( RESET_REASON aReason ) override;
|
||||||
|
|
||||||
|
// called to rebuild a CONDITIONAL_MENU before opening it:
|
||||||
|
int UpdateMenu( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Main()
|
* Function Main()
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue