Rename and shorten the names in ACTION_CONDITIONS
This commit is contained in:
parent
3b05d7cddd
commit
45fb030b9b
|
@ -194,9 +194,9 @@ void EDA_3D_VIEWER::setupUIConditions()
|
||||||
EDA_3D_CONDITIONS cond( &m_boardAdapter );
|
EDA_3D_CONDITIONS cond( &m_boardAdapter );
|
||||||
|
|
||||||
// Helper to define check conditions
|
// Helper to define check conditions
|
||||||
#define MaterialCheck( x ) ACTION_CONDITIONS().SetCheckCondition( cond.MaterialMode( x ) )
|
#define MaterialCheck( x ) ACTION_CONDITIONS().Check( cond.MaterialMode( x ) )
|
||||||
#define FlagCheck( x ) ACTION_CONDITIONS().SetCheckCondition( cond.Flag( x ) )
|
#define FlagCheck( x ) ACTION_CONDITIONS().Check( cond.Flag( x ) )
|
||||||
#define GridSizeCheck( x ) ACTION_CONDITIONS().SetCheckCondition( cond.GridSize( x ) )
|
#define GridSizeCheck( x ) ACTION_CONDITIONS().Check( cond.GridSize( x ) )
|
||||||
|
|
||||||
auto raytracingCondition = [this]( const SELECTION& aSel )
|
auto raytracingCondition = [this]( const SELECTION& aSel )
|
||||||
{
|
{
|
||||||
|
@ -204,7 +204,7 @@ void EDA_3D_VIEWER::setupUIConditions()
|
||||||
};
|
};
|
||||||
|
|
||||||
RegisterUIUpdateHandler( ID_RENDER_CURRENT_VIEW,
|
RegisterUIUpdateHandler( ID_RENDER_CURRENT_VIEW,
|
||||||
ACTION_CONDITIONS().SetCheckCondition( raytracingCondition ) );
|
ACTION_CONDITIONS().Check( raytracingCondition ) );
|
||||||
|
|
||||||
mgr->SetConditions( EDA_3D_ACTIONS::materialNormal,
|
mgr->SetConditions( EDA_3D_ACTIONS::materialNormal,
|
||||||
MaterialCheck( MATERIAL_MODE::NORMAL ) );
|
MaterialCheck( MATERIAL_MODE::NORMAL ) );
|
||||||
|
@ -245,8 +245,7 @@ void EDA_3D_VIEWER::setupUIConditions()
|
||||||
return m_currentCamera.GetProjection() == PROJECTION_TYPE::ORTHO;
|
return m_currentCamera.GetProjection() == PROJECTION_TYPE::ORTHO;
|
||||||
};
|
};
|
||||||
|
|
||||||
mgr->SetConditions( EDA_3D_ACTIONS::toggleOrtho,
|
mgr->SetConditions( EDA_3D_ACTIONS::toggleOrtho, ACTION_CONDITIONS().Check( orthoCondition ) );
|
||||||
ACTION_CONDITIONS().SetCheckCondition( orthoCondition ) );
|
|
||||||
|
|
||||||
#undef MaterialCheck
|
#undef MaterialCheck
|
||||||
#undef FlagCheck
|
#undef FlagCheck
|
||||||
|
|
|
@ -367,7 +367,7 @@ void EDA_BASE_FRAME::setupUIConditions()
|
||||||
for( unsigned ii = 0; LanguagesList[ii].m_KI_Lang_Identifier != 0; ii++ )
|
for( unsigned ii = 0; LanguagesList[ii].m_KI_Lang_Identifier != 0; ii++ )
|
||||||
{
|
{
|
||||||
ACTION_CONDITIONS cond;
|
ACTION_CONDITIONS cond;
|
||||||
cond.SetCheckCondition( std::bind( isCurrentLang, std::placeholders::_1,
|
cond.Check( std::bind( isCurrentLang, std::placeholders::_1,
|
||||||
LanguagesList[ii].m_WX_Lang_Identifier ) );
|
LanguagesList[ii].m_WX_Lang_Identifier ) );
|
||||||
|
|
||||||
RegisterUIUpdateHandler( LanguagesList[ii].m_KI_Lang_Identifier, cond );
|
RegisterUIUpdateHandler( LanguagesList[ii].m_KI_Lang_Identifier, cond );
|
||||||
|
|
|
@ -236,12 +236,12 @@ void CVPCB_MAINFRAME::setupUIConditions()
|
||||||
|
|
||||||
wxASSERT( mgr );
|
wxASSERT( mgr );
|
||||||
|
|
||||||
#define Enable( x ) ACTION_CONDITIONS().SetEnableCondition( x )
|
#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
|
||||||
#define Check( x ) ACTION_CONDITIONS().SetCheckCondition( x )
|
#define CHECK( x ) ACTION_CONDITIONS().Check( x )
|
||||||
|
|
||||||
mgr->SetConditions( CVPCB_ACTIONS::saveAssociations, Enable( cond.ContentModified() ) );
|
mgr->SetConditions( CVPCB_ACTIONS::saveAssociations, ENABLE( cond.ContentModified() ) );
|
||||||
mgr->SetConditions( ACTIONS::undo, Enable( cond.UndoAvailable() ) );
|
mgr->SetConditions( ACTIONS::undo, ENABLE( cond.UndoAvailable() ) );
|
||||||
mgr->SetConditions( ACTIONS::redo, Enable( cond.RedoAvailable() ) );
|
mgr->SetConditions( ACTIONS::redo, ENABLE( cond.RedoAvailable() ) );
|
||||||
|
|
||||||
#define filterActive( filter ) ( m_filteringOptions & filter )
|
#define filterActive( filter ) ( m_filteringOptions & filter )
|
||||||
|
|
||||||
|
@ -263,12 +263,12 @@ void CVPCB_MAINFRAME::setupUIConditions()
|
||||||
return m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_PIN_COUNT;
|
return m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_PIN_COUNT;
|
||||||
};
|
};
|
||||||
|
|
||||||
mgr->SetConditions( CVPCB_ACTIONS::FilterFPbyFPFilters, Check( compFilter ) );
|
mgr->SetConditions( CVPCB_ACTIONS::FilterFPbyFPFilters, CHECK( compFilter ) );
|
||||||
mgr->SetConditions( CVPCB_ACTIONS::FilterFPbyLibrary, Check( libFilter ) );
|
mgr->SetConditions( CVPCB_ACTIONS::FilterFPbyLibrary, CHECK( libFilter ) );
|
||||||
mgr->SetConditions( CVPCB_ACTIONS::filterFPbyPin, Check( pinFilter ) );
|
mgr->SetConditions( CVPCB_ACTIONS::filterFPbyPin, CHECK( pinFilter ) );
|
||||||
|
|
||||||
#undef Check
|
#undef CHECK
|
||||||
#undef Enable
|
#undef ENABLE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -190,17 +190,17 @@ void DISPLAY_FOOTPRINTS_FRAME::setupUIConditions()
|
||||||
|
|
||||||
wxASSERT( mgr );
|
wxASSERT( mgr );
|
||||||
|
|
||||||
#define Check( x ) ACTION_CONDITIONS().SetCheckCondition( x )
|
#define CHECK( x ) ACTION_CONDITIONS().Check( x )
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::zoomTool, Check( cond.CurrentTool( ACTIONS::zoomTool ) ) );
|
mgr->SetConditions( ACTIONS::zoomTool, CHECK( cond.CurrentTool( ACTIONS::zoomTool ) ) );
|
||||||
mgr->SetConditions( ACTIONS::selectionTool, Check( cond.CurrentTool( ACTIONS::selectionTool ) ) );
|
mgr->SetConditions( ACTIONS::selectionTool, CHECK( cond.CurrentTool( ACTIONS::selectionTool ) ) );
|
||||||
mgr->SetConditions( ACTIONS::measureTool, Check( cond.CurrentTool( ACTIONS::measureTool ) ) );
|
mgr->SetConditions( ACTIONS::measureTool, CHECK( cond.CurrentTool( ACTIONS::measureTool ) ) );
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::toggleGrid, Check( cond.GridVisible() ) );
|
mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) );
|
||||||
mgr->SetConditions( ACTIONS::toggleCursorStyle, Check( cond.FullscreenCursor() ) );
|
mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) );
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::metricUnits, Check( cond.Units( EDA_UNITS::MILLIMETRES ) ) );
|
mgr->SetConditions( ACTIONS::metricUnits, CHECK( cond.Units( EDA_UNITS::MILLIMETRES ) ) );
|
||||||
mgr->SetConditions( ACTIONS::imperialUnits, Check( cond.Units( EDA_UNITS::INCHES ) ) );
|
mgr->SetConditions( ACTIONS::imperialUnits, CHECK( cond.Units( EDA_UNITS::INCHES ) ) );
|
||||||
|
|
||||||
|
|
||||||
auto autoZoomCond =
|
auto autoZoomCond =
|
||||||
|
@ -233,13 +233,13 @@ void DISPLAY_FOOTPRINTS_FRAME::setupUIConditions()
|
||||||
return !GetDisplayOptions().m_DisplayGraphicsFill;
|
return !GetDisplayOptions().m_DisplayGraphicsFill;
|
||||||
};
|
};
|
||||||
|
|
||||||
mgr->SetConditions( PCB_ACTIONS::zoomFootprintAutomatically, Check( autoZoomCond ) );
|
mgr->SetConditions( PCB_ACTIONS::zoomFootprintAutomatically, CHECK( autoZoomCond ) );
|
||||||
mgr->SetConditions( PCB_ACTIONS::showPadNumbers, Check( padNumCond ) );
|
mgr->SetConditions( PCB_ACTIONS::showPadNumbers, CHECK( padNumCond ) );
|
||||||
mgr->SetConditions( PCB_ACTIONS::padDisplayMode, Check( padFillCond ) );
|
mgr->SetConditions( PCB_ACTIONS::padDisplayMode, CHECK( padFillCond ) );
|
||||||
mgr->SetConditions( PCB_ACTIONS::textOutlines, Check( textFillCond ) );
|
mgr->SetConditions( PCB_ACTIONS::textOutlines, CHECK( textFillCond ) );
|
||||||
mgr->SetConditions( PCB_ACTIONS::graphicsOutlines, Check( graphicsFillCond ) );
|
mgr->SetConditions( PCB_ACTIONS::graphicsOutlines, CHECK( graphicsFillCond ) );
|
||||||
|
|
||||||
#undef Check
|
#undef CHECK
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1182,22 +1182,22 @@ void GERBVIEW_FRAME::setupUIConditions()
|
||||||
|
|
||||||
wxASSERT( mgr );
|
wxASSERT( mgr );
|
||||||
|
|
||||||
#define Enable( x ) ACTION_CONDITIONS().SetEnableCondition( x )
|
#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
|
||||||
#define Check( x ) ACTION_CONDITIONS().SetCheckCondition( x )
|
#define CHECK( x ) ACTION_CONDITIONS().Check( x )
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::zoomTool, Check( cond.CurrentTool( ACTIONS::zoomTool ) ) );
|
mgr->SetConditions( ACTIONS::zoomTool, CHECK( cond.CurrentTool( ACTIONS::zoomTool ) ) );
|
||||||
mgr->SetConditions( ACTIONS::selectionTool, Check( cond.CurrentTool( ACTIONS::selectionTool ) ) );
|
mgr->SetConditions( ACTIONS::selectionTool, CHECK( cond.CurrentTool( ACTIONS::selectionTool ) ) );
|
||||||
mgr->SetConditions( ACTIONS::measureTool, Check( cond.CurrentTool( ACTIONS::measureTool ) ) );
|
mgr->SetConditions( ACTIONS::measureTool, CHECK( cond.CurrentTool( ACTIONS::measureTool ) ) );
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::toggleGrid, Check( cond.GridVisible() ) );
|
mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) );
|
||||||
mgr->SetConditions( ACTIONS::togglePolarCoords, Check( cond.PolarCoordinates() ) );
|
mgr->SetConditions( ACTIONS::togglePolarCoords, CHECK( cond.PolarCoordinates() ) );
|
||||||
mgr->SetConditions( ACTIONS::toggleCursorStyle, Check( cond.FullscreenCursor() ) );
|
mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) );
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::metricUnits, Check( cond.Units( EDA_UNITS::MILLIMETRES ) ) );
|
mgr->SetConditions( ACTIONS::metricUnits, CHECK( cond.Units( EDA_UNITS::MILLIMETRES ) ) );
|
||||||
mgr->SetConditions( ACTIONS::imperialUnits, Check( cond.Units( EDA_UNITS::INCHES ) ) );
|
mgr->SetConditions( ACTIONS::imperialUnits, CHECK( cond.Units( EDA_UNITS::INCHES ) ) );
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::acceleratedGraphics, Check( cond.CanvasType( EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL ) ) );
|
mgr->SetConditions( ACTIONS::acceleratedGraphics, CHECK( cond.CanvasType( EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL ) ) );
|
||||||
mgr->SetConditions( ACTIONS::standardGraphics, Check( cond.CanvasType( EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO ) ) );
|
mgr->SetConditions( ACTIONS::standardGraphics, CHECK( cond.CanvasType( EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO ) ) );
|
||||||
|
|
||||||
|
|
||||||
auto flashedDisplayOutlinesCond =
|
auto flashedDisplayOutlinesCond =
|
||||||
|
@ -1248,14 +1248,14 @@ void GERBVIEW_FRAME::setupUIConditions()
|
||||||
return m_DisplayOptions.m_FlipGerberView;
|
return m_DisplayOptions.m_FlipGerberView;
|
||||||
};
|
};
|
||||||
|
|
||||||
mgr->SetConditions( GERBVIEW_ACTIONS::flashedDisplayOutlines, Check( flashedDisplayOutlinesCond ) );
|
mgr->SetConditions( GERBVIEW_ACTIONS::flashedDisplayOutlines, CHECK( flashedDisplayOutlinesCond ) );
|
||||||
mgr->SetConditions( GERBVIEW_ACTIONS::linesDisplayOutlines, Check( linesFillCond ) );
|
mgr->SetConditions( GERBVIEW_ACTIONS::linesDisplayOutlines, CHECK( linesFillCond ) );
|
||||||
mgr->SetConditions( GERBVIEW_ACTIONS::polygonsDisplayOutlines, Check( polygonsFilledCond ) );
|
mgr->SetConditions( GERBVIEW_ACTIONS::polygonsDisplayOutlines, CHECK( polygonsFilledCond ) );
|
||||||
mgr->SetConditions( GERBVIEW_ACTIONS::negativeObjectDisplay, Check( negativeObjectsCond ) );
|
mgr->SetConditions( GERBVIEW_ACTIONS::negativeObjectDisplay, CHECK( negativeObjectsCond ) );
|
||||||
mgr->SetConditions( GERBVIEW_ACTIONS::dcodeDisplay, Check( dcodeCond ) );
|
mgr->SetConditions( GERBVIEW_ACTIONS::dcodeDisplay, CHECK( dcodeCond ) );
|
||||||
mgr->SetConditions( GERBVIEW_ACTIONS::toggleDiffMode, Check( diffModeCond ) );
|
mgr->SetConditions( GERBVIEW_ACTIONS::toggleDiffMode, CHECK( diffModeCond ) );
|
||||||
mgr->SetConditions( GERBVIEW_ACTIONS::flipGerberView, Check( flipGerberCond ) );
|
mgr->SetConditions( GERBVIEW_ACTIONS::flipGerberView, CHECK( flipGerberCond ) );
|
||||||
mgr->SetConditions( ACTIONS::highContrastMode, Check( highContrastModeCond ) );
|
mgr->SetConditions( ACTIONS::highContrastMode, CHECK( highContrastModeCond ) );
|
||||||
|
|
||||||
|
|
||||||
auto layersManagerShownCondition =
|
auto layersManagerShownCondition =
|
||||||
|
@ -1265,11 +1265,11 @@ void GERBVIEW_FRAME::setupUIConditions()
|
||||||
};
|
};
|
||||||
|
|
||||||
RegisterUIUpdateHandler( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR,
|
RegisterUIUpdateHandler( ID_TB_OPTIONS_SHOW_LAYERS_MANAGER_VERTICAL_TOOLBAR,
|
||||||
Check( layersManagerShownCondition ) );
|
CHECK( layersManagerShownCondition ) );
|
||||||
|
|
||||||
|
|
||||||
#undef Check
|
#undef CHECK
|
||||||
#undef Enable
|
#undef ENABLE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar()
|
||||||
|
|
||||||
FILE_HISTORY& recentGbrFiles = GetFileHistory();
|
FILE_HISTORY& recentGbrFiles = GetFileHistory();
|
||||||
|
|
||||||
#define FileHistoryCond( x ) ACTION_CONDITIONS().SetEnableCondition( FILE_HISTORY::FileHistoryNotEmpty( x ) )
|
#define FileHistoryCond( x ) ACTION_CONDITIONS().Enable( FILE_HISTORY::FileHistoryNotEmpty( x ) )
|
||||||
|
|
||||||
|
|
||||||
// Create the gerber file menu if it does not exist. Adding a file to/from the history
|
// Create the gerber file menu if it does not exist. Adding a file to/from the history
|
||||||
|
|
|
@ -56,19 +56,19 @@ struct ACTION_CONDITIONS
|
||||||
showCondition = SELECTION_CONDITIONS::ShowAlways; // Always show by default
|
showCondition = SELECTION_CONDITIONS::ShowAlways; // Always show by default
|
||||||
}
|
}
|
||||||
|
|
||||||
ACTION_CONDITIONS& SetCheckCondition( const SELECTION_CONDITION& aCondition )
|
ACTION_CONDITIONS& Check( const SELECTION_CONDITION& aCondition )
|
||||||
{
|
{
|
||||||
checkCondition = aCondition;
|
checkCondition = aCondition;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
ACTION_CONDITIONS& SetEnableCondition( const SELECTION_CONDITION& aCondition )
|
ACTION_CONDITIONS& Enable( const SELECTION_CONDITION& aCondition )
|
||||||
{
|
{
|
||||||
enableCondition = aCondition;
|
enableCondition = aCondition;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
ACTION_CONDITIONS& SetShowCondition( const SELECTION_CONDITION& aCondition )
|
ACTION_CONDITIONS& Show( const SELECTION_CONDITION& aCondition )
|
||||||
{
|
{
|
||||||
showCondition = aCondition;
|
showCondition = aCondition;
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
@ -211,7 +211,7 @@ void KICAD_MANAGER_FRAME::setupUIConditions()
|
||||||
};
|
};
|
||||||
|
|
||||||
ACTION_CONDITIONS activeProjectCond;
|
ACTION_CONDITIONS activeProjectCond;
|
||||||
activeProjectCond.SetEnableCondition( activeProject );
|
activeProjectCond.Enable( activeProject );
|
||||||
|
|
||||||
manager->SetConditions( KICAD_MANAGER_ACTIONS::editSchematic, activeProjectCond );
|
manager->SetConditions( KICAD_MANAGER_ACTIONS::editSchematic, activeProjectCond );
|
||||||
manager->SetConditions( KICAD_MANAGER_ACTIONS::editSymbols, activeProjectCond );
|
manager->SetConditions( KICAD_MANAGER_ACTIONS::editSymbols, activeProjectCond );
|
||||||
|
|
|
@ -75,7 +75,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
|
||||||
|
|
||||||
// Add the file menu condition here since it needs the item ID for the submenu
|
// Add the file menu condition here since it needs the item ID for the submenu
|
||||||
ACTION_CONDITIONS cond;
|
ACTION_CONDITIONS cond;
|
||||||
cond.SetEnableCondition( FILE_HISTORY::FileHistoryNotEmpty( fileHistory ) );
|
cond.Enable( FILE_HISTORY::FileHistoryNotEmpty( fileHistory ) );
|
||||||
RegisterUIUpdateHandler( item->GetId(), cond );
|
RegisterUIUpdateHandler( item->GetId(), cond );
|
||||||
|
|
||||||
fileMenu->Add( KICAD_MANAGER_ACTIONS::closeProject );
|
fileMenu->Add( KICAD_MANAGER_ACTIONS::closeProject );
|
||||||
|
|
|
@ -72,7 +72,7 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
|
||||||
|
|
||||||
// Add the file menu condition here since it needs the item ID for the submenu
|
// Add the file menu condition here since it needs the item ID for the submenu
|
||||||
ACTION_CONDITIONS cond;
|
ACTION_CONDITIONS cond;
|
||||||
cond.SetEnableCondition( FILE_HISTORY::FileHistoryNotEmpty( recentFiles ) );
|
cond.Enable( FILE_HISTORY::FileHistoryNotEmpty( recentFiles ) );
|
||||||
RegisterUIUpdateHandler( item->GetId(), cond );
|
RegisterUIUpdateHandler( item->GetId(), cond );
|
||||||
|
|
||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
|
|
|
@ -249,32 +249,32 @@ void PL_EDITOR_FRAME::setupUIConditions()
|
||||||
|
|
||||||
wxASSERT( mgr );
|
wxASSERT( mgr );
|
||||||
|
|
||||||
#define Enable( x ) ACTION_CONDITIONS().SetEnableCondition( x )
|
#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
|
||||||
#define Check( x ) ACTION_CONDITIONS().SetCheckCondition( x )
|
#define CHECK( x ) ACTION_CONDITIONS().Check( x )
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::save, Enable( cond.ContentModified() ) );
|
mgr->SetConditions( ACTIONS::save, ENABLE( cond.ContentModified() ) );
|
||||||
mgr->SetConditions( ACTIONS::undo, Enable( cond.UndoAvailable() ) );
|
mgr->SetConditions( ACTIONS::undo, ENABLE( cond.UndoAvailable() ) );
|
||||||
mgr->SetConditions( ACTIONS::redo, Enable( cond.RedoAvailable() ) );
|
mgr->SetConditions( ACTIONS::redo, ENABLE( cond.RedoAvailable() ) );
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::toggleGrid, Check( cond.GridVisible() ) );
|
mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) );
|
||||||
mgr->SetConditions( ACTIONS::toggleCursorStyle, Check( cond.FullscreenCursor() ) );
|
mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) );
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::cut, Enable( SELECTION_CONDITIONS::MoreThan( 0 ) ) );
|
mgr->SetConditions( ACTIONS::cut, ENABLE( SELECTION_CONDITIONS::MoreThan( 0 ) ) );
|
||||||
mgr->SetConditions( ACTIONS::copy, Enable( SELECTION_CONDITIONS::MoreThan( 0 ) ) );
|
mgr->SetConditions( ACTIONS::copy, ENABLE( SELECTION_CONDITIONS::MoreThan( 0 ) ) );
|
||||||
mgr->SetConditions( ACTIONS::paste, Enable( SELECTION_CONDITIONS::Idle ) );
|
mgr->SetConditions( ACTIONS::paste, ENABLE( SELECTION_CONDITIONS::Idle ) );
|
||||||
mgr->SetConditions( ACTIONS::doDelete, Enable( SELECTION_CONDITIONS::MoreThan( 0 ) ) );
|
mgr->SetConditions( ACTIONS::doDelete, ENABLE( SELECTION_CONDITIONS::MoreThan( 0 ) ) );
|
||||||
|
|
||||||
mgr->SetConditions( ACTIONS::zoomTool, Check( cond.CurrentTool( ACTIONS::zoomTool ) ) );
|
mgr->SetConditions( ACTIONS::zoomTool, CHECK( cond.CurrentTool( ACTIONS::zoomTool ) ) );
|
||||||
mgr->SetConditions( ACTIONS::selectionTool, Check( cond.CurrentTool( ACTIONS::selectionTool ) ) );
|
mgr->SetConditions( ACTIONS::selectionTool, CHECK( cond.CurrentTool( ACTIONS::selectionTool ) ) );
|
||||||
mgr->SetConditions( ACTIONS::deleteTool, Check( cond.CurrentTool( ACTIONS::deleteTool ) ) );
|
mgr->SetConditions( ACTIONS::deleteTool, CHECK( cond.CurrentTool( ACTIONS::deleteTool ) ) );
|
||||||
|
|
||||||
mgr->SetConditions( PL_ACTIONS::drawLine, Check( cond.CurrentTool( PL_ACTIONS::drawLine ) ) );
|
mgr->SetConditions( PL_ACTIONS::drawLine, CHECK( cond.CurrentTool( PL_ACTIONS::drawLine ) ) );
|
||||||
mgr->SetConditions( PL_ACTIONS::drawRectangle, Check( cond.CurrentTool( PL_ACTIONS::drawRectangle ) ) );
|
mgr->SetConditions( PL_ACTIONS::drawRectangle, CHECK( cond.CurrentTool( PL_ACTIONS::drawRectangle ) ) );
|
||||||
mgr->SetConditions( PL_ACTIONS::placeText, Check( cond.CurrentTool( PL_ACTIONS::placeText ) ) );
|
mgr->SetConditions( PL_ACTIONS::placeText, CHECK( cond.CurrentTool( PL_ACTIONS::placeText ) ) );
|
||||||
mgr->SetConditions( PL_ACTIONS::placeImage, Check( cond.CurrentTool( PL_ACTIONS::placeImage ) ) );
|
mgr->SetConditions( PL_ACTIONS::placeImage, CHECK( cond.CurrentTool( PL_ACTIONS::placeImage ) ) );
|
||||||
|
|
||||||
// Not a tool, just a way to activate the action
|
// Not a tool, just a way to activate the action
|
||||||
mgr->SetConditions( PL_ACTIONS::appendImportedWorksheet, Check( SELECTION_CONDITIONS::ShowNever ) );
|
mgr->SetConditions( PL_ACTIONS::appendImportedWorksheet, CHECK( SELECTION_CONDITIONS::ShowNever ) );
|
||||||
|
|
||||||
auto whiteBackgroundCondition = [ this ] ( const SELECTION& aSel ) {
|
auto whiteBackgroundCondition = [ this ] ( const SELECTION& aSel ) {
|
||||||
return GetDrawBgColor() == WHITE;
|
return GetDrawBgColor() == WHITE;
|
||||||
|
@ -295,11 +295,11 @@ void PL_EDITOR_FRAME::setupUIConditions()
|
||||||
return WS_DATA_MODEL::GetTheInstance().m_EditMode == true;
|
return WS_DATA_MODEL::GetTheInstance().m_EditMode == true;
|
||||||
};
|
};
|
||||||
|
|
||||||
mgr->SetConditions( PL_ACTIONS::layoutNormalMode, Check( titleBlockNormalMode ) );
|
mgr->SetConditions( PL_ACTIONS::layoutNormalMode, CHECK( titleBlockNormalMode ) );
|
||||||
mgr->SetConditions( PL_ACTIONS::layoutEditMode, Check( titleBlockEditMode ) );
|
mgr->SetConditions( PL_ACTIONS::layoutEditMode, CHECK( titleBlockEditMode ) );
|
||||||
|
|
||||||
#undef Check
|
#undef CHECK
|
||||||
#undef Enable
|
#undef ENABLE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue