Move show-bounding-boxes to a tool on the toolbars.

This commit is contained in:
Jeff Young 2022-01-17 11:55:55 +00:00
parent 1f2d1528cb
commit 2defd8d911
21 changed files with 159 additions and 77 deletions

View File

@ -28,6 +28,7 @@ using namespace KIGFX;
RENDER_SETTINGS::RENDER_SETTINGS() :
m_highlightNetcodes(),
m_drawBoundingBoxes( false ),
m_dashLengthRatio( 12 ), // From ISO 128-2
m_gapLengthRatio( 3 ), // From ISO 128-2
m_printDC( nullptr )

View File

@ -544,6 +544,11 @@ TOOL_ACTION ACTIONS::highContrastModeCycle( "common.Control.highContrastModeCycl
_( "Cycle inactive layers between normal, dimmed, and hidden" ),
BITMAPS::contrast_mode );
TOOL_ACTION ACTIONS::toggleBoundingBoxes( "common.Control.toggleBoundingBoxes",
AS_GLOBAL, 0, "",
_( "Draw Bounding Boxes" ), "",
BITMAPS::gerbview_show_negative_objects );
TOOL_ACTION ACTIONS::selectionTool( "common.InteractiveSelection.selectionTool",
AS_GLOBAL, 0, "",
_( "Select item(s)" ), _( "Select item(s)" ),

View File

@ -25,6 +25,7 @@
#include <base_screen.h>
#include <base_units.h>
#include <painter.h>
#include <bitmaps.h>
#include <class_draw_panel_gal.h>
#include <dialogs/dialog_configure_paths.h>
@ -32,14 +33,12 @@
#include <gal/graphics_abstraction_layer.h>
#include <id.h>
#include <kiface_base.h>
#include <project.h>
#include <settings/app_settings.h>
#include <tool/actions.h>
#include <tool/common_tools.h>
#include <tool/tool_manager.h>
#include <view/view.h>
#include <view/view_controls.h>
#include <zoom_defines.h>
COMMON_TOOLS::COMMON_TOOLS() :
@ -579,62 +578,81 @@ int COMMON_TOOLS::ToggleCursorStyle( const TOOL_EVENT& aEvent )
}
void COMMON_TOOLS::setTransitions()
int COMMON_TOOLS::ToggleBoundingBoxes( const TOOL_EVENT& aEvent )
{
Go( &COMMON_TOOLS::SelectionTool, ACTIONS::selectionTool.MakeEvent() );
EDA_DRAW_PANEL_GAL* canvas = m_frame->GetCanvas();
// Cursor control
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorUp.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorDown.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorLeft.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorRight.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorUpFast.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorDownFast.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorLeftFast.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorRightFast.MakeEvent() );
if( canvas )
{
KIGFX::RENDER_SETTINGS* rs = canvas->GetView()->GetPainter()->GetSettings();
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorClick.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorDblClick.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::showContextMenu.MakeEvent() );
rs->SetDrawBoundingBoxes( !rs->GetDrawBoundingBoxes() );
// Pan control
Go( &COMMON_TOOLS::PanControl, ACTIONS::panUp.MakeEvent() );
Go( &COMMON_TOOLS::PanControl, ACTIONS::panDown.MakeEvent() );
Go( &COMMON_TOOLS::PanControl, ACTIONS::panLeft.MakeEvent() );
Go( &COMMON_TOOLS::PanControl, ACTIONS::panRight.MakeEvent() );
canvas->GetView()->UpdateAllItems( KIGFX::ALL );
canvas->ForceRefresh();
}
// Zoom control
Go( &COMMON_TOOLS::ZoomRedraw, ACTIONS::zoomRedraw.MakeEvent() );
Go( &COMMON_TOOLS::ZoomInOut, ACTIONS::zoomIn.MakeEvent() );
Go( &COMMON_TOOLS::ZoomInOut, ACTIONS::zoomOut.MakeEvent() );
Go( &COMMON_TOOLS::ZoomInOutCenter, ACTIONS::zoomInCenter.MakeEvent() );
Go( &COMMON_TOOLS::ZoomInOutCenter, ACTIONS::zoomOutCenter.MakeEvent() );
Go( &COMMON_TOOLS::ZoomCenter, ACTIONS::zoomCenter.MakeEvent() );
Go( &COMMON_TOOLS::ZoomFitScreen, ACTIONS::zoomFitScreen.MakeEvent() );
Go( &COMMON_TOOLS::ZoomFitObjects, ACTIONS::zoomFitObjects.MakeEvent() );
Go( &COMMON_TOOLS::ZoomPreset, ACTIONS::zoomPreset.MakeEvent() );
Go( &COMMON_TOOLS::CenterContents, ACTIONS::centerContents.MakeEvent() );
// Grid control
Go( &COMMON_TOOLS::GridNext, ACTIONS::gridNext.MakeEvent() );
Go( &COMMON_TOOLS::GridPrev, ACTIONS::gridPrev.MakeEvent() );
Go( &COMMON_TOOLS::GridPreset, ACTIONS::gridPreset.MakeEvent() );
Go( &COMMON_TOOLS::GridFast1, ACTIONS::gridFast1.MakeEvent() );
Go( &COMMON_TOOLS::GridFast2, ACTIONS::gridFast2.MakeEvent() );
Go( &COMMON_TOOLS::ToggleGrid, ACTIONS::toggleGrid.MakeEvent() );
Go( &COMMON_TOOLS::GridProperties, ACTIONS::gridProperties.MakeEvent() );
// Units and coordinates
Go( &COMMON_TOOLS::SwitchUnits, ACTIONS::inchesUnits.MakeEvent() );
Go( &COMMON_TOOLS::SwitchUnits, ACTIONS::milsUnits.MakeEvent() );
Go( &COMMON_TOOLS::SwitchUnits, ACTIONS::millimetersUnits.MakeEvent() );
Go( &COMMON_TOOLS::ToggleUnits, ACTIONS::toggleUnits.MakeEvent() );
Go( &COMMON_TOOLS::TogglePolarCoords, ACTIONS::togglePolarCoords.MakeEvent() );
Go( &COMMON_TOOLS::ResetLocalCoords, ACTIONS::resetLocalCoords.MakeEvent() );
// Misc
Go( &COMMON_TOOLS::ToggleCursor, ACTIONS::toggleCursor.MakeEvent() );
Go( &COMMON_TOOLS::ToggleCursorStyle, ACTIONS::toggleCursorStyle.MakeEvent() );
return 0;
}
void COMMON_TOOLS::setTransitions()
{
Go( &COMMON_TOOLS::SelectionTool, ACTIONS::selectionTool.MakeEvent() );
// Cursor control
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorUp.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorDown.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorLeft.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorRight.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorUpFast.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorDownFast.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorLeftFast.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorRightFast.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorClick.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::cursorDblClick.MakeEvent() );
Go( &COMMON_TOOLS::CursorControl, ACTIONS::showContextMenu.MakeEvent() );
// Pan control
Go( &COMMON_TOOLS::PanControl, ACTIONS::panUp.MakeEvent() );
Go( &COMMON_TOOLS::PanControl, ACTIONS::panDown.MakeEvent() );
Go( &COMMON_TOOLS::PanControl, ACTIONS::panLeft.MakeEvent() );
Go( &COMMON_TOOLS::PanControl, ACTIONS::panRight.MakeEvent() );
// Zoom control
Go( &COMMON_TOOLS::ZoomRedraw, ACTIONS::zoomRedraw.MakeEvent() );
Go( &COMMON_TOOLS::ZoomInOut, ACTIONS::zoomIn.MakeEvent() );
Go( &COMMON_TOOLS::ZoomInOut, ACTIONS::zoomOut.MakeEvent() );
Go( &COMMON_TOOLS::ZoomInOutCenter, ACTIONS::zoomInCenter.MakeEvent() );
Go( &COMMON_TOOLS::ZoomInOutCenter, ACTIONS::zoomOutCenter.MakeEvent() );
Go( &COMMON_TOOLS::ZoomCenter, ACTIONS::zoomCenter.MakeEvent() );
Go( &COMMON_TOOLS::ZoomFitScreen, ACTIONS::zoomFitScreen.MakeEvent() );
Go( &COMMON_TOOLS::ZoomFitObjects, ACTIONS::zoomFitObjects.MakeEvent() );
Go( &COMMON_TOOLS::ZoomPreset, ACTIONS::zoomPreset.MakeEvent() );
Go( &COMMON_TOOLS::CenterContents, ACTIONS::centerContents.MakeEvent() );
// Grid control
Go( &COMMON_TOOLS::GridNext, ACTIONS::gridNext.MakeEvent() );
Go( &COMMON_TOOLS::GridPrev, ACTIONS::gridPrev.MakeEvent() );
Go( &COMMON_TOOLS::GridPreset, ACTIONS::gridPreset.MakeEvent() );
Go( &COMMON_TOOLS::GridFast1, ACTIONS::gridFast1.MakeEvent() );
Go( &COMMON_TOOLS::GridFast2, ACTIONS::gridFast2.MakeEvent() );
Go( &COMMON_TOOLS::ToggleGrid, ACTIONS::toggleGrid.MakeEvent() );
Go( &COMMON_TOOLS::GridProperties, ACTIONS::gridProperties.MakeEvent() );
// Units and coordinates
Go( &COMMON_TOOLS::SwitchUnits, ACTIONS::inchesUnits.MakeEvent() );
Go( &COMMON_TOOLS::SwitchUnits, ACTIONS::milsUnits.MakeEvent() );
Go( &COMMON_TOOLS::SwitchUnits, ACTIONS::millimetersUnits.MakeEvent() );
Go( &COMMON_TOOLS::ToggleUnits, ACTIONS::toggleUnits.MakeEvent() );
Go( &COMMON_TOOLS::TogglePolarCoords, ACTIONS::togglePolarCoords.MakeEvent() );
Go( &COMMON_TOOLS::ResetLocalCoords, ACTIONS::resetLocalCoords.MakeEvent() );
// Misc
Go( &COMMON_TOOLS::ToggleCursor, ACTIONS::toggleCursor.MakeEvent() );
Go( &COMMON_TOOLS::ToggleCursorStyle, ACTIONS::toggleCursorStyle.MakeEvent() );
Go( &COMMON_TOOLS::ToggleBoundingBoxes, ACTIONS::toggleBoundingBoxes.MakeEvent() );
}

