65#include <wx/wupdlock.h>
66#include <wx/combobox.h>
80 COLOR4D top_color, bottom_color, background_color;
81 bool change = aForceRebuild;
93 if(
m_prevIconVal.previous_Route_Layer_TOP_color != top_color )
101 if(
m_prevIconVal.previous_Route_Layer_BOTTOM_color != bottom_color )
103 m_prevIconVal.previous_Route_Layer_BOTTOM_color = bottom_color;
121 _(
"Track width selector" ),
122 _(
"Control to select the track width" ),
125 _(
"Via diameter selector" ),
126 _(
"Control to select the via diameter" ),
129 _(
"Control to select the microvia stack preset" ),
132 _(
"Current variant" ),
133 _(
"Control to select the current variant" ),
147 [](
TOOL_MANAGER* aMgr ) -> std::unique_ptr<ACTION_MENU>
150 std::unique_ptr<ACTION_MENU> menu =
151 std::make_unique<ACTION_MENU>(
false, selTool );
221 [](
TOOL_MANAGER* aMgr ) -> std::unique_ptr<ACTION_MENU>
224 std::unique_ptr<ACTION_MENU> menu =
225 std::make_unique<ACTION_MENU>(
false, selTool );
230 menu->AppendSeparator();
246 [](
TOOL_MANAGER* aMgr ) -> std::unique_ptr<ACTION_MENU>
249 std::unique_ptr<ACTION_MENU> menu =
250 std::make_unique<ACTION_MENU>(
false, selTool );
254 menu->AppendSeparator();
267 [](
TOOL_MANAGER* aMgr ) -> std::unique_ptr<ACTION_MENU>
270 std::unique_ptr<ACTION_MENU> menu =
271 std::make_unique<ACTION_MENU>(
false, selTool );
377 if( !
Kiface().IsSingle() )
428 auto trackWidthSelectorFactory =
434 wxDefaultPosition, wxDefaultSize, 0,
nullptr );
437 m_SelTrackWidthBox->SetToolTip(
_(
"Select the default width for new tracks. Note that this "
438 "width can be overridden by the board minimum width, or by "
439 "the width of an existing track if the 'Use Existing Track "
440 "Width' feature is enabled." ) );
451 auto viaDiaSelectorFactory =
457 wxDefaultPosition, wxDefaultSize, 0,
nullptr );
475 m_SelViaStackBox->SetToolTip(
_(
"Select the microvia stack preset placed by the "
476 "microvia stack tool." ) );
485 auto variantSelectionCtrlFactory =
491 wxDefaultPosition, wxDefaultSize, 0,
nullptr );
506 auto pluginControlFactory =
514 aToolbar->AddScaledSeparator( aToolbar->GetParent() );
549 int selectionIndex = 0;
552 if( !currentVariant.IsEmpty() )
556 if( foundIndex != wxNOT_FOUND )
557 selectionIndex = foundIndex;
593 if( selection == wxNOT_FOUND || selection == 0 )
612 if(
text->HasTextVars() )
614 text->ClearRenderCache();
615 text->ClearBoundingBoxCache();
624 if( !fp->GetVariants().empty() )
626 field->ClearRenderCache();
627 field->ClearBoundingBoxCache();
646 const wxChar* format;
651 wxASSERT_MSG(
false, wxT(
"Invalid unit" ) );
671 if( aTrackWidthSelectBox ==
nullptr )
681 aTrackWidthSelectBox->Clear();
684 aTrackWidthSelectBox->Append(
_(
"Track: use netclass width" ) );
690 msg.Printf(
_(
"Track: %s (%s)" ),
ComboBoxUnits( primaryUnit, size ),
693 aTrackWidthSelectBox->Append( msg );
698 aTrackWidthSelectBox->Append( wxT(
"---" ) );
699 aTrackWidthSelectBox->Append(
_(
"Edit Pre-defined Sizes..." ) );
707 aTrackWidthSelectBox->SetSelection( std::max( 0,
GetDesignSettings().GetTrackWidthIndex() ) );
714 if( aViaSizeSelectBox ==
nullptr )
717 aViaSizeSelectBox->Clear();
729 aViaSizeSelectBox->Append(
_(
"Via: use netclass sizes" ) );
734 wxString msg, priStr, secStr;
737 double hole = viaDimension.
m_Drill;
741 priStr =
ComboBoxUnits( primaryUnit, diam,
false ) + wxT(
" / " )
743 secStr =
ComboBoxUnits( secondaryUnit, diam,
false ) + wxT(
" / " )
752 msg.Printf(
_(
"Via: %s (%s)" ), priStr, secStr );
754 aViaSizeSelectBox->Append( msg );
759 aViaSizeSelectBox->Append( wxT(
"---" ) );
760 aViaSizeSelectBox->Append(
_(
"Edit Pre-defined Sizes..." ) );
768 aViaSizeSelectBox->SetSelection( std::max( 0,
GetDesignSettings().GetViaSizeIndex() ) );
774 if( aViaStackSelectBox ==
nullptr )
777 aViaStackSelectBox->Clear();
781 if( presets.empty() )
782 aViaStackSelectBox->Append(
_(
"Microvia stack: none defined" ) );
785 aViaStackSelectBox->Append( wxString::Format(
_(
"Microvia stack: %s" ), preset.m_Name ) );
787 aViaStackSelectBox->Append( wxT(
"---" ) );
788 aViaStackSelectBox->Append(
_(
"Edit Pre-defined Microvia Stacks..." ) );
792 if( idx < 0 || idx >= (
int) presets.size() )
798 aViaStackSelectBox->SetSelection( presets.empty() ? 0 : idx );
810 if( aForceResizeToolbar )
819 wxAuiPaneInfo& selectionFilter =
m_auimgr.GetPane(
"SelectionFilter" );
962 db_library_pane.Show( !db_library_pane.IsShown() );
964 if( db_library_pane.IsShown() )
966 if( db_library_pane.IsFloating() )
980 if( db_library_pane.IsFloating() )
constexpr EDA_IU_SCALE pcbIUScale
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
static TOOL_ACTION gridProperties
static TOOL_ACTION updatePcbFromSchematic
static TOOL_ACTION toggleGrid
static TOOL_ACTION zoomRedraw
static TOOL_ACTION millimetersUnits
static TOOL_ACTION show3DViewer
static TOOL_ACTION cursorSmallCrosshairs
static TOOL_ACTION zoomOutCenter
static TOOL_ACTION togglePolarCoords
static TOOL_ACTION selectSetLasso
static TOOL_ACTION selectSetRect
Set lasso selection mode.
static TOOL_ACTION pointEditorArcKeepCenter
static TOOL_ACTION milsUnits
static TOOL_ACTION ungroup
static TOOL_ACTION toggleBoundingBoxes
static TOOL_ACTION pointEditorArcKeepRadius
static TOOL_ACTION pageSettings
static TOOL_ACTION inchesUnits
static TOOL_ACTION highContrastMode
static TOOL_ACTION gridOrigin
static TOOL_ACTION measureTool
static TOOL_ACTION zoomFitScreen
static TOOL_ACTION deleteTool
static TOOL_ACTION zoomTool
static TOOL_ACTION cursor45Crosshairs
static TOOL_ACTION showFootprintEditor
static TOOL_ACTION showProperties
static TOOL_ACTION zoomFitObjects
static TOOL_ACTION zoomInCenter
static TOOL_ACTION gridSetOrigin
static TOOL_ACTION showFootprintBrowser
static TOOL_ACTION toggleGridOverrides
static TOOL_ACTION pointEditorArcKeepEndpoint
static TOOL_ACTION cursorFullCrosshairs
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
std::vector< const PLUGIN_ACTION * > GetActionsForScope(PLUGIN_ACTION_SCOPE aScope)
Container for design settings for a BOARD object.
void UseCustomTrackViaSize(bool aEnabled)
Enables/disables custom track/via size settings.
void SetViaSizeIndex(int aIndex)
Set the current via size list index to aIndex.
int GetTrackWidthIndex() const
int GetViaSizeIndex() const
void SetViaStackIndex(int aIndex)
Set the current via stack preset index to aIndex.
int GetViaStackIndex() const
void SetTrackWidthIndex(int aIndex)
Set the current track width list index to aIndex.
std::vector< int > m_TrackWidthList
std::vector< VIA_STACK_PRESET > m_ViaStackPresets
std::vector< VIA_DIMENSION > m_ViasDimensionsList
FOOTPRINT * GetParentFootprint() const
void SetCurrentVariant(const wxString &aVariant)
wxArrayString GetVariantNamesForUI() const
Return the variant names for UI display.
wxString GetVariantDescription(const wxString &aVariantName) const
wxString GetCurrentVariant() const
COLOR4D GetColor(int aLayer) const
void SetVariantName(const std::string &aVariant)
Set the current variant name and description to be shown on the drawing sheet.
void SetVariantDesc(const std::string &aVariantDesc)
virtual void UpdateToolbarControlSizes()
Update the sizes of any controls in the toolbars of the frame.
void RegisterCustomToolbarControlFactory(const ACTION_TOOLBAR_CONTROL &aControlDesc, const ACTION_TOOLBAR_CONTROL_FACTORY &aControlFactory)
Register a creation factory for toolbar controls that are present in this frame.
ACTION_TOOLBAR * m_tbTopAux
static const wxString AppearancePanelName()
NET_INSPECTOR_PANEL * m_netInspectorPanel
virtual void AddApiPluginTools(ACTION_TOOLBAR *aToolbar)
Append actions from API plugins to the given toolbar.
static const wxString NetInspectorPanelName()
void GetUnitPair(EDA_UNITS &aPrimaryUnit, EDA_UNITS &aSecondaryUnits) override
Get the pair or units in current use.
SEARCH_PANE * m_searchPane
static const wxString DesignBlocksPaneName()
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
A color representation with 4 components: red, green, blue, alpha.
An abstract base class for deriving all objects that can be added to a VIEW.
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
static wxBitmapBundle CreateLayerPairIcon(const COLOR4D &aTopColor, const COLOR4D &aBottomColor, int aDefSize=24)
Create a layer pair "side-by-side swatch" icon.
static TOOL_ACTION lineModeFree
Unconstrained angle mode (icon lines_any)
static TOOL_ACTION drawRuleArea
static TOOL_ACTION drawBezier
static TOOL_ACTION placeText
static TOOL_ACTION zonesManager
static TOOL_ACTION drawOrthogonalDimension
static TOOL_ACTION drawRectangle
static TOOL_ACTION padDisplayMode
static TOOL_ACTION placeReferenceImage
static TOOL_ACTION routerSettingsDialog
Activation of the Push and Shove settings dialogs.
static TOOL_ACTION showRatsnest
static TOOL_ACTION zoneFillAll
static TOOL_ACTION showLayersManager
static TOOL_ACTION toggleNetHighlight
static TOOL_ACTION addConstraintVertical
static TOOL_ACTION drawCircle
static TOOL_ACTION mirrorH
Mirroring of selected items.
static TOOL_ACTION routeDiffPair
Activation of the Push and Shove router (differential pair mode)
static TOOL_ACTION tuneDiffPair
static TOOL_ACTION drawEllipseArc
static TOOL_ACTION autoTrackWidth
static TOOL_ACTION drawTable
static TOOL_ACTION drawTextBox
static TOOL_ACTION addConstraintPerpendicular
static TOOL_ACTION routerHighlightMode
Actions to enable switching modes via hotkey assignments.
static TOOL_ACTION routerWalkaroundMode
static TOOL_ACTION routerShoveMode
static TOOL_ACTION drawPolygon
static TOOL_ACTION drawViaStitchArea
static TOOL_ACTION zoneDisplayFilled
static TOOL_ACTION drawRadialDimension
static TOOL_ACTION tuneSingleTrack
static TOOL_ACTION viaDisplayMode
static TOOL_ACTION drawLeader
static TOOL_ACTION addConstraintAngular
static TOOL_ACTION lineMode45
45-degree-or-orthogonal mode (icon hv45mode)
static TOOL_ACTION addConstraintArcAngle
static TOOL_ACTION drillOrigin
static TOOL_ACTION tuneSkew
static TOOL_ACTION addConstraintHorizontal
static TOOL_ACTION trackDisplayMode
static TOOL_ACTION selectLayerPair
static TOOL_ACTION drawEllipse
static TOOL_ACTION zoneDisplayTriangulated
static TOOL_ACTION zoneDisplayFractured
static TOOL_ACTION addConstraintCollinear
static TOOL_ACTION drawVia
static TOOL_ACTION drawArc
static TOOL_ACTION runDRC
static TOOL_ACTION importNetlist
static TOOL_ACTION addConstraintEqualRadius
static TOOL_ACTION addConstraintTangent
static TOOL_ACTION boardSetup
static TOOL_ACTION showEeschema
static TOOL_ACTION drawCenterDimension
static TOOL_ACTION zoneUnfillAll
static TOOL_ACTION editFootprintFields
static TOOL_ACTION addConstraintFixedLength
static TOOL_ACTION placeGridItem
Grid Item.
static TOOL_ACTION lineMode90
90-degree-only mode (icon lines90)
static TOOL_ACTION zoneDisplayOutline
static TOOL_ACTION ratsnestLineMode
static TOOL_ACTION toggleAutoConstraints
Toggle authoring constraints automatically while drawing.
static TOOL_ACTION placeBarcode
static TOOL_ACTION placePoint
static TOOL_ACTION addConstraintSymmetric
static TOOL_ACTION addConstraintFixedPosition
Ground a point, and the cluster holding it.
static TOOL_ACTION mirrorV
static TOOL_ACTION unlock
static TOOL_ACTION addConstraintPointOnLine
static TOOL_ACTION placeFootprint
static TOOL_ACTION routeSingleTrack
Activation of the Push and Shove router.
static TOOL_ACTION showDiffPhaseSkew
Display of phase skew between differential pair tracks.
static TOOL_ACTION addConstraintCoincident
static TOOL_ACTION drawLine
static TOOL_ACTION localRatsnestTool
static TOOL_ACTION placeViaStack
static TOOL_ACTION rotateCw
Rotation of selected objects.
static TOOL_ACTION rotateCcw
static TOOL_ACTION addConstraintParallel
static TOOL_ACTION drawAlignedDimension
static TOOL_ACTION addConstraintFixedRadius
static TOOL_ACTION addConstraintEqualLength
static TOOL_ACTION drawZone
static TOOL_ACTION addConstraintMidpoint
static TOOL_ACTION addConstraintConcentric
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
PCB_LAYER_BOX_SELECTOR * m_SelLayerBox
void configureToolbars() override
void ClearToolbarControl(int aId) override
APPEARANCE_CONTROLS * m_appearancePanel
PCBNEW_SETTINGS * GetPcbNewSettings() const
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Return the BOARD_DESIGN_SETTINGS for the open project.
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void OnUpdateSelectTrackWidth(wxUpdateUIEvent &aEvent)
void UpdateVariantSelectionCtrl()
Update the variant selection dropdown with the current board's variant names.
void UpdateTrackWidthSelectBox(wxChoice *aTrackWidthSelectBox, bool aShowNetclass, bool aShowEdit)
void UpdateViaSizeSelectBox(wxChoice *aViaSizeSelectBox, bool aShowNetclass, bool aShowEdit)
void SetCurrentVariant(const wxString &aVariantName)
Set the current variant on the board and update the drawing sheet's cached variant name and descripti...
LAYER_TOOLBAR_ICON_VALUES m_prevIconVal
void ClearToolbarControl(int aId) override
void ReCreateLayerBox(bool aForceResizeToolbar=true)
Recreate the layer box by clearing the old list and building a new one from the new layer names and c...
void PrepareLayerIndicator(bool aForceRebuild=false)
wxChoice * m_CurrentVariantCtrl
void UpdateProperties() override
PLUGIN_ACTION_SCOPE PluginActionScope() const override
void ReCreateAuxiliaryToolbar() override
void ToggleLibraryTree() override
void OnUpdateSelectViaSize(wxUpdateUIEvent &aEvent)
void ToggleLayersManager()
wxChoice * m_SelViaSizeBox
void onVariantSelected(wxCommandEvent &aEvent)
Event handler for variant selection changes in the toolbar.
void configureToolbars() override
void ToggleNetInspector()
void UpdateViaStackSelectBox(wxChoice *aViaStackSelectBox)
Fill the via stack preset selector with the board's defined presets plus an edit entry.
PCB_DESIGN_BLOCK_PANE * m_designBlocksPane
wxChoice * m_SelViaStackBox
bool m_ShowLayerManagerTools
static const wxString SearchPaneName()
wxChoice * m_SelTrackWidthBox
virtual COMMON_SETTINGS * GetCommonSettings() const
virtual API_PLUGIN_MANAGER & GetPluginManager() const
EDA_UNITS GetUserUnits() const
This file contains miscellaneous commonly used macros and functions.
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
KICOMMON_API double ToUserUnit(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnit, double aValue)
Convert aValue in internal units to the appropriate user units defined by aUnit.
KICOMMON_API wxString GetText(EDA_UNITS aUnits, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Get the units string for a given units type.
KICOMMON_API bool IsImperialUnit(EDA_UNITS aUnit)
@ REPAINT
Item needs to be redrawn.
@ GEOMETRY
Position or shape has changed.
@ ID_AUX_TOOLBAR_PCB_VARIANT_SELECT
@ ID_AUX_TOOLBAR_PCB_VIA_SIZE
@ ID_AUX_TOOLBAR_PCB_VIA_STACK
@ ID_AUX_TOOLBAR_PCB_TRACK_WIDTH
PGM_BASE & Pgm()
The global program "get" accessor.
int design_blocks_panel_float_height
int design_blocks_panel_docked_width
int search_panel_dock_direction
int design_blocks_panel_float_width
Container to handle a stock of specific vias each with unique diameter and drill sizes in the BOARD c...
A named microvia stack definition, chosen while routing instead of entering the values each time.
void SetAuiPaneSize(wxAuiManager &aManager, wxAuiPaneInfo &aPane, int aWidth, int aHeight)
Sets the size of an AUI pane, working around http://trac.wxwidgets.org/ticket/13180.