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 <lib_polyline.h>
28 #include <page_info.h>
30 #include <pgm_base.h>
31 #include <sch_bus_entry.h>
32 #include <sch_junction.h>
33 #include <sch_line.h>
34 #include <sch_no_connect.h>
35 #include <sch_painter.h>
36 #include <sch_preview_panel.h>
37 #include <sch_text.h>
41 #include <title_block.h>
42 #include <view/view.h>
44 #include <sch_base_frame.h>
45 #include <widgets/color_swatch.h>
46 
47 
49  wxWindow* aParent ) :
50  PANEL_COLOR_SETTINGS( aParent ),
51  m_frame( aFrame ),
52  m_preview( nullptr ),
53  m_page( nullptr ),
54  m_titleBlock( nullptr ),
55  m_drawingSheet( nullptr ),
56  m_previewItems()
57 {
58  m_colorNamespace = "schematic";
59 
60  SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
61 
62  mgr.ReloadColorSettings();
63 
64  COMMON_SETTINGS* common_settings = Pgm().GetCommonSettings();
65  EESCHEMA_SETTINGS* app_settings = mgr.GetAppSettings<EESCHEMA_SETTINGS>();
66  COLOR_SETTINGS* current = mgr.GetColorSettings( app_settings->m_ColorTheme );
67 
68  // Saved theme doesn't exist? Reset to default
69  if( current->GetFilename() != app_settings->m_ColorTheme )
70  app_settings->m_ColorTheme = current->GetFilename();
71 
72  createThemeList( app_settings->m_ColorTheme );
73 
74  m_optOverrideColors->SetValue( current->GetOverrideSchItemColors() );
75 
76  m_currentSettings = new COLOR_SETTINGS( *current );
77 
78  for( int id = SCH_LAYER_ID_START; id < SCH_LAYER_ID_END; id++ )
79  m_validLayers.push_back( id );
80 
82 
84 
85  m_galDisplayOptions.ReadConfig( *common_settings, app_settings->m_Window, this );
87 
88  auto type = static_cast<EDA_DRAW_PANEL_GAL::GAL_TYPE>( app_settings->m_Graphics.canvas_type );
89 
90  m_preview = new SCH_PREVIEW_PANEL( this, wxID_ANY, wxDefaultPosition, wxSize( -1, -1 ),
91  m_galDisplayOptions, type );
92  m_preview->SetStealsFocus( false );
93  m_preview->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER );
94  m_preview->GetGAL()->SetAxesEnabled( false );
95 
96  m_colorsMainSizer->Add( 10, 0, 0, wxEXPAND, 5 );
97  m_colorsMainSizer->Add( m_preview, 1, wxALL | wxEXPAND, 5 );
98  m_colorsMainSizer->Add( 10, 0, 0, wxEXPAND, 5 );
99 
101  updatePreview();
102  zoomFitPreview();
103 }
104 
105 
107 {
108  delete m_page;
109  delete m_titleBlock;
110  delete m_drawingSheet;
111  delete m_currentSettings;
112 
113  for( EDA_ITEM* item : m_previewItems )
114  delete item;
115 }
116 
117 
119 {
121 
122  if( !saveCurrentTheme( true ) )
123  return false;
124 
126 
127  SETTINGS_MANAGER& settingsMgr = Pgm().GetSettingsManager();
128  EESCHEMA_SETTINGS* app_settings = settingsMgr.GetAppSettings<EESCHEMA_SETTINGS>();
129  app_settings->m_ColorTheme = m_currentSettings->GetFilename();
130 
131  return true;
132 }
133 
134 
136 {
137  zoomFitPreview();
138  return true;
139 }
140 
141 
143 {
145 
146  for( SCH_LAYER_ID layer = SCH_LAYER_ID_START; layer < SCH_LAYER_ID_END; ++layer )
147  {
148  if( bgcolor == m_currentSettings->GetColor( layer )
149  && layer != LAYER_SCHEMATIC_BACKGROUND && layer != LAYER_SHEET_BACKGROUND )
150  {
151  wxString msg = _( "Some items have the same color as the background\n"
152  "and they will not be seen on the screen. Are you\n"
153  "sure you want to use these colors?" );
154 
155  if( wxMessageBox( msg, _( "Warning" ), wxYES_NO | wxICON_QUESTION, this ) == wxNO )
156  return false;
157 
158  break;
159  }
160  }
161 
162  return true;
163 }
164 
165 
167 {
168  for( auto layer : m_validLayers )
169  {
171 
172  // Do not allow non-background layers to be completely white.
173  // This ensures the BW printing recognizes that the colors should be printed black.
175  && layer != LAYER_SHEET_BACKGROUND )
176  {
177  color.Darken( 0.01 );
178  }
179 
180  m_currentSettings->SetColor( layer, color );
181  }
182 
183  return PANEL_COLOR_SETTINGS::saveCurrentTheme( aValidate );
184 }
185 
186 
188 {
189  std::vector<SCH_LAYER_ID> layers;
190 
192  layers.push_back( i );
193 
194  std::sort( layers.begin(), layers.end(),
195  []( SCH_LAYER_ID a, SCH_LAYER_ID b )
196  {
197  return LayerName( a ) < LayerName( b );
198  } );
199 
200  for( int layer : layers )
201  {
202  wxString name = LayerName( layer );
203 
204  if( layer == LAYER_SCHEMATIC_GRID_AXES )
205  name += wxS( " " ) + _( "(symbol editor only)" );
206 
207  createSwatch( layer, name );
208  }
209 
210  // Give a minimal width to m_colorsListWindow, in order to always having
211  // a full row shown
212  int min_width = m_colorsGridSizer->GetMinSize().x;
213  const int margin = 20; // A margin around the sizer
214  m_colorsListWindow->SetMinSize( wxSize( min_width + margin, -1 ) );
215 }
216 
217 
219 {
220  updatePreview();
221 }
222 
223 
225 {
226 public:
229  {
231  };
232 };
233 
234 
236 {
237  KIGFX::VIEW* view = m_preview->GetView();
238 
241  m_titleBlock->SetTitle( _( "Color Preview" ) );
242  m_titleBlock->SetDate( wxDateTime::Now().FormatDate() );
243 
244  m_page->SetHeightMils( 5000 );
245  m_page->SetWidthMils( 6000 );
246 
249  view->Add( m_drawingSheet );
250 
251  // NOTE: It would be nice to parse a schematic file here.
252  // This is created from the color_settings.sch file in demos folder
253 
254  auto addItem = [&]( EDA_ITEM* aItem )
255  {
256  view->Add( aItem );
257  m_previewItems.push_back( aItem );
258  };
259 
260  std::vector<std::pair<SCH_LAYER_ID, std::pair<wxPoint, wxPoint>>> lines = {
261  { LAYER_WIRE, { { 1950, 1500 }, { 2325, 1500 } } },
262  { LAYER_WIRE, { { 1950, 2600 }, { 2350, 2600 } } },
263  { LAYER_WIRE, { { 2150, 1700 }, { 2325, 1700 } } },
264  { LAYER_WIRE, { { 2150, 2000 }, { 2150, 1700 } } },
265  { LAYER_WIRE, { { 2925, 1600 }, { 3075, 1600 } } },
266  { LAYER_WIRE, { { 3075, 1600 }, { 3075, 2000 } } },
267  { LAYER_WIRE, { { 3075, 1600 }, { 3250, 1600 } } },
268  { LAYER_WIRE, { { 3075, 2000 }, { 2150, 2000 } } },
269  { LAYER_BUS, { { 1750, 1400 }, { 1850, 1400 } } },
270  { LAYER_BUS, { { 1850, 2500 }, { 1850, 1400 } } },
271  { LAYER_NOTES, { { 2350, 2125 }, { 2350, 2300 } } },
272  { LAYER_NOTES, { { 2350, 2125 }, { 2950, 2125 } } },
273  { LAYER_NOTES, { { 2950, 2125 }, { 2950, 2300 } } },
274  { LAYER_NOTES, { { 2950, 2300 }, { 2350, 2300 } } }
275  };
276 
277  for( const auto& line : lines )
278  {
279  SCH_LINE* wire = new SCH_LINE;
280  wire->SetLayer( line.first );
281  wire->SetStartPoint( wxPoint( Mils2iu( line.second.first.x ),
282  Mils2iu( line.second.first.y ) ) );
283  wire->SetEndPoint( wxPoint( Mils2iu( line.second.second.x ),
284  Mils2iu( line.second.second.y ) ) );
285  addItem( wire );
286  }
287 
288 #define MILS_POINT( x, y ) wxPoint( Mils2iu( x ), Mils2iu( y ) )
289 
290  SCH_NO_CONNECT* nc = new SCH_NO_CONNECT;
291  nc->SetPosition( MILS_POINT( 2525, 1300 ) );
292  addItem( nc );
293 
295  e1->SetPosition( MILS_POINT( 1850, 1400 ) );
296  addItem( e1 );
297 
299  e2->SetPosition( MILS_POINT( 1850, 2500 ) );
300  addItem( e2 );
301 
302  SCH_TEXT* t1 = new SCH_TEXT( MILS_POINT( 2850, 2250 ), wxT( "PLAIN TEXT" ) );
303  t1->SetLabelSpinStyle( LABEL_SPIN_STYLE::SPIN::LEFT );
304  addItem( t1 );
305 
306  SCH_LABEL* t2 = new SCH_LABEL( MILS_POINT( 1975, 1500 ), wxT( "LABEL_{0}" ) );
307  t2->SetLabelSpinStyle( LABEL_SPIN_STYLE::SPIN::RIGHT );
308  t2->SetIsDangling( false );
309  addItem( t2 );
310 
311  SCH_LABEL* t3 = new SCH_LABEL( MILS_POINT( 1975, 2600 ), wxT( "LABEL_{1}" ) );
312  t3->SetLabelSpinStyle( LABEL_SPIN_STYLE::SPIN::RIGHT );
313  t3->SetIsDangling( false );
314  addItem( t3 );
315 
316  SCH_GLOBALLABEL* t4 = new SCH_GLOBALLABEL( MILS_POINT( 1750, 1400 ), wxT( "GLOBAL[3..0]" ) );
317  t4->SetLabelSpinStyle( LABEL_SPIN_STYLE::SPIN::LEFT );
318  t4->SetIsDangling( false );
319  addItem( t4 );
320 
321  SCH_HIERLABEL* t5 = new SCH_HIERLABEL( MILS_POINT( 3250, 1600 ), wxT( "HIER_LABEL" ) );
322  t5->SetLabelSpinStyle( LABEL_SPIN_STYLE::SPIN::RIGHT );
323  t5->SetIsDangling( false );
324  addItem( t5 );
325 
326  SCH_JUNCTION* j = new SCH_JUNCTION( MILS_POINT( 3075, 1600 ) );
327  addItem( j );
328 
329  t2->SetSelected();
330 
331  {
332  LIB_PART* part = new LIB_PART( wxEmptyString );
333  wxPoint p( 2625, -1600 );
334 
335  LIB_FIELD& ref = part->GetReferenceField();
336 
337  ref.SetText( wxT( "U1" ) );
338  ref.SetPosition( MILS_POINT( p.x + 30, p.y + 260 ) );
340 
341  LIB_FIELD& value = part->GetValueField();
342 
343  value.SetText( wxT( "OPA604" ) );
344  value.SetPosition( MILS_POINT( p.x + 30, p.y + 180 ) );
346 
347  part->SetShowPinNames( true );
348  part->SetShowPinNumbers( true );
349  part->SetPinNameOffset( 0 );
350 
351  LIB_POLYLINE* comp_body = new LIB_POLYLINE( part );
352 
353  comp_body->SetUnit( 0 );
354  comp_body->SetConvert( 0 );
355  comp_body->SetWidth( Mils2iu( 10 ) );
357  comp_body->AddPoint( MILS_POINT( p.x - 200, p.y + 200 ) );
358  comp_body->AddPoint( MILS_POINT( p.x + 200, p.y ) );
359  comp_body->AddPoint( MILS_POINT( p.x - 200, p.y - 200 ) );
360  comp_body->AddPoint( MILS_POINT( p.x - 200, p.y + 200 ) );
361 
362  addItem( comp_body );
363 
364  LIB_PIN* pin = new LIB_PIN( part );
365 
366  pin->SetPosition( MILS_POINT( p.x - 200, p.y + 100 ) );
367  pin->SetLength( Mils2iu( 100 ) );
368  pin->SetOrientation( PIN_LEFT );
370  pin->SetNumber( wxT( "1" ) );
371  pin->SetName( wxT( "-" ) );
372 
373  part->AddDrawItem( pin );
374 
375  pin = new LIB_PIN( part );
376 
377  pin->SetPosition( MILS_POINT( p.x - 200, p.y - 100 ) );
378  pin->SetLength( Mils2iu( 100 ) );
379  pin->SetOrientation( PIN_LEFT );
381  pin->SetNumber( wxT( "2" ) );
382  pin->SetName( wxT( "+" ) );
383 
384  part->AddDrawItem( pin );
385 
386  pin = new LIB_PIN( part );
387 
388  pin->SetPosition( MILS_POINT( p.x + 200, p.y ) );
389  pin->SetLength( Mils2iu( 100 ) );
390  pin->SetOrientation( PIN_RIGHT );
392  pin->SetNumber( wxT( "3" ) );
393  pin->SetName( wxT( "OUT" ) );
394 
395  part->AddDrawItem( pin );
396 
397  addItem( part );
398  }
399 
400  SCH_SHEET* s = new SCH_SHEET( nullptr, MILS_POINT( 4000, 1300 ) );
401  s->SetSize( wxSize( Mils2iu( 800 ), Mils2iu( 1300 ) ) );
402  s->GetFields().at( SHEETNAME ).SetText( wxT( "SHEET" ) );
403  s->GetFields().at( SHEETFILENAME ).SetText( _( "/path/to/sheet" ) );
404  s->AutoplaceFields( nullptr, false );
405  addItem( s );
406 
407  SCH_SHEET_PIN* sp = new SCH_SHEET_PIN( s, MILS_POINT( 4500, 1500 ), wxT( "SHEET PIN" ) );
408  addItem( sp );
409 
410  zoomFitPreview();
411 }
412 
413 
415 {
416  updatePreview();
417 }
418 
419 
421 {
423  updatePreview();
424 }
425 
426 
428 {
429  if( !m_preview )
430  return;
431 
432  KIGFX::VIEW* view = m_preview->GetView();
433  auto settings = static_cast<KIGFX::SCH_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
434  settings->LoadColors( m_currentSettings );
435 
436  m_preview->GetGAL()->SetClearColor( settings->GetBackgroundColor() );
437 
438  view->UpdateAllItems( KIGFX::COLOR );
439  auto rect = m_preview->GetScreenRect();
440  m_preview->Refresh( true, &rect );
441 }
442 
443 
445 {
446  auto view = m_preview->GetView();
447 
448  view->SetScale( 1.0 );
449  VECTOR2D screenSize = view->ToWorld( m_preview->GetClientSize(), false );
450 
451  VECTOR2I psize( m_page->GetWidthIU(), m_page->GetHeightIU() );
452  double scale = view->GetScale() / std::max( fabs( psize.x / screenSize.x ),
453  fabs( psize.y / screenSize.y ) );
454 
455  view->SetScale( scale * 1.1 );
456  view->SetCenter( m_drawingSheet->ViewBBox().Centre() );
458 }
459 
460 
461 void PANEL_EESCHEMA_COLOR_SETTINGS::OnSize( wxSizeEvent& aEvent )
462 {
463  zoomFitPreview();
464  aEvent.Skip();
465 }
466 
467 
469 {
471 
472  // If the theme is not overriding individual item colors then don't show them so that
473  // the user doesn't get seduced into thinking they'll have some effect.
476 
479 
480  m_colorsGridSizer->Layout();
481  m_colorsListWindow->Layout();
482 }
void ResetPanel() override
Reset the contents of this panel.
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void SetClearColor(const COLOR4D &aColor)
void ForceRefresh()
Force a redraw.
virtual bool saveCurrentTheme(bool aValidate)
void SetOrientation(int aOrientation)
Definition: lib_pin.h:126
void SetColorLayer(int aLayerId)
Can be used to override which layer ID is used for worksheet item colors.
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:267
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition: view.cpp:1412
void SetPosition(const wxPoint &aPosition) override
LIB_FIELD & GetValueField()
Return reference to the value field.
Definition: lib_symbol.cpp:977
void SetDate(const wxString &aDate)
Set the date field, and defaults to the current time and date.
Definition: title_block.h:71
void SetLength(int aLength)
Definition: lib_pin.h:132
static const wxChar Custom[]
"User" defined page type
Definition: page_info.h:77
std::map< int, COLOR_SWATCH * > m_swatches
bool m_forceDisplayCursor
The pixel scale factor (>1 for hi-DPI scaled displays)
Color has changed.
Definition: view_item.h:53
void SetIsDangling(bool aIsDangling)
Definition: sch_text.h:304
void OnSize(wxSizeEvent &aEvent) override
void SetPosition(const wxPoint &aPos) override
Definition: lib_pin.h:259
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:106
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:40
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:207
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 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
std::vector< SCH_FIELD > & GetFields()
Definition: sch_sheet.h:270
#define MILS_POINT(x, y)
void SetType(ELECTRICAL_PINTYPE aType)
Definition: lib_pin.h:135
LIB_FIELD & GetReferenceField()
Return reference to the reference designator field.
Definition: lib_symbol.cpp:985
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:121
void SetSelected()
Definition: eda_item.h:178
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)
void AddDrawItem(LIB_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
Definition: lib_symbol.cpp:655
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
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:294
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.
Definition: lib_symbol.h:93
bool m_isDanglingStart
void SetLabelSpinStyle(LABEL_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Definition: sch_text.cpp:1366
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
virtual KIGFX::VIEW * GetView() const
Return 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:58
void SetAxesEnabled(bool aAxesEnabled)
Enable 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 SetSize(const wxSize &aSize)
Definition: sch_sheet.h:288
void SetConvert(int aConvert)
Definition: lib_item.h:264
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
Definition: view.cpp:553
void OnOverrideItemColorsClicked(wxCommandEvent &aEvent) override
Definition: color4d.h:48
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
void SetUnit(int aUnit)
Definition: lib_item.h:261
COLOR4D GetColor(int aLayer) const
WINDOW_SETTINGS m_Window
Definition: app_settings.h:181
void ReloadColorSettings()
Re-scans the color themes directory, reloading any changes it finds.
const int scale
see class PGM_BASE
const BOX2I ViewBBox() const override
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.
Definition: lib_symbol.h:570
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
bool m_isDanglingEnd
void ReadConfig(COMMON_SETTINGS &aCommonConfig, WINDOW_SETTINGS &aWindowConfig, wxWindow *aWindow)
Read application and common configs.
#define IU_PER_MILS
Definition: plotter.cpp:137
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:149
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:215
bool GetOverrideSchItemColors() const
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:321
void SetLabelSpinStyle(LABEL_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Definition: sch_text.cpp:948
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_sheet.cpp:516
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:67
virtual void SetLabelSpinStyle(LABEL_SPIN_STYLE aSpinStyle)
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Definition: sch_text.cpp:248
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.
Definition: lib_symbol.h:562
void SetPinNameOffset(int aOffset)
Set the offset in mils of the pin name text from the pin symbol.
Definition: lib_symbol.h:554
void createSwatch(int aLayer, const wxString &aName)
KIGFX::GAL_DISPLAY_OPTIONS m_galDisplayOptions
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
SCH_BUS_WIRE_ENTRY_PREVIEW_ITEM()
void SetColor(int aLayer, COLOR4D aColor)
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:184
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98