View File

@ -23,6 +23,8 @@
*/
#include <view/view.h>
#include <painter.h>
#include <class_draw_panel_gal.h>
#include <eda_base_frame.h>
#include <eda_draw_frame.h>
@ -104,6 +106,16 @@ SELECTION_CONDITION EDITOR_CONDITIONS::FullscreenCursor()
}
SELECTION_CONDITION EDITOR_CONDITIONS::BoundingBoxes()
{
EDA_DRAW_FRAME* drwFrame = dynamic_cast<EDA_DRAW_FRAME*>( m_frame );
wxASSERT( drwFrame );
return std::bind( &EDITOR_CONDITIONS::bboxesFunc, _1, drwFrame );
}
SELECTION_CONDITION EDITOR_CONDITIONS::ScriptingConsoleVisible()
{
EDA_DRAW_FRAME* drwFrame = dynamic_cast<EDA_DRAW_FRAME*>( m_frame );
@ -170,6 +182,12 @@ bool EDITOR_CONDITIONS::cursorFunc( const SELECTION& aSelection, EDA_DRAW_FRAME*
}
bool EDITOR_CONDITIONS::bboxesFunc( const SELECTION& aSelection, EDA_DRAW_FRAME* aFrame )
{
return aFrame->GetCanvas()->GetView()->GetPainter()->GetSettings()->GetDrawBoundingBoxes();
}
bool EDITOR_CONDITIONS::consoleVisibleFunc( const SELECTION& aSelection, EDA_DRAW_FRAME* aFrame )
{
return aFrame->IsScriptingConsoleVisible();

View File

@ -203,13 +203,10 @@ void DISPLAY_FOOTPRINTS_FRAME::setupUIConditions()
mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCHES ) ) );
mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) );
mgr->SetConditions( PCB_ACTIONS::showPadNumbers,
CHECK( cond.PadNumbersDisplay() ) );
mgr->SetConditions( PCB_ACTIONS::padDisplayMode, CHECK( !cond.PadFillDisplay() ) );
mgr->SetConditions( PCB_ACTIONS::textOutlines, CHECK( !cond.TextFillDisplay() ) );
mgr->SetConditions( PCB_ACTIONS::graphicsOutlines,
CHECK( !cond.GraphicsFillDisplay() ) );
mgr->SetConditions( PCB_ACTIONS::showPadNumbers, CHECK( cond.PadNumbersDisplay() ) );
mgr->SetConditions( PCB_ACTIONS::padDisplayMode, CHECK( !cond.PadFillDisplay() ) );
mgr->SetConditions( PCB_ACTIONS::textOutlines, CHECK( !cond.TextFillDisplay() ) );
mgr->SetConditions( PCB_ACTIONS::graphicsOutlines, CHECK( !cond.GraphicsFillDisplay() ) );
#undef CHECK
}

