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 <[email protected]>
5 * Copyright (C) 2020-2023 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 <eeschema_settings.h>
25#include <layer_ids.h>
26#include <lib_shape.h>
27#include <page_info.h>
29#include <pgm_base.h>
30#include <sch_bus_entry.h>
31#include <sch_junction.h>
32#include <sch_line.h>
33#include <sch_no_connect.h>
34#include <sch_painter.h>
35#include <sch_preview_panel.h>
36#include <sch_sheet_pin.h>
37#include <sch_text.h>
41#include <title_block.h>
42#include <view/view.h>
44#include <sch_base_frame.h>
46#include <widgets/wx_panel.h>
47#include <wx/msgdlg.h>
48
49
50std::set<int> g_excludedLayers =
51 {
54 };
55
56
58 PANEL_COLOR_SETTINGS( aParent ),
59 m_preview( nullptr ),
60 m_page( nullptr ),
61 m_titleBlock( nullptr ),
62 m_drawingSheet( nullptr ),
63 m_previewItems()
64{
65 m_colorNamespace = "schematic";
66
67 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
68 COMMON_SETTINGS* common_settings = Pgm().GetCommonSettings();
70 COLOR_SETTINGS* current = mgr.GetColorSettings( app_settings->m_ColorTheme );
71
72 // Saved theme doesn't exist? Reset to default
73 if( current->GetFilename() != app_settings->m_ColorTheme )
74 app_settings->m_ColorTheme = current->GetFilename();
75
76 createThemeList( app_settings->m_ColorTheme );
77
78 m_optOverrideColors->SetValue( current->GetOverrideSchItemColors() );
79
80 m_currentSettings = new COLOR_SETTINGS( *current );
81
82 for( int id = SCH_LAYER_ID_START; id < SCH_LAYER_ID_END; id++ )
83 {
84 if( g_excludedLayers.count( id ) )
85 continue;
86
87 m_validLayers.push_back( id );
88 }
89
91
92 m_galDisplayOptions.ReadConfig( *common_settings, app_settings->m_Window, this );
94
95 m_galType = static_cast<EDA_DRAW_PANEL_GAL::GAL_TYPE>( app_settings->m_Graphics.canvas_type );
96}
97
98
100{
101 delete m_page;
102 delete m_titleBlock;
103 delete m_drawingSheet;
104 delete m_currentSettings;
105
106 for( EDA_ITEM* item : m_previewItems )
107 delete item;
108}
109
110
112{
114
115 if( !saveCurrentTheme( true ) )
116 return false;
117
118 SETTINGS_MANAGER& settingsMgr = Pgm().GetSettingsManager();
119 EESCHEMA_SETTINGS* app_settings = settingsMgr.GetAppSettings<EESCHEMA_SETTINGS>();
120 app_settings->m_ColorTheme = m_currentSettings->GetFilename();
121
122 return true;
123}
124
125
127{
129 return true;
130}
131
132
134{
136
137 for( SCH_LAYER_ID layer = SCH_LAYER_ID_START; layer < SCH_LAYER_ID_END; ++layer )
138 {
139 if( bgcolor == m_currentSettings->GetColor( layer )
140 && layer != LAYER_SCHEMATIC_BACKGROUND && layer != LAYER_SHEET_BACKGROUND )
141 {
142 wxString msg = _( "Some items have the same color as the background\n"
143 "and they will not be seen on the screen. Are you\n"
144 "sure you want to use these colors?" );
145
146 if( wxMessageBox( msg, _( "Warning" ), wxYES_NO | wxICON_QUESTION, this ) == wxNO )
147 return false;
148
149 break;
150 }
151 }
152
153 return true;
154}
155
156
158{
159 for( int layer : m_validLayers )
160 {
162
163 // Do not allow non-background layers to be completely white.
164 // This ensures the BW printing recognizes that the colors should be printed black.
166 && layer != LAYER_SHEET_BACKGROUND )
167 {
168 color.Darken( 0.01 );
169 }
170
172 }
173
174 return PANEL_COLOR_SETTINGS::saveCurrentTheme( aValidate );
175}
176
177
179{
180 std::vector<SCH_LAYER_ID> layers;
181
183 {
184 if( g_excludedLayers.count( i ) )
185 continue;
186
187 layers.push_back( i );
188 }
189
190 std::sort( layers.begin(), layers.end(),
191 []( SCH_LAYER_ID a, SCH_LAYER_ID b )
192 {
193 return LayerName( a ) < LayerName( b );
194 } );
195
196 for( int layer : layers )
197 {
198 wxString name = LayerName( layer );
199
200 if( layer == LAYER_SCHEMATIC_GRID_AXES )
201 name += wxS( " " ) + _( "(symbol editor only)" );
202
203 createSwatch( layer, name );
204 }
205
206 // Give a minimal width to m_colorsListWindow, in order to always having
207 // a full row shown
208 int min_width = m_colorsGridSizer->GetMinSize().x;
209 const int margin = 20; // A margin around the sizer
210 m_colorsListWindow->SetMinSize( wxSize( min_width + margin, -1 ) );
211
212 m_preview = new SCH_PREVIEW_PANEL( m_panel1, wxID_ANY, wxDefaultPosition, wxSize( -1, -1 ),
214 m_preview->SetStealsFocus( false );
215 m_preview->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER );
216 m_preview->GetGAL()->SetAxesEnabled( false );
217
219 settings->m_IsSymbolEditor = true;
220
221 m_colorsMainSizer->Add( m_preview, 1, wxTOP | wxEXPAND, 1 );
222
223 m_colorsMainSizer->Layout();
224
228}
229
230
232{
234}
235
236
238{
239 KIGFX::VIEW* view = m_preview->GetView();
240
241 std::vector<DANGLING_END_ITEM> endPoints;
242
245 m_titleBlock->SetTitle( _( "Color Preview" ) );
246 m_titleBlock->SetDate( wxDateTime::Now().FormatDate() );
247
248 m_page->SetHeightMils( 5000 );
249 m_page->SetWidthMils( 6000 );
250
252 m_titleBlock, nullptr );
255 view->Add( m_drawingSheet );
256
257 // TODO: It would be nice to parse a schematic file here.
258 // This is created from the color_settings.sch file in demos folder
259
260 auto addItem = [&]( EDA_ITEM* aItem )
261 {
262 view->Add( aItem );
263 m_previewItems.push_back( aItem );
264 };
265
266 std::vector<std::pair<SCH_LAYER_ID, std::pair<VECTOR2I, VECTOR2I>>> lines = {
267 { LAYER_WIRE, { { 1950, 1500 }, { 2325, 1500 } } },
268 { LAYER_WIRE, { { 1950, 2600 }, { 2350, 2600 } } },
269 { LAYER_WIRE, { { 2150, 1700 }, { 2325, 1700 } } },
270 { LAYER_WIRE, { { 2150, 2000 }, { 2150, 1700 } } },
271 { LAYER_WIRE, { { 2925, 1600 }, { 3075, 1600 } } },
272 { LAYER_WIRE, { { 3075, 1600 }, { 3075, 2000 } } },
273 { LAYER_WIRE, { { 3075, 1600 }, { 3250, 1600 } } },
274 { LAYER_WIRE, { { 3075, 2000 }, { 2150, 2000 } } },
275 { LAYER_BUS, { { 1750, 1400 }, { 1850, 1400 } } },
276 { LAYER_BUS, { { 1850, 2500 }, { 1850, 1400 } } },
277 { LAYER_NOTES, { { 2350, 2125 }, { 2350, 2300 } } },
278 { LAYER_NOTES, { { 2350, 2125 }, { 2950, 2125 } } },
279 { LAYER_NOTES, { { 2950, 2125 }, { 2950, 2300 } } },
280 { LAYER_NOTES, { { 2950, 2300 }, { 2350, 2300 } } }
281 };
282
283 for( const std::pair<SCH_LAYER_ID, std::pair<VECTOR2I, VECTOR2I>>& line : lines )
284 {
285 SCH_LINE* wire = new SCH_LINE;
286 wire->SetLayer( line.first );
287 STROKE_PARAMS stroke = wire->GetStroke();
288 stroke.SetWidth( schIUScale.MilsToIU( 6 ) );
289
290 if( line.first != LAYER_NOTES )
291 {
293
294 if( line.first == LAYER_BUS )
295 stroke.SetWidth( schIUScale.MilsToIU( 12 ) );
296
297 }
298
299 wire->SetStroke( stroke );
300
301 wire->SetStartPoint( VECTOR2I( schIUScale.MilsToIU( line.second.first.x ),
302 schIUScale.MilsToIU( line.second.first.y ) ) );
303 wire->SetEndPoint( VECTOR2I( schIUScale.MilsToIU( line.second.second.x ),
304 schIUScale.MilsToIU( line.second.second.y ) ) );
305 addItem( wire );
306 }
307
308#define MILS_POINT( x, y ) VECTOR2I( schIUScale.MilsToIU( x ), schIUScale.MilsToIU( y ) )
309
311 nc->SetPosition( MILS_POINT( 2525, 1300 ) );
312 addItem( nc );
313
315 e1->SetPosition( MILS_POINT( 1850, 1400 ) );
316 addItem( e1 );
317
319 e2->SetPosition( MILS_POINT( 1850, 2500 ) );
320 addItem( e2 );
321
322 SCH_TEXT* t1 = new SCH_TEXT( MILS_POINT( 2850, 2250 ), wxT( "PLAIN TEXT" ) );
323 t1->SetTextSpinStyle( TEXT_SPIN_STYLE::SPIN::LEFT );
324 addItem( t1 );
325
326 SCH_LABEL* t2 = new SCH_LABEL( MILS_POINT( 1975, 1500 ), wxT( "LABEL_{0}" ) );
327 t2->SetTextSpinStyle( TEXT_SPIN_STYLE::SPIN::RIGHT );
328 t2->SetIsDangling( false );
329 addItem( t2 );
330
331 SCH_LABEL* t3 = new SCH_LABEL( MILS_POINT( 1975, 2600 ), wxT( "LABEL_{1}" ) );
332 t3->SetTextSpinStyle( TEXT_SPIN_STYLE::SPIN::RIGHT );
333 t3->SetIsDangling( false );
334 addItem( t3 );
335
336 SCH_GLOBALLABEL* t4 = new SCH_GLOBALLABEL( MILS_POINT( 1750, 1400 ), wxT( "GLOBAL[0..3]" ) );
337 t4->SetTextSpinStyle( TEXT_SPIN_STYLE::SPIN::LEFT );
338 t4->SetIsDangling( false );
339 addItem( t4 );
340
341 SCH_HIERLABEL* t5 = new SCH_HIERLABEL( MILS_POINT( 3250, 1600 ), wxT( "HIER_LABEL" ) );
342 t5->SetTextSpinStyle( TEXT_SPIN_STYLE::SPIN::RIGHT );
343 t5->SetIsDangling( false );
344 addItem( t5 );
345
346 SCH_JUNCTION* j = new SCH_JUNCTION( MILS_POINT( 3075, 1600 ) );
347 addItem( j );
348
349 t2->SetSelected();
350
351 {
352 auto mapLibItemPosition =
353 []( const VECTOR2I& aLibPosition ) -> VECTOR2I
354 {
355 return VECTOR2I( aLibPosition.x, -aLibPosition.y );
356 };
357
358 LIB_SYMBOL* symbol = new LIB_SYMBOL( wxEmptyString );
359 VECTOR2I p( 2625, -1600 );
360
361 LIB_FIELD& ref = symbol->GetReferenceField();
362
363 ref.SetText( wxT( "U1" ) );
364 ref.SetPosition( MILS_POINT( p.x + 30, p.y + 260 ) );
366
367 LIB_FIELD& value = symbol->GetValueField();
368
369 value.SetText( wxT( "OPA604" ) );
370 value.SetPosition( MILS_POINT( p.x + 30, p.y + 180 ) );
372
373 symbol->SetShowPinNames( true );
374 symbol->SetShowPinNumbers( true );
375 symbol->SetPinNameOffset( 0 );
376
377 LIB_SHAPE* comp_body = new LIB_SHAPE( symbol, SHAPE_T::POLY );
378
379 comp_body->SetUnit( 0 );
380 comp_body->SetConvert( 0 );
383 comp_body->AddPoint( MILS_POINT( p.x - 200, p.y + 200 ) );
384 comp_body->AddPoint( MILS_POINT( p.x + 200, p.y ) );
385 comp_body->AddPoint( MILS_POINT( p.x - 200, p.y - 200 ) );
386 comp_body->AddPoint( MILS_POINT( p.x - 200, p.y + 200 ) );
387
388 addItem( comp_body );
389
390 LIB_PIN* pin = new LIB_PIN( symbol );
391
392 pin->SetPosition( MILS_POINT( p.x - 300, p.y + 100 ) );
393 pin->SetLength( schIUScale.MilsToIU( 100 ) );
394 pin->SetOrientation( PIN_RIGHT );
396 pin->SetNumber( wxT( "1" ) );
397 pin->SetName( wxT( "-" ) );
398
399 endPoints.emplace_back( PIN_END, pin, mapLibItemPosition( pin->GetPosition() ) );
400 symbol->AddDrawItem( pin );
401
402 pin = new LIB_PIN( symbol );
403
404 pin->SetPosition( MILS_POINT( p.x - 300, p.y - 100 ) );
405 pin->SetLength( schIUScale.MilsToIU( 100 ) );
406 pin->SetOrientation( PIN_RIGHT );
408 pin->SetNumber( wxT( "2" ) );
409 pin->SetName( wxT( "+" ) );
410
411 endPoints.emplace_back( PIN_END, pin, mapLibItemPosition( pin->GetPosition() ) );
412 symbol->AddDrawItem( pin );
413
414 pin = new LIB_PIN( symbol );
415
416 pin->SetPosition( MILS_POINT( p.x + 300, p.y ) );
417 pin->SetLength( schIUScale.MilsToIU( 100 ) );
418 pin->SetOrientation( PIN_LEFT );
420 pin->SetNumber( wxT( "3" ) );
421 pin->SetName( wxT( "OUT" ) );
422
423 endPoints.emplace_back( PIN_END, pin, mapLibItemPosition( pin->GetPosition() ) );
424 symbol->AddDrawItem( pin );
425
426 addItem( symbol );
427 }
428
429 SCH_SHEET* s = new SCH_SHEET(
430 /* aParent */ nullptr,
431 /* aPosition */ MILS_POINT( 4000, 1300 ),
432 /* aSize */ wxSize( schIUScale.MilsToIU( 800 ), schIUScale.MilsToIU( 1300 ) ) );
433 s->GetFields().at( SHEETNAME ).SetText( wxT( "SHEET" ) );
434 s->GetFields().at( SHEETFILENAME ).SetText( _( "/path/to/sheet" ) );
435 s->AutoplaceFields( nullptr, false );
436 addItem( s );
437
438 SCH_SHEET_PIN* sp = new SCH_SHEET_PIN( s, MILS_POINT( 4500, 1500 ), wxT( "SHEET PIN" ) );
439 addItem( sp );
440
441 for( EDA_ITEM* item : m_previewItems )
442 {
443 SCH_ITEM* sch_item = dynamic_cast<SCH_ITEM*>( item );
444
445 if( sch_item && sch_item->IsConnectable() )
446 {
447 sch_item->AutoplaceFields( nullptr, false );
448 sch_item->GetEndPoints( endPoints );
449 }
450 }
451
452 for( EDA_ITEM* item : m_previewItems )
453 {
454 SCH_ITEM* sch_item = dynamic_cast<SCH_ITEM*>( item );
455
456 if( sch_item && sch_item->IsConnectable() )
457 sch_item->UpdateDanglingState( endPoints, nullptr );
458 }
459
461}
462
463
465{
467}
468
469
471{
474}
475
476
478{
479 if( !m_preview )
480 return;
481
482 KIGFX::VIEW* view = m_preview->GetView();
483 auto settings = static_cast<KIGFX::SCH_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
484 settings->LoadColors( m_currentSettings );
485
486 m_preview->GetGAL()->SetClearColor( settings->GetBackgroundColor() );
487
489 auto rect = m_preview->GetScreenRect();
490 m_preview->Refresh( true, &rect );
491}
492
493
495{
496 if( m_preview )
497 {
498 KIGFX::VIEW* view = m_preview->GetView();
499
500 view->SetScale( 1.0 );
501 VECTOR2D screenSize = view->ToWorld( m_preview->GetClientSize(), false );
502
504 double scale = view->GetScale() / std::max( fabs( psize.x / screenSize.x ),
505 fabs( psize.y / screenSize.y ) );
506
507 view->SetScale( scale * m_galDisplayOptions.m_scaleFactor * 0.8 /* margin */ );
510 }
511}
512
513
514void PANEL_EESCHEMA_COLOR_SETTINGS::OnSize( wxSizeEvent& aEvent )
515{
517 aEvent.Skip();
518}
519
520
522{
524
525 // If the theme is not overriding individual item colors then don't show them so that
526 // the user doesn't get seduced into thinking they'll have some effect.
529
532
533 m_colorsGridSizer->Layout();
534 m_colorsListWindow->Layout();
535}
int color
Definition: DXF_plotter.cpp:57
const char * name
Definition: DXF_plotter.cpp:56
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:111
WINDOW_SETTINGS m_Window
Definition: app_settings.h:187
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:190
Vec Centre() const
Definition: box2.h:70
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SetColor(int aLayer, const COLOR4D &aColor)
bool GetOverrideSchItemColors() const
COLOR4D GetColor(int aLayer) const
void SetOverrideSchItemColors(bool aFlag)
const BOX2I ViewBBox() const override
void SetPageBorderColorLayer(int aLayerId)
Overrides the layer used to pick the color of the page border (normally LAYER_GRID)
void SetColorLayer(int aLayerId)
Can be used to override which layer ID is used for drawing sheet item colors.
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
void ForceRefresh()
Force a redraw.
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
void SetStealsFocus(bool aStealsFocus)
Set whether focus is taken on certain events (mouseover, keys, etc).
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
void SetSelected()
Definition: eda_item.h:115
void SetFillMode(FILL_T aFill)
Definition: eda_shape.h:100
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:163
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
Definition: eda_text.cpp:240
wxString GetFilename() const
Definition: json_settings.h:73
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
void ReadConfig(COMMON_SETTINGS &aCommonConfig, WINDOW_SETTINGS &aWindowConfig, wxWindow *aWindow)
Read application and common configs.
bool m_forceDisplayCursor
The pixel scale factor (>1 for hi-DPI scaled displays)
void SetAxesEnabled(bool aAxesEnabled)
Enable drawing the axes.
void SetClearColor(const COLOR4D &aColor)
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
Store schematic specific render settings.
Definition: sch_painter.h:71
void LoadColors(const COLOR_SETTINGS *aSettings) override
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:69
double GetScale() const
Definition: view.h:269
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
Definition: view.cpp:551
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:316
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
Definition: view.cpp:448
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition: view.cpp:1484
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:213
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
Definition: view.cpp:577
Field object used in symbol libraries.
Definition: lib_field.h:61
void SetPosition(const VECTOR2I &aPosition) override
Definition: lib_item.h:234
void SetConvert(int aConvert)
Definition: lib_item.h:275
void SetUnit(int aUnit)
Definition: lib_item.h:272
void SetStroke(const STROKE_PARAMS &aStroke)
Definition: lib_shape.h:53
void AddPoint(const VECTOR2I &aPosition)
Definition: lib_shape.cpp:513
Define a library symbol object.
Definition: lib_symbol.h:99
void SetShowPinNames(bool aShow)
Set or clear the pin name visibility flag.
Definition: lib_symbol.h:624
LIB_FIELD & GetReferenceField()
Return reference to the reference designator field.
void SetPinNameOffset(int aOffset)
Set the offset in mils of the pin name text from the pin symbol.
Definition: lib_symbol.h:616
void SetShowPinNumbers(bool aShow)
Set or clear the pin number visibility flag.
Definition: lib_symbol.h:632
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:823
LIB_FIELD & GetValueField()
Return reference to the value field.
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
void SetWidthMils(int aWidthInMils)
Definition: page_info.cpp:244
int GetHeightIU(double aIUScale) const
Gets the page height in IU.
Definition: page_info.h:153
static const wxChar Custom[]
"User" defined page type
Definition: page_info.h:77
void SetHeightMils(int aHeightInMils)
Definition: page_info.cpp:258
int GetWidthIU(double aIUScale) const
Gets the page width in IU.
Definition: page_info.h:144
void createThemeList(const wxString &aCurrent)
Builds the theme listbox and sets the selection to the current theme.
void createSwatch(int aLayer, const wxString &aName)
std::vector< int > m_validLayers
A list of layer IDs that are valid for the current color settings dialog.
virtual bool saveCurrentTheme(bool aValidate)
std::string m_colorNamespace
A namespace that will be passed to SETTINGS_MANAGER::SaveColorSettings.
virtual void ResetPanel() override
Reset the contents of this panel.
std::map< int, wxStaticText * > m_labels
COLOR_SETTINGS * m_currentSettings
std::map< int, COLOR_SWATCH * > m_swatches
bool saveCurrentTheme(bool aValidate) override
void onNewThemeSelected() override
Event fired when a new theme is selected that can be overridden in children.
void OnOverrideItemColorsClicked(wxCommandEvent &aEvent) override
bool validateSave(bool aQuiet=false) override
Performs a pre-save validation of the current color theme.
void ResetPanel() override
Reset the contents of this panel.
void OnSize(wxSizeEvent &aEvent) override
KIGFX::GAL_DISPLAY_OPTIONS m_galDisplayOptions
EDA_DRAW_PANEL_GAL::GAL_TYPE m_galType
void onColorChanged() override
Event fired when the user changes any color.
void SetPosition(const VECTOR2I &aPosition) override
Class for a wire to bus entry.
void SetTextSpinStyle(TEXT_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Definition: sch_label.cpp:1291
void SetTextSpinStyle(TEXT_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Definition: sch_label.cpp:1524
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:147
virtual bool IsConnectable() const
Definition: sch_item.h:349
virtual void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList)
Add the schematic item end points to aItemList if the item has end points.
Definition: sch_item.h:318
void SetLayer(SCH_LAYER_ID aLayer)
Set the layer this item is on.
Definition: sch_item.h:253
virtual bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemList, const SCH_SHEET_PATH *aPath=nullptr)
Test the schematic item to aItemList to check if it's dangling state has changed.
Definition: sch_item.h:336
virtual void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual)
Definition: sch_item.h:442
void SetIsDangling(bool aIsDangling)
Definition: sch_label.h:178
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:40
void SetStartPoint(const VECTOR2I &aPosition)
Definition: sch_line.h:139
virtual STROKE_PARAMS GetStroke() const override
Definition: sch_line.h:177
virtual void SetStroke(const STROKE_PARAMS &aStroke) override
Definition: sch_line.h:178
void SetEndPoint(const VECTOR2I &aPosition)
Definition: sch_line.h:144
void SetPosition(const VECTOR2I &aPosition) override
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...
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings() const
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:66
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:57
std::vector< SCH_FIELD > & GetFields()
Definition: sch_sheet.h:93
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Definition: sch_sheet.cpp:602
virtual void SetTextSpinStyle(TEXT_SPIN_STYLE aSpinStyle)
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Definition: sch_text.cpp:188
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
Simple container to manage line stroke parameters.
Definition: stroke_params.h:88
void SetWidth(int aWidth)
Definition: stroke_params.h:99
void SetPlotStyle(PLOT_DASH_TYPE aPlotStyle)
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:41
void SetTitle(const wxString &aTitle)
Definition: title_block.h:58
void SetDate(const wxString &aDate)
Set the date field, and defaults to the current time and date.
Definition: title_block.h:71
@ WHITE
Definition: color4d.h:48
#define _(s)
@ FILLED_WITH_BG_BODYCOLOR
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
Definition: layer_id.cpp:30
SCH_LAYER_ID
Eeschema drawing layers.
Definition: layer_ids.h:341
@ LAYER_DANGLING
Definition: layer_ids.h:368
@ LAYER_SHEET_BACKGROUND
Definition: layer_ids.h:373
@ LAYER_WIRE
Definition: layer_ids.h:344
@ LAYER_NOTES
Definition: layer_ids.h:358
@ LAYER_BUS
Definition: layer_ids.h:345
@ SCH_LAYER_ID_END
Definition: layer_ids.h:388
@ SCH_LAYER_ID_START
Definition: layer_ids.h:342
@ LAYER_SCHEMATIC_DRAWINGSHEET
Definition: layer_ids.h:382
@ LAYER_SCHEMATIC_GRID_AXES
Definition: layer_ids.h:375
@ LAYER_NOTES_BACKGROUND
Definition: layer_ids.h:360
@ LAYER_SCHEMATIC_PAGE_LIMITS
Definition: layer_ids.h:383
@ LAYER_SHEET
Definition: layer_ids.h:362
@ LAYER_SCHEMATIC_BACKGROUND
Definition: layer_ids.h:376
@ PIN_LEFT
Definition: lib_pin.h:46
@ PIN_RIGHT
Definition: lib_pin.h:45
@ COLOR
Color has changed.
Definition: view_item.h:48
#define MILS_POINT(x, y)
std::set< int > g_excludedLayers
see class PGM_BASE
@ PT_INPUT
usual pin input: must be connected
@ PT_OUTPUT
usual output
@ PIN_END
Definition: sch_item.h:68
@ SHEETNAME
Definition: sch_sheet.h:45
@ SHEETFILENAME
Definition: sch_sheet.h:46
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111
const int scale
const double IU_PER_MILS
Definition: base_units.h:78
constexpr int MilsToIU(int mils) const
Definition: base_units.h:94
@ GR_TEXT_H_ALIGN_LEFT
VECTOR2< int > VECTOR2I
Definition: vector2d.h:618