KiCad PCB EDA Suite
toolbars_pcb_editor.cpp File Reference
#include <memory>
#include <advanced_config.h>
#include <bitmaps.h>
#include <board.h>
#include <board_design_settings.h>
#include <kiface_base.h>
#include <macros.h>
#include <pcb_edit_frame.h>
#include <pcb_layer_box_selector.h>
#include <pcbnew_id.h>
#include <pcbnew_settings.h>
#include <pgm_base.h>
#include <router/pns_routing_settings.h>
#include <router/router_tool.h>
#include <settings/color_settings.h>
#include <tool/action_toolbar.h>
#include <tool/actions.h>
#include <tool/common_tools.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <tools/pcb_selection_tool.h>
#include <widgets/appearance_controls.h>
#include <widgets/wx_aui_utils.h>
#include <wx/wupdlock.h>
#include <wx/dcmemory.h>
#include <wx/choice.h>
#include "../scripting/python_scripting.h"

Go to the source code of this file.

Macros

#define BM_LAYERICON_SIZE   24
 

Functions

static wxString ComboBoxUnits (EDA_UNITS aUnits, double aValue, bool aIncludeLabel=true)
 

Variables

static std::unique_ptr< wxBitmap > LayerPairBitmap
 
static const char s_BitmapLayerIcon [BM_LAYERICON_SIZE][BM_LAYERICON_SIZE]
 
static COLOR4D ICON_WHITE { 0.86, 0.86, 0.86, 1.0 }
 
static COLOR4D ICON_BLACK { 0.28, 0.28, 0.28, 1.0 }
 

Macro Definition Documentation

◆ BM_LAYERICON_SIZE

#define BM_LAYERICON_SIZE   24

Definition at line 61 of file toolbars_pcb_editor.cpp.

Function Documentation

◆ ComboBoxUnits()

static wxString ComboBoxUnits ( EDA_UNITS  aUnits,
double  aValue,
bool  aIncludeLabel = true 
)
static

Definition at line 607 of file toolbars_pcb_editor.cpp.

608 {
609  wxString text;
610  const wxChar* format;
611 
612  switch( aUnits )
613  {
614  default: wxASSERT_MSG( false, "Invalid unit" ); KI_FALLTHROUGH;
615  case EDA_UNITS::UNSCALED: format = wxT( "%.0f" ); break;
616  case EDA_UNITS::MILLIMETRES: format = wxT( "%.3f" ); break;
617  case EDA_UNITS::MILS: format = wxT( "%.2f" ); break;
618  case EDA_UNITS::INCHES: format = wxT( "%.5f" ); break;
619  }
620 
621  text.Printf( format, To_User_Unit( aUnits, aValue ) );
622 
623  if( aIncludeLabel )
624  {
625  text += " ";
627  }
628 
629  return text;
630 }
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:83
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:424
double To_User_Unit(EDA_UNITS aUnit, double aValue)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
Definition: base_units.cpp:68

References DISTANCE, GetAbbreviatedUnitsLabel(), INCHES, KI_FALLTHROUGH, MILLIMETRES, MILS, text, To_User_Unit(), and UNSCALED.

Referenced by PCB_EDIT_FRAME::UpdateTrackWidthSelectBox(), and PCB_EDIT_FRAME::UpdateViaSizeSelectBox().

Variable Documentation

◆ ICON_BLACK

COLOR4D ICON_BLACK { 0.28, 0.28, 0.28, 1.0 }
static

Definition at line 95 of file toolbars_pcb_editor.cpp.

Referenced by PCB_EDIT_FRAME::PrepareLayerIndicator().

◆ ICON_WHITE

COLOR4D ICON_WHITE { 0.86, 0.86, 0.86, 1.0 }
static

Definition at line 94 of file toolbars_pcb_editor.cpp.

Referenced by PCB_EDIT_FRAME::PrepareLayerIndicator().

◆ LayerPairBitmap

std::unique_ptr<wxBitmap> LayerPairBitmap
static

Definition at line 59 of file toolbars_pcb_editor.cpp.

Referenced by PCB_EDIT_FRAME::PrepareLayerIndicator().

◆ s_BitmapLayerIcon

const char s_BitmapLayerIcon[BM_LAYERICON_SIZE][BM_LAYERICON_SIZE]
static

Definition at line 62 of file toolbars_pcb_editor.cpp.

Referenced by PCB_EDIT_FRAME::PrepareLayerIndicator().