View File

@ -499,6 +499,7 @@ void SCH_EDIT_FRAME::setupUIConditions()
mgr->SetConditions( EE_ACTIONS::toggleERCWarnings, CHECK( showERCWarningsCond ) );
mgr->SetConditions( EE_ACTIONS::toggleERCExclusions, CHECK( showERCExclusionsCond ) );
mgr->SetConditions( EE_ACTIONS::toggleForceHV, CHECK( forceHVCond ) );
mgr->SetConditions( ACTIONS::toggleBoundingBoxes, CHECK( cond.BoundingBoxes() ) );
#define CURRENT_TOOL( action ) mgr->SetConditions( action, CHECK( cond.CurrentTool( action ) ) )

View File

@ -197,7 +197,7 @@ bool SCH_PAINTER::Draw( const VIEW_ITEM *aItem, int aLayer )
#endif
if( ADVANCED_CFG::GetCfg().m_DrawBoundingBoxes )
if( m_schSettings.GetDrawBoundingBoxes() )
{
BOX2I box = item->GetBoundingBox();

View File

@ -429,7 +429,8 @@ void SYMBOL_EDIT_FRAME::setupUIConditions()
};
mgr->SetConditions( EE_ACTIONS::showElectricalTypes, CHECK( pinTypeCond ) );
mgr->SetConditions( EE_ACTIONS::showSymbolTree, CHECK( showCompTreeCond ) );
mgr->SetConditions( ACTIONS::toggleBoundingBoxes, CHECK( cond.BoundingBoxes() ) );
mgr->SetConditions( EE_ACTIONS::showSymbolTree, CHECK( showCompTreeCond ) );
auto demorganCond =
[this]( const SELECTION& )

