KiCad PCB EDA Suite
panel_eeschema_color_settings.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
5  * Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #include <regex>
22 
23 #include <bitmaps.h>
24 #include <eeschema_settings.h>
27 #include <class_libentry.h>
28 #include <lib_polyline.h>
29 #include <page_info.h>
31 #include <pgm_base.h>
32 #include <sch_bus_entry.h>
33 #include <sch_junction.h>
34 #include <sch_line.h>
35 #include <sch_no_connect.h>
36 #include <sch_painter.h>
37 #include <sch_preview_panel.h>
38 #include <sch_text.h>
42 #include <title_block.h>
43 #include <view/view.h>
45 #include <sch_base_frame.h>
46 #include <widgets/color_swatch.h>
47 
48 
50  wxWindow* aParent ) :
51  PANEL_COLOR_SETTINGS( aParent ),
52  m_frame( aFrame ),
53  m_preview( nullptr ),
54  m_page( nullptr ),
55  m_titleBlock( nullptr ),
56  m_ws( nullptr ),
57  m_previewItems()
58 {
59  m_colorNamespace = "schematic";
60 
61  SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
62 
63  mgr.ReloadColorSettings();
64 
65  COMMON_SETTINGS* common_settings = Pgm().GetCommonSettings();
66  EESCHEMA_SETTINGS* app_settings = mgr.GetAppSettings<EESCHEMA_SETTINGS>();
67  COLOR_SETTINGS* current = mgr.GetColorSettings( app_settings->m_ColorTheme );
68 
69  createThemeList( app_settings->m_ColorTheme );
70 
71  m_optOverrideColors->SetValue( current->GetOverrideSchItemColors() );
72 
73  m_currentSettings = new COLOR_SETTINGS( *current );
74 
75  for( int id = SCH_LAYER_ID_START; id < SCH_LAYER_ID_END; id++ )
76  m_validLayers.push_back( id );
77 
79 
81 
83  options.ReadConfig( *common_settings, app_settings->m_Window, this );
84  options.m_forceDisplayCursor = false;
85 
86  auto type = static_cast<EDA_DRAW_PANEL_GAL::GAL_TYPE>( app_settings->m_Graphics.canvas_type );
87 
88  m_preview = new SCH_PREVIEW_PANEL( this, wxID_ANY, wxDefaultPosition, wxSize( -1, -1 ),
89  options, type );
90  m_preview->SetStealsFocus( false );
91  m_preview->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER );
92  m_preview->GetGAL()->SetAxesEnabled( false );
93 
94  m_colorsMainSizer->Add( 10, 0, 0, wxEXPAND, 5 );
95  m_colorsMainSizer->Add( m_preview, 1, wxALL | wxEXPAND, 5 );
96  m_colorsMainSizer->Add( 10, 0, 0, wxEXPAND, 5 );
97 
99  updatePreview();
100  zoomFitPreview();
101 }
102 
103 
105 {
106  delete m_page;
107  delete m_titleBlock;
108  delete m_ws;
109  delete m_currentSettings;
110 
111  for( EDA_ITEM* item : m_previewItems )
112  delete item;
113 }
114 
115 
117 {
119 
120  if( !saveCurrentTheme( true ) )
121  return false;
122 
124 
125  SETTINGS_MANAGER& settingsMgr = Pgm().GetSettingsManager();
126  EESCHEMA_SETTINGS* app_settings = settingsMgr.GetAppSettings<EESCHEMA_SETTINGS>();
127  app_settings->m_ColorTheme = m_currentSettings->GetFilename();
128 
129  return true;
130 }
131 
132 
134 {
135  zoomFitPreview();
136  return true;
137 }
138 
139 
141 {
143 
144  for( SCH_LAYER_ID layer = SCH_LAYER_ID_START; layer < SCH_LAYER_ID_END; ++layer )
145  {
146  if( bgcolor == m_currentSettings->GetColor( layer )
147  && layer != LAYER_SCHEMATIC_BACKGROUND && layer != LAYER_SHEET_BACKGROUND )
148  {
149  wxString msg = _( "Some items have the same color as the background\n"
150  "and they will not be seen on the screen. Are you\n"
151  "sure you want to use these colors?" );
152 
153  if( wxMessageBox( msg, _( "Warning" ), wxYES_NO | wxICON_QUESTION, this ) == wxNO )
154  return false;
155 
156  break;
157  }
158  }
159 
160  return true;
161 }
162 
163 
165 {
166  for( auto layer : m_validLayers )
167  {
169 
170  // Do not allow non-background layers to be completely white.
171  // This ensures the BW printing recognizes that the colors should be printed black.
173  && layer != LAYER_SHEET_BACKGROUND )
174  {
175  color.Darken( 0.01 );
176  }
177 
178  m_currentSettings->SetColor( layer, color );
179  }
180 
181  return PANEL_COLOR_SETTINGS::saveCurrentTheme( aValidate );
182 }
183 
184 
186 {
187  std::vector<SCH_LAYER_ID> layers;
188 
190  layers.push_back( i );
191 
192  std::sort( layers.begin(), layers.end(),
193  []( SCH_LAYER_ID a, SCH_LAYER_ID b )
194  {
195  return LayerName( a ) < LayerName( b );
196  } );
197 
198  for( int layer : layers )
199  {
200  wxString name = LayerName( layer );
201 
202  if( layer == LAYER_SCHEMATIC_GRID_AXES )
203  name += wxS( " " ) + _( "(symbol editor only)" );
204 
205  createSwatch( layer, name );
206  }
207 
208  // Give a minimal width to m_colorsListWindow, in order to always having
209  // a full row shown
210  int min_width = m_colorsGridSizer->GetMinSize().x;
211  const int margin = 20; // A margin around the sizer
212  m_colorsListWindow->SetMinSize( wxSize( min_width + margin, -1 ) );
213 }
214 
215 
217 {
218  updatePreview();
219 }
220 
221 
223 {
224  KIGFX::VIEW* view = m_preview->GetView();
225 
228  m_titleBlock->SetTitle( _( "Color Preview" ) );
229  m_titleBlock->SetDate( wxDateTime::Now().FormatDate() );
230 
231  m_page->SetHeightMils( 5000 );
232  m_page->SetWidthMils( 6000 );
233 
236  view->Add( m_ws );
237 
238  // NOTE: It would be nice to parse a schematic file here.
239  // This is created from the color_settings.sch file in demos folder
240 
241  auto addItem = [&]( EDA_ITEM* aItem )
242  {
243  view->Add( aItem );
244  m_previewItems.push_back( aItem );
245  };
246 
247  std::vector<std::pair<SCH_LAYER_ID, std::pair<wxPoint, wxPoint>>> lines = {
248  { LAYER_WIRE, { { 1950, 1500 }, { 2325, 1500 } } },
249  { LAYER_WIRE, { { 1950, 2600 }, { 2350, 2600 } } },
250  { LAYER_WIRE, { { 2150, 1700 }, { 2325, 1700 } } },
251  { LAYER_WIRE, { { 2150, 2000 }, { 2150, 1700 } } },
252  { LAYER_WIRE, { { 2925, 1600 }, { 3075, 1600 } } },
253  { LAYER_WIRE, { { 3075, 1600 }, { 3075, 2000 } } },
254  { LAYER_WIRE, { { 3075, 1600 }, { 3250, 1600 } } },
255  { LAYER_WIRE, { { 3075, 2000 }, { 2150, 2000 } } },
256  { LAYER_BUS, { { 1750, 1400 }, { 1850, 1400 } } },
257  { LAYER_BUS, { { 1850, 2500 }, { 1850, 1400 } } },
258  { LAYER_NOTES, { { 2350, 2125 }, { 2350, 2300 } } },
259  { LAYER_NOTES, { { 2350, 2125 }, { 2950, 2125 } } },
260  { LAYER_NOTES, { { 2950, 2125 }, { 2950, 2300 } } },
261  { LAYER_NOTES, { { 2950, 2300 }, { 2350, 2300 } } }
262  };
263 
264  for( const auto& line : lines )
265  {
266  SCH_LINE* wire = new SCH_LINE;
267  wire->SetLayer( line.first );
268  wire->SetStartPoint( wxPoint( Mils2iu( line.second.first.x ),
269  Mils2iu( line.second.first.y ) ) );
270  wire->SetEndPoint( wxPoint( Mils2iu( line.second.second.x ),
271  Mils2iu( line.second.second.y ) ) );
272  addItem( wire );
273  }
274 
275  auto nc = new SCH_NO_CONNECT;
276  nc->SetPosition( wxPoint( Mils2iu( 2525 ), Mils2iu( 1300 ) ) );
277  addItem( nc );
278 
279  auto e1 = new SCH_BUS_WIRE_ENTRY;
280  e1->SetPosition( wxPoint( Mils2iu( 1850 ), Mils2iu( 1400 ) ) );
281  addItem( e1 );
282 
283  auto e2 = new SCH_BUS_WIRE_ENTRY;
284  e2->SetPosition( wxPoint( Mils2iu( 1850 ), Mils2iu( 2500 ) ) );
285  addItem( e2 );
286 
287  auto t1 = new SCH_TEXT( wxPoint( Mils2iu( 2850 ), Mils2iu( 2250 ) ), wxT( "PLAIN TEXT" ) );
288  t1->SetLabelSpinStyle( LABEL_SPIN_STYLE::SPIN::LEFT );
289  addItem( t1 );
290 
291  auto t2 = new SCH_LABEL( wxPoint( Mils2iu( 1975 ), Mils2iu( 1500 ) ), wxT( "LABEL_{0}" ) );
292  t2->SetLabelSpinStyle( LABEL_SPIN_STYLE::SPIN::RIGHT );
293  t2->SetIsDangling( false );
294  addItem( t2 );
295 
296  auto t3 = new SCH_LABEL( wxPoint( Mils2iu( 1975 ), Mils2iu( 2600 ) ), wxT( "LABEL_{1}" ) );
297  t3->SetLabelSpinStyle( LABEL_SPIN_STYLE::SPIN::RIGHT );
298  t3->SetIsDangling( false );
299  addItem( t3 );
300 
301  auto t4 = new SCH_GLOBALLABEL( wxPoint( Mils2iu( 1750 ), Mils2iu( 1400 ) ), wxT( "GLOBAL[3..0]" ) );
302  t4->SetLabelSpinStyle( LABEL_SPIN_STYLE::SPIN::LEFT );
303  t4->SetIsDangling( false );
304  addItem( t4 );
305 
306  auto t5 = new SCH_HIERLABEL( wxPoint( Mils2iu( 3250 ), Mils2iu( 1600 ) ), wxT( "HIER_LABEL" ) );
307  t5->SetLabelSpinStyle( LABEL_SPIN_STYLE::SPIN::RIGHT );
308  t5->SetIsDangling( false );
309  addItem( t5 );
310 
311  auto j = new SCH_JUNCTION( wxPoint( Mils2iu( 3075 ), Mils2iu( 1600 ) ) );
312  addItem( j );
313 
314  e2->SetBrightened();
315  t2->SetSelected();
316 
317  {
318  LIB_PART* part = new LIB_PART( wxEmptyString );
319  wxPoint p( 2625, -1600 );
320 
321  LIB_FIELD& ref = part->GetReferenceField();
322 
323  ref.SetText( wxT( "U1" ) );
324  ref.SetPosition( wxPoint( Mils2iu( p.x + 30 ), Mils2iu( p.y + 260 ) ) );
326 
327  LIB_FIELD& value = part->GetValueField();
328 
329  value.SetText( wxT( "OPA604" ) );
330  value.SetPosition( wxPoint( Mils2iu( p.x + 30 ), Mils2iu( p.y + 180 ) ) );
332 
333  part->SetShowPinNames( true );
334  part->SetShowPinNumbers( true );
335  part->SetPinNameOffset( 0 );
336 
337  addItem( part );
338 
339  LIB_POLYLINE* comp_body = new LIB_POLYLINE( part );
340 
341  comp_body->SetUnit( 0 );
342  comp_body->SetConvert( 0 );
343  comp_body->SetWidth( Mils2iu( 10 ) );
345  comp_body->AddPoint( wxPoint( Mils2iu( p.x - 200 ), Mils2iu( p.y + 200 ) ) );
346  comp_body->AddPoint( wxPoint( Mils2iu( p.x + 200 ), Mils2iu( p.y ) ) );
347  comp_body->AddPoint( wxPoint( Mils2iu( p.x - 200 ), Mils2iu( p.y - 200 ) ) );
348  comp_body->AddPoint( wxPoint( Mils2iu( p.x - 200 ), Mils2iu( p.y + 200 ) ) );
349 
350  addItem( comp_body );
351 
352  LIB_PIN* pin = new LIB_PIN( part );
353 
354  pin->SetPosition( wxPoint( Mils2iu( p.x - 200 ), Mils2iu( p.y + 100 ) ) );
355  pin->SetLength( Mils2iu( 100 ) );
356  pin->SetOrientation( PIN_LEFT );
358  pin->SetNumber( wxT( "1" ) );
359  pin->SetName( wxT( "-" ) );
360 
361  part->AddDrawItem( pin );
362 
363  pin = new LIB_PIN( part );
364 
365  pin->SetPosition( wxPoint( Mils2iu( p.x - 200 ), Mils2iu( p.y - 100 ) ) );
366  pin->SetLength( Mils2iu( 100 ) );
367  pin->SetOrientation( PIN_LEFT );
369  pin->SetNumber( wxT( "2" ) );
370  pin->SetName( wxT( "+" ) );
371 
372  part->AddDrawItem( pin );
373 
374  pin = new LIB_PIN( part );
375 
376  pin->SetPosition( wxPoint( Mils2iu( p.x + 200 ), Mils2iu( p.y ) ) );
377  pin->SetLength( Mils2iu( 100 ) );
378  pin->SetOrientation( PIN_RIGHT );
380  pin->SetNumber( wxT( "3" ) );
381  pin->SetName( wxT( "OUT" ) );
382 
383  part->AddDrawItem( pin );
384  }
385 
386  auto s = new SCH_SHEET( nullptr, wxPoint( Mils2iu( 4000 ), Mils2iu( 1300 ) ) );
387  s->SetSize( wxSize( Mils2iu( 800 ), Mils2iu( 1300 ) ) );
388  s->GetFields().at( SHEETNAME ).SetText( wxT( "SHEET" ) );
389  s->GetFields().at( SHEETFILENAME ).SetText( _( "/path/to/sheet" ) );
390  s->AutoplaceFields( nullptr, false );
391  addItem( s );
392 
393  auto sp = new SCH_SHEET_PIN( s, wxPoint( Mils2iu( 4500 ), Mils2iu( 1500 ) ), wxT( "SHEET PIN" ) );
394  addItem( sp );
395 
396  zoomFitPreview();
397 }
398 
399 
401 {
402  updatePreview();
403 }
404 
405 
407 {
409  updatePreview();
410 }
411 
412 
414 {
415  if( !m_preview )
416  return;
417 
418  KIGFX::VIEW* view = m_preview->GetView();
419  auto settings = static_cast<KIGFX::SCH_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
420  settings->LoadColors( m_currentSettings );
421 
422  m_preview->GetGAL()->SetClearColor( settings->GetBackgroundColor() );
423 
424  view->UpdateAllItems( KIGFX::COLOR );
425  auto rect = m_preview->GetScreenRect();
426  m_preview->Refresh( true, &rect );
427 }
428 
429 
431 {
432  auto view = m_preview->GetView();
433 
434  view->SetScale( 1.0 );
435  VECTOR2D screenSize = view->ToWorld( m_preview->GetClientSize(), false );
436 
437  VECTOR2I psize( m_page->GetWidthIU(), m_page->GetHeightIU() );
438  double scale = view->GetScale() / std::max( fabs( psize.x / screenSize.x ),
439  fabs( psize.y / screenSize.y ) );
440 
441  view->SetScale( scale * 1.1 );
442  view->SetCenter( m_ws->ViewBBox().Centre() );
444 }
445 
446 
447 void PANEL_EESCHEMA_COLOR_SETTINGS::OnSize( wxSizeEvent& aEvent )
448 {
449  zoomFitPreview();
450  aEvent.Skip();
451 }
452 
453 
455 {
457 
458  // If the theme is not overriding individual item colors then don't show them so that
459  // the user doesn't get seduced into thinking they'll have some effect.
462 
465 
466  m_colorsGridSizer->Layout();
467  m_colorsListWindow->Layout();
468 }
void ResetPanel() override
Reset the contents of this panel.
KIGFX::SCH_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
void SetClearColor(const COLOR4D &aColor)
void ForceRefresh()
Function ForceRefresh() Forces a redraw.
virtual bool saveCurrentTheme(bool aValidate)
void SetOrientation(int aOrientation)
Definition: lib_pin.h:126
virtual void ResetPanel() override
Reset the contents of this panel.
wxString GetFilename() const
Definition: json_settings.h:64
int color
Definition: DXF_plotter.cpp:60
Field object used in symbol libraries.
Definition: lib_field.h:59
std::map< int, wxStaticText * > m_labels
void SetFillMode(FILL_TYPE aFillMode)
Definition: lib_item.h:301
void UpdateAllItems(int aUpdateFlags)
Updates all items in the view according to the given flags.
Definition: view.cpp:1417
void SetPosition(const wxPoint &aPosition) override
LIB_FIELD & GetValueField()
Return reference to the value field.
void SetDate(const wxString &aDate)
Function SetDate sets the date field, and defaults to the current time and date.
Definition: title_block.h:74
void SetLength(int aLength)
Definition: lib_pin.h:132
static const wxChar Custom[]
"User" defined page type
Definition: page_info.h:79
std::map< int, COLOR_SWATCH * > m_swatches
bool m_forceDisplayCursor
Force cursor display
Visibility flag has changed.
Definition: view_item.h:58
void OnSize(wxSizeEvent &aEvent) override
void SetPosition(const wxPoint &aPos) override
Definition: lib_pin.h:259
void SetColorLayer(int aLayerId)
Can be used to override which layer ID is used for worksheet item colors.
void SetWidth(int aWidth) override
Definition: lib_polyline.h:103
bool validateSave(bool aQuiet=false) override
Performs a pre-save validation of the current color theme.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:102
TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout,...
Definition: title_block.h:40
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:201
void SetEndPoint(const wxPoint &aPosition)
Definition: sch_line.h:98
std::string m_colorNamespace
A namespace that will be passed to SETTINGS_MANAGER::SaveColorSettings.
bool saveCurrentTheme(bool aValidate) override
void AddDrawItem(LIB_ITEM *aItem)
Add a new draw aItem to the draw object list.
void onNewThemeSelected() override
Event fired when a new theme is selected that can be overridden in children.
void SetNumber(const wxString &aNumber)
Definition: lib_pin.h:166
void SetType(ELECTRICAL_PINTYPE aType)
Definition: lib_pin.h:135
LIB_FIELD & GetReferenceField()
Return reference to the reference designator field.
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:120
const BOX2I ViewBBox() const override
Function ViewBBox() returns the bounding box of the item covering all its layers.
void onColorChanged() override
Event fired when the user changes any color.
void SetPosition(const wxPoint &aPosition) override
PANEL_EESCHEMA_COLOR_SETTINGS(SCH_BASE_FRAME *aFrame, wxWindow *aParent)
PAGE_INFO describes the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
void createThemeList(const wxString &aCurrent)
COLOR_SETTINGS * m_currentSettings
void SetStartPoint(const wxPoint &aPosition)
Definition: sch_line.h:95
void SetLayer(SCH_LAYER_ID aLayer)
Set the layer this item is on.
Definition: sch_item.h:286
void SetOverrideSchItemColors(bool aFlag)
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void SetStealsFocus(bool aStealsFocus)
Set whether focus is taken on certain events (mouseover, keys, etc).
Define a library symbol object.
KIGFX::GAL * GetGAL() const
Function GetGAL() Returns a pointer to the GAL instance used in the panel.
virtual KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
AppSettings * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
Definition: layer_id.cpp:27
SCH_LAYER_ID
Eeschema drawing layers.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:85
void AddPoint(const wxPoint &aPoint)
void SetTitle(const wxString &aTitle)
Definition: title_block.h:60
void SetAxesEnabled(bool aAxesEnabled)
Enables drawing the axes.
void SetHeightMils(int aHeightInMils)
Definition: page_info.cpp:257
std::vector< int > m_validLayers
A list of layer IDs that are valid for the current color settings dialog.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:219
void SetConvert(int aConvert)
Definition: lib_item.h:298
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Function SetScale() Sets the scaling factor, zooming around a given anchor point.
Definition: view.cpp:559
void OnOverrideItemColorsClicked(wxCommandEvent &aEvent) override
Definition: color4d.h:49
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
virtual RENDER_SETTINGS * GetSettings()=0
Function GetAdapter Returns pointer to current settings that are going to be used when drawing items.
void SetUnit(int aUnit)
Definition: lib_item.h:295
COLOR4D GetColor(int aLayer) const
WINDOW_SETTINGS m_Window
Definition: app_settings.h:173
void ReloadColorSettings()
Re-scans the color themes directory, reloading any changes it finds.
const int scale
see class PGM_BASE
Board layer functions and definitions.
void SetName(const wxString &aName)
Definition: lib_pin.h:157
Vec Centre() const
Definition: box2.h:79
const char * name
Definition: DXF_plotter.cpp:59
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:37
void SetShowPinNumbers(bool aShow)
Set or clear the pin number visibility flag.
void SetHorizJustify(EDA_TEXT_HJUSTIFY_T aType)
Definition: eda_text.h:208
#define _(s)
Definition: 3d_actions.cpp:33
usual pin input: must be connected
void SetWidthMils(int aWidthInMils)
Definition: page_info.cpp:243
void ReadConfig(COMMON_SETTINGS &aCommonConfig, WINDOW_SETTINGS &aWindowConfig, wxWindow *aWindow)
Read application and common configs.
#define IU_PER_MILS
Definition: plotter.cpp:137
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: eda_item.h:148
Class for a wire to bus entry.
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SetPosition(const wxPoint &aPosition) override
Definition: lib_item.h:249
bool GetOverrideSchItemColors() const
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:327
VIEW.
Definition: view.h:63
void Refresh(bool aEraseBackground, const wxRect *aRect) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
void SetShowPinNames(bool aShow)
Set or clear the pin name visibility flag.
void SetPinNameOffset(int aOffset)
Set the offset in mils of the pin name text from the pin symbol.
void createSwatch(int aLayer, const wxString &aName)
A shim class between EDA_DRAW_FRAME and several derived classes: LIB_EDIT_FRAME, LIB_VIEW_FRAME,...
void SetColor(int aLayer, COLOR4D aColor)
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:176
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:100