60#include <wx/wupdlock.h>
61#include <wx/combobox.h>
65#include "../scripting/python_scripting.h"
74 COLOR4D top_color, bottom_color, background_color;
75 bool change = aForceRebuild;
111 const int scale = ( requested_scale <= 0 ) ?
KiIconScale(
this ) : requested_scale;
113 bottom_color,
scale );
125 _(
"Control to select the track width" ) );
127 _(
"Control to select the via diameter" ) );
137 case TOOLBAR_LOC::LEFT:
189 case TOOLBAR_LOC::RIGHT:
273 case TOOLBAR_LOC::TOP_MAIN:
322 if( !
Kiface().IsSingle() )
336 case TOOLBAR_LOC::TOP_AUX:
366 auto trackWidthSelectorFactory =
372 wxDefaultPosition, wxDefaultSize, 0,
nullptr );
375 m_SelTrackWidthBox->SetToolTip(
_(
"Select the default width for new tracks. Note that this "
376 "width can be overridden by the board minimum width, or by "
377 "the width of an existing track if the 'Use Existing Track "
378 "Width' feature is enabled." ) );
389 auto viaDiaSelectorFactory =
395 wxDefaultPosition, wxDefaultSize, 0,
nullptr );
407 auto pluginControlFactory =
411 bool scriptingAvailable = SCRIPTING::IsWxAvailable();
417 bool haveApiPlugins =
false;
420 if( scriptingAvailable || haveApiPlugins )
422 aToolbar->AddScaledSeparator( aToolbar->GetParent() );
424 if( scriptingAvailable )
442 const wxChar* format;
447 wxASSERT_MSG(
false, wxT(
"Invalid unit" ) );
467 if( aTrackWidthSelectBox ==
nullptr )
477 aTrackWidthSelectBox->Clear();
480 aTrackWidthSelectBox->Append(
_(
"Track: use netclass width" ) );
486 msg.Printf(
_(
"Track: %s (%s)" ),
ComboBoxUnits( primaryUnit, size ),
489 aTrackWidthSelectBox->Append( msg );
494 aTrackWidthSelectBox->Append( wxT(
"---" ) );
495 aTrackWidthSelectBox->Append(
_(
"Edit Pre-defined Sizes..." ) );
508 if( aViaSizeSelectBox ==
nullptr )
511 aViaSizeSelectBox->Clear();
515 EDA_UNITS secondaryUnit = EDA_UNITS::MILS;
523 aViaSizeSelectBox->Append(
_(
"Via: use netclass sizes" ) );
528 wxString msg, priStr, secStr;
531 double hole = viaDimension.
m_Drill;
535 priStr =
ComboBoxUnits( primaryUnit, diam,
false ) + wxT(
" / " )
537 secStr =
ComboBoxUnits( secondaryUnit, diam,
false ) + wxT(
" / " )
546 msg.Printf(
_(
"Via: %s (%s)" ), priStr, secStr );
548 aViaSizeSelectBox->Append( msg );
553 aViaSizeSelectBox->Append( wxT(
"---" ) );
554 aViaSizeSelectBox->Append(
_(
"Edit Pre-defined Sizes..." ) );
572 if( aForceResizeToolbar )
581 wxAuiPaneInfo& selectionFilter =
m_auimgr.GetPane(
"SelectionFilter" );
715 db_library_pane.Show( !db_library_pane.IsShown() );
717 if( db_library_pane.IsShown() )
719 if( db_library_pane.IsFloating() )
733 if( db_library_pane.IsFloating() )
constexpr EDA_IU_SCALE pcbIUScale
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
int KiIconScale(wxWindow *aWindow)
Return the automatic scale factor that would be used for a given window by KiScaledBitmap and KiScale...
static TOOL_ACTION updatePcbFromSchematic
static TOOL_ACTION toggleGrid
static TOOL_ACTION zoomRedraw
static TOOL_ACTION millimetersUnits
static TOOL_ACTION show3DViewer
static TOOL_ACTION zoomOutCenter
static TOOL_ACTION togglePolarCoords
static TOOL_ACTION milsUnits
static TOOL_ACTION toggleBoundingBoxes
static TOOL_ACTION pageSettings
static TOOL_ACTION inchesUnits
static TOOL_ACTION highContrastMode
static TOOL_ACTION toggleCursorStyle
static TOOL_ACTION measureTool
static TOOL_ACTION selectionTool
static TOOL_ACTION zoomFitScreen
static TOOL_ACTION deleteTool
static TOOL_ACTION zoomTool
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 const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
Container for design settings for a BOARD object.
void UseCustomTrackViaSize(bool aEnabled)
Enables/disables custom track/via size settings.
void SetTrackWidthIndex(unsigned aIndex)
Set the current track width list index to aIndex.
void SetViaSizeIndex(unsigned aIndex)
Set the current via size list index to aIndex.
unsigned GetTrackWidthIndex() const
unsigned GetViaSizeIndex() const
std::vector< int > m_TrackWidthList
std::vector< VIA_DIMENSION > m_ViasDimensionsList
COLOR4D GetColor(int aLayer) const
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()
A color representation with 4 components: red, green, blue, alpha.
static std::unique_ptr< wxBitmap > CreateLayerPairIcon(const KIGFX::COLOR4D &aBgColor, const KIGFX::COLOR4D &aTopColor, const KIGFX::COLOR4D &aBottomColor, int aScale)
Create a layer pair "side-by-side swatch" icon.
virtual void SaveSettings()
Save the net inspector settings - called from EDA_EDIT_FRAME when hiding the panel.
virtual void OnShowPanel()
Prepare the panel when (re-)shown in the editor.
static TOOL_ACTION toggleHV45Mode
static TOOL_ACTION drawRuleArea
static TOOL_ACTION drawBezier
static TOOL_ACTION placeText
static TOOL_ACTION drawOrthogonalDimension
static TOOL_ACTION drawRectangle
static TOOL_ACTION padDisplayMode
static TOOL_ACTION placeReferenceImage
static TOOL_ACTION showRatsnest
static TOOL_ACTION showLayersManager
static TOOL_ACTION toggleNetHighlight
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 autoTrackWidth
static TOOL_ACTION drawTable
static TOOL_ACTION drawTextBox
static TOOL_ACTION drawPolygon
static TOOL_ACTION zoneDisplayFilled
static TOOL_ACTION drawRadialDimension
static TOOL_ACTION tuneSingleTrack
static TOOL_ACTION viaDisplayMode
static TOOL_ACTION drawLeader
static TOOL_ACTION drillOrigin
static TOOL_ACTION tuneSkew
static TOOL_ACTION trackDisplayMode
static TOOL_ACTION selectLayerPair
static TOOL_ACTION zoneDisplayTriangulated
static TOOL_ACTION ungroup
static TOOL_ACTION zoneDisplayFractured
static TOOL_ACTION drawVia
static TOOL_ACTION drawArc
static TOOL_ACTION runDRC
static TOOL_ACTION importNetlist
static TOOL_ACTION boardSetup
static TOOL_ACTION showEeschema
static TOOL_ACTION drawCenterDimension
static TOOL_ACTION zoneDisplayOutline
static TOOL_ACTION ratsnestLineMode
static TOOL_ACTION mirrorV
static TOOL_ACTION unlock
static TOOL_ACTION placeFootprint
static TOOL_ACTION routeSingleTrack
Activation of the Push and Shove router.
static TOOL_ACTION showPythonConsole
static TOOL_ACTION drawLine
static TOOL_ACTION localRatsnestTool
static TOOL_ACTION rotateCw
Rotation of selected objects.
static TOOL_ACTION rotateCcw
static TOOL_ACTION drawAlignedDimension
static TOOL_ACTION drawZone
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
PCB_LAYER_BOX_SELECTOR * m_SelLayerBox
void configureToolbars() 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.
void OnUpdateSelectTrackWidth(wxUpdateUIEvent &aEvent)
void UpdateTrackWidthSelectBox(wxChoice *aTrackWidthSelectBox, bool aShowNetclass, bool aShowEdit)
void UpdateViaSizeSelectBox(wxChoice *aViaSizeSelectBox, bool aShowNetclass, bool aShowEdit)
LAYER_TOOLBAR_ICON_VALUES m_prevIconVal
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...
bool m_show_layer_manager_tools
void PrepareLayerIndicator(bool aForceRebuild=false)
void addActionPluginTools(ACTION_TOOLBAR *aToolbar)
Append action plugin buttons to given toolbar.
PLUGIN_ACTION_SCOPE PluginActionScope() const override
void ToggleLibraryTree() override
bool m_show_net_inspector
void OnUpdateSelectViaSize(wxUpdateUIEvent &aEvent)
void ToggleLayersManager()
wxChoice * m_SelViaSizeBox
void configureToolbars() override
void ToggleNetInspector()
PCB_DESIGN_BLOCK_PANE * m_designBlocksPane
static const wxString SearchPaneName()
wxChoice * m_SelTrackWidthBox
virtual COMMON_SETTINGS * GetCommonSettings() const
@ LAYER_PCB_BACKGROUND
PCB background color.
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)
@ ID_AUX_TOOLBAR_PCB_VIA_SIZE
@ ID_AUX_TOOLBAR_PCB_TRACK_WIDTH
int GetUserUnits()
Return the currently selected user unit value for the interface.
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...
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.