View File

@ -23,6 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <advanced_config.h>
#include <eeschema_id.h>
#include <symbol_edit_frame.h>
#include <sch_painter.h>
@ -159,6 +160,11 @@ void SYMBOL_EDIT_FRAME::ReCreateOptToolbar()
m_optionsToolBar->Add( ACTIONS::millimetersUnits, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( ACTIONS::toggleCursorStyle, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( EE_ACTIONS::showElectricalTypes, ACTION_TOOLBAR::TOGGLE );
if( ADVANCED_CFG::GetCfg().m_DrawBoundingBoxes )
m_optionsToolBar->Add( ACTIONS::toggleBoundingBoxes, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->AddScaledSeparator( this );
m_optionsToolBar->Add( EE_ACTIONS::showSymbolTree, ACTION_TOOLBAR::TOGGLE );
EE_SELECTION_TOOL* selTool = m_toolManager->GetTool<EE_SELECTION_TOOL>();

View File

@ -24,6 +24,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <advanced_config.h>
#include <sch_draw_panel.h>
#include <sch_edit_frame.h>
#include <kiface_base.h>
@ -192,6 +193,9 @@ void SCH_EDIT_FRAME::ReCreateOptToolbar()
m_optionsToolBar->Add( EE_ACTIONS::toggleHiddenPins, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( EE_ACTIONS::toggleForceHV, ACTION_TOOLBAR::TOGGLE );
if( ADVANCED_CFG::GetCfg().m_DrawBoundingBoxes )
m_optionsToolBar->Add( ACTIONS::toggleBoundingBoxes, ACTION_TOOLBAR::TOGGLE );
EE_SELECTION_TOOL* selTool = m_toolManager->GetTool<EE_SELECTION_TOOL>();
std::unique_ptr<ACTION_MENU> gridMenu = std::make_unique<ACTION_MENU>( false, selTool );
gridMenu->Add( ACTIONS::gridProperties );

View File

@ -185,6 +185,9 @@ public:
void SetHighContrast( bool aEnabled ) { m_hiContrastEnabled = aEnabled; }
bool GetHighContrast() const { return m_hiContrastEnabled; }
void SetDrawBoundingBoxes( bool aEnabled ) { m_drawBoundingBoxes = aEnabled; }
bool GetDrawBoundingBoxes() const { return m_drawBoundingBoxes; }
/**
* Returns the color that should be used to draw the specific VIEW_ITEM on the specific layer
* using currently used render settings.
@ -309,6 +312,8 @@ protected:
std::set<int> m_highlightNetcodes; // Set of net cods to be highlighted
float m_highlightFactor; // Factor used for computing highlight color
bool m_drawBoundingBoxes; // Visual aid for debugging
float m_selectFactor; // Specifies how color of selected items is changed
float m_outlineWidth; // Line width used when drawing outlines
float m_drawingSheetLineWidth;// Line width used for borders and titleblock

View File

@ -102,6 +102,7 @@ public:
static TOOL_ACTION toggleCursorStyle;
static TOOL_ACTION highContrastMode;
static TOOL_ACTION highContrastModeCycle;
static TOOL_ACTION toggleBoundingBoxes;
static TOOL_ACTION refreshPreview; // Similar to a synthetic mouseMoved event, but also
// used after a rotate, mirror, etc.

View File

@ -64,6 +64,8 @@ public:
int ToggleCursor( const TOOL_EVENT& aEvent );
int ToggleCursorStyle( const TOOL_EVENT& aEvent );
int ToggleBoundingBoxes( const TOOL_EVENT& aEvent );
// Units control
int SwitchUnits( const TOOL_EVENT& aEvent );
int ToggleUnits( const TOOL_EVENT& aEvent );

View File

@ -118,6 +118,8 @@ public:
*/
SELECTION_CONDITION FullscreenCursor();
SELECTION_CONDITION BoundingBoxes();
/**
* Create a functor testing if the python scripting console window is visible.
*
@ -156,6 +158,9 @@ protected:
///< Helper function used by FullscreenCursor().
static bool cursorFunc( const SELECTION& aSelection, EDA_DRAW_FRAME* aFrame );
///< Helper function used by DrawBoundingBoxes().
static bool bboxesFunc( const SELECTION& aSelection, EDA_DRAW_FRAME* aFrame );
///< Helper function used by ScriptingConsoleVisible().
static bool consoleVisibleFunc( const SELECTION& aSelection, EDA_DRAW_FRAME* aFrame );

View File

@ -1122,6 +1122,8 @@ void FOOTPRINT_EDIT_FRAME::setupUIConditions()
mgr->SetConditions( ACTIONS::highContrastMode, CHECK( highContrastCond ) );
mgr->SetConditions( PCB_ACTIONS::flipBoard, CHECK( boardFlippedCond ) );
mgr->SetConditions( ACTIONS::toggleBoundingBoxes, CHECK( cond.BoundingBoxes() ) );
mgr->SetConditions( PCB_ACTIONS::showFootprintTree, CHECK( footprintTreeCond ) );
mgr->SetConditions( PCB_ACTIONS::showLayersManager, CHECK( layerManagerCond ) );

View File

@ -322,12 +322,11 @@ void FOOTPRINT_VIEWER_FRAME::setupUIConditions()
#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
#define CHECK( x ) ACTION_CONDITIONS().Check( x )
mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) );
mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) );
mgr->SetConditions( ACTIONS::millimetersUnits,
CHECK( cond.Units( EDA_UNITS::MILLIMETRES ) ) );
mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCHES ) ) );
mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) );
mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) );
mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) );
mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MILLIMETRES ) ) );
mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCHES ) ) );
mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) );
mgr->SetConditions( ACTIONS::zoomTool,
@ -341,6 +340,7 @@ void FOOTPRINT_VIEWER_FRAME::setupUIConditions()
mgr->SetConditions( PCB_ACTIONS::padDisplayMode, CHECK( !cond.PadFillDisplay() ) );
mgr->SetConditions( PCB_ACTIONS::textOutlines, CHECK( !cond.TextFillDisplay() ) );
mgr->SetConditions( PCB_ACTIONS::graphicsOutlines, CHECK( !cond.GraphicsFillDisplay() ) );
mgr->SetConditions( ACTIONS::toggleBoundingBoxes, CHECK( cond.BoundingBoxes() ) );
#undef ENABLE
#undef CHECK

View File

@ -638,13 +638,19 @@ void PCB_EDIT_FRAME::setupUIConditions()
};
mgr->SetConditions( PCB_ACTIONS::zoneDisplayFilled,
ENABLE( enableZoneControlConition ).Check( cond.ZoneDisplayMode( ZONE_DISPLAY_MODE::SHOW_FILLED ) ) );
ENABLE( enableZoneControlConition )
.Check( cond.ZoneDisplayMode( ZONE_DISPLAY_MODE::SHOW_FILLED ) ) );
mgr->SetConditions( PCB_ACTIONS::zoneDisplayOutline,
ENABLE( enableZoneControlConition ).Check( cond.ZoneDisplayMode( ZONE_DISPLAY_MODE::SHOW_ZONE_OUTLINE ) ) );
ENABLE( enableZoneControlConition )
.Check( cond.ZoneDisplayMode( ZONE_DISPLAY_MODE::SHOW_ZONE_OUTLINE ) ) );
mgr->SetConditions( PCB_ACTIONS::zoneDisplayFractured,
ENABLE( enableZoneControlConition ).Check( cond.ZoneDisplayMode( ZONE_DISPLAY_MODE::SHOW_FRACTURE_BORDERS ) ) );
ENABLE( enableZoneControlConition )
.Check( cond.ZoneDisplayMode( ZONE_DISPLAY_MODE::SHOW_FRACTURE_BORDERS ) ) );
mgr->SetConditions( PCB_ACTIONS::zoneDisplayTriangulated,
ENABLE( enableZoneControlConition ).Check( cond.ZoneDisplayMode( ZONE_DISPLAY_MODE::SHOW_TRIANGULATION ) ) );
ENABLE( enableZoneControlConition )
.Check( cond.ZoneDisplayMode( ZONE_DISPLAY_MODE::SHOW_TRIANGULATION ) ) );
mgr->SetConditions( ACTIONS::toggleBoundingBoxes, CHECK( cond.BoundingBoxes() ) );
auto enableBoardSetupCondition =
[this] ( const SELECTION& )
@ -704,10 +710,9 @@ void PCB_EDIT_FRAME::setupUIConditions()
mgr->SetConditions( PCB_ACTIONS::showLayersManager, CHECK( layerManagerCond ) );
mgr->SetConditions( PCB_ACTIONS::showRatsnest, CHECK( globalRatsnestCond ) );
mgr->SetConditions( PCB_ACTIONS::ratsnestLineMode, CHECK( curvedRatsnestCond ) );
mgr->SetConditions( PCB_ACTIONS::toggleNetHighlight,
CHECK( netHighlightCond ).Enable( enableNetHighlightCond ) );
mgr->SetConditions( PCB_ACTIONS::boardSetup , ENABLE( enableBoardSetupCondition ) );
mgr->SetConditions( PCB_ACTIONS::toggleNetHighlight, CHECK( netHighlightCond )
.Enable( enableNetHighlightCond ) );
mgr->SetConditions( PCB_ACTIONS::boardSetup, ENABLE( enableBoardSetupCondition ) );
auto isHighlightMode =
[this]( const SELECTION& )

View File

@ -504,7 +504,7 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer )
}
// Draw bounding boxes after drawing objects so they can be seen.
if( ADVANCED_CFG::GetCfg().m_DrawBoundingBoxes )
if( m_pcbSettings.GetDrawBoundingBoxes() )
{
// Show bounding boxes of painted objects for debugging.
EDA_RECT box = item->GetBoundingBox();

View File

@ -31,6 +31,7 @@
#include <pcb_layer_box_selector.h>
#include <wx/choice.h>
#include <wx/wupdlock.h>
#include <advanced_config.h>
void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar()
{
@ -224,6 +225,9 @@ void FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar()
m_optionsToolBar->Add( PCB_ACTIONS::textOutlines, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( ACTIONS::highContrastMode, ACTION_TOOLBAR::TOGGLE );
if( ADVANCED_CFG::GetCfg().m_DrawBoundingBoxes )
m_optionsToolBar->Add( ACTIONS::toggleBoundingBoxes, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->AddScaledSeparator( this );
m_optionsToolBar->Add( PCB_ACTIONS::showFootprintTree, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::showLayersManager, ACTION_TOOLBAR::TOGGLE );

View File

@ -21,6 +21,7 @@
*/
#include <advanced_config.h>
#include <macros.h>
#include <bitmaps.h>
#include <tool/action_toolbar.h>
@ -137,6 +138,9 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateOptToolbar()
m_optionsToolBar->Add( PCB_ACTIONS::textOutlines, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::graphicsOutlines, ACTION_TOOLBAR::TOGGLE );
if( ADVANCED_CFG::GetCfg().m_DrawBoundingBoxes )
m_optionsToolBar->Add( ACTIONS::toggleBoundingBoxes, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->KiRealize();
}

View File

@ -369,6 +369,9 @@ void PCB_EDIT_FRAME::ReCreateOptToolbar()
m_optionsToolBar->Add( PCB_ACTIONS::viaDisplayMode, ACTION_TOOLBAR::TOGGLE );
m_optionsToolBar->Add( PCB_ACTIONS::trackDisplayMode, ACTION_TOOLBAR::TOGGLE );
if( ADVANCED_CFG::GetCfg().m_DrawBoundingBoxes )
m_optionsToolBar->Add( ACTIONS::toggleBoundingBoxes, ACTION_TOOLBAR::TOGGLE );
// Tools to show/hide toolbars:
m_optionsToolBar->AddScaledSeparator( this );
m_optionsToolBar->Add( PCB_ACTIONS::showLayersManager, ACTION_TOOLBAR::TOGGLE );