KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 The 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>
26#include <layer_ids.h>
27#include <sch_shape.h>
28#include <math/vector2wx.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_sheet_pin.h>
39#include <sch_text.h>
43#include <title_block.h>
44#include <view/view.h>
46#include <sch_base_frame.h>
48#include <widgets/wx_panel.h>
49#include <wx/msgdlg.h>
50
51
52std::set<int> g_excludedLayers =
53 {
57 };
58
59
61 PANEL_COLOR_SETTINGS( aParent ),
62 m_preview( nullptr ),
63 m_page( nullptr ),
64 m_titleBlock( nullptr ),
65 m_drawingSheet( nullptr ),
66 m_previewItems()
67{
68 m_colorNamespace = "schematic";
69
70 COMMON_SETTINGS* common_settings = Pgm().GetCommonSettings();
71 EESCHEMA_SETTINGS* app_settings = GetAppSettings<EESCHEMA_SETTINGS>( "eeschema" );
72 COLOR_SETTINGS* current = ::GetColorSettings( app_settings ? app_settings->m_ColorTheme : DEFAULT_THEME );
73
74 // Saved theme doesn't exist? Reset to default
75 if( current->GetFilename() != app_settings->m_ColorTheme )
76 app_settings->m_ColorTheme = current->GetFilename();
77
78 createThemeList( app_settings->m_ColorTheme );
79
80 m_optOverrideColors->SetValue( current->GetOverrideSchItemColors() );
81
82 m_currentSettings = new COLOR_SETTINGS( *current );
83
84 for( int id = SCH_LAYER_ID_START; id < SCH_LAYER_ID_END; id++ )
85 {
86 if( g_excludedLayers.count( id ) )
87 continue;
88
89 m_validLayers.push_back( id );
90 }
91
93
94 m_galDisplayOptions.ReadConfig( *common_settings, app_settings->m_Window, this );
96
97 m_galType = static_cast<EDA_DRAW_PANEL_GAL::GAL_TYPE>( common_settings->m_Graphics.canvas_type );
98}
99
100
102{
103 delete m_page;
104 delete m_titleBlock;
105 delete m_drawingSheet;
106 delete m_currentSettings;
107
108 for( EDA_ITEM* item : m_previewItems )
109 {
110 // Avoid referencing items after they are deleted (we don't control order)
111 item->SetParent( nullptr );
112 delete item;
113 }
114}
115
116
118{
120
121 if( !saveCurrentTheme( true ) )
122 return false;
123
124 if( EESCHEMA_SETTINGS* cfg = GetAppSettings<EESCHEMA_SETTINGS>( "eeschema" ) )
125 cfg->m_ColorTheme = m_currentSettings->GetFilename();
126
127 return true;
128}
129
130
132{
134 return true;
135}
136
137
139{
141
142 for( SCH_LAYER_ID layer = SCH_LAYER_ID_START; layer < SCH_LAYER_ID_END; ++layer )
143 {
144 if( bgcolor == m_currentSettings->GetColor( layer )
145 && layer != LAYER_SCHEMATIC_BACKGROUND && layer != LAYER_SHEET_BACKGROUND )
146 {
147 wxString msg = _( "Some items have the same color as the background\n"
148 "and they will not be seen on the screen. Are you\n"
149 "sure you want to use these colors?" );
150
151 if( wxMessageBox( msg, _( "Warning" ), wxYES_NO | wxICON_QUESTION,
152 wxGetTopLevelParent( this ) ) == wxNO )
153 return false;
154
155 break;
156 }
157 }
158
159 return true;
160}
161
162
164{
165 for( int layer : m_validLayers )
166 {
168
169 // Do not allow non-background layers to be completely white.
170 // This ensures the BW printing recognizes that the colors should be printed black.
171 if( color == COLOR4D::WHITE && layer != LAYER_SCHEMATIC_BACKGROUND
172 && layer != LAYER_SHEET_BACKGROUND )
173 {
174 color.Darken( 0.01 );
175 }
176
178 }
179
180 return PANEL_COLOR_SETTINGS::saveCurrentTheme( aValidate );
181}
182
183
185{
186 std::vector<SCH_LAYER_ID> layers;
187
189 {
190 if( g_excludedLayers.count( i ) )
191 continue;
192
193 layers.push_back( i );
194 }
195
196 std::sort( layers.begin(), layers.end(),
197 []( SCH_LAYER_ID a, SCH_LAYER_ID b )
198 {
199 return LayerName( a ) < LayerName( b );
200 } );
201
202 for( int layer : layers )
203 {
204 wxString name = LayerName( layer );
205
206 if( layer == LAYER_SCHEMATIC_GRID_AXES )
207 name += wxS( " " ) + _( "(symbol editor only)" );
208
209 createSwatch( layer, name );
210 }
211
212 // Give a minimal width to m_colorsListWindow, in order to always having
213 // a full row shown
214 int min_width = m_colorsGridSizer->GetMinSize().x;
215 const int margin = 20; // A margin around the sizer
216 m_colorsListWindow->SetMinSize( wxSize( min_width + margin, -1 ) );
217
218 m_preview = new SCH_PREVIEW_PANEL( m_panel1, wxID_ANY, wxDefaultPosition, wxSize( -1, -1 ),
220 m_preview->SetStealsFocus( false );
221 m_preview->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER );
222 m_preview->GetGAL()->SetAxesEnabled( false );
223
225 settings->m_IsSymbolEditor = true;
226
227 m_colorsMainSizer->Add( m_preview, 1, wxTOP | wxEXPAND, 1 );
228
229 m_colorsMainSizer->Layout();
230
235}
236
237
239{
241}
242
243
245{
246 KIGFX::VIEW* view = m_preview->GetView();
247
248 std::vector<DANGLING_END_ITEM> endPointsByType;
249
252 m_titleBlock->SetTitle( _( "Color Preview" ) );
253 m_titleBlock->SetDate( wxDateTime::Now().FormatDate() );
254
255 m_page->SetHeightMils( 5000 );
256 m_page->SetWidthMils( 6000 );
257
261 view->Add( m_drawingSheet );
262
263 // TODO: It would be nice to parse a schematic file here.
264
265 auto addItem = [&]( EDA_ITEM* aItem )
266 {
267 view->Add( aItem );
268 m_previewItems.push_back( aItem );
269 };
270
271 std::vector<std::pair<SCH_LAYER_ID, std::pair<VECTOR2I, VECTOR2I>>> lines = {
272 { LAYER_WIRE, { { 1950, 1500 }, { 2325, 1500 } } },
273 { LAYER_WIRE, { { 1950, 2600 }, { 2350, 2600 } } },
274 { LAYER_WIRE, { { 2150, 1700 }, { 2325, 1700 } } },
275 { LAYER_WIRE, { { 2150, 2000 }, { 2150, 1700 } } },
276 { LAYER_WIRE, { { 2925, 1600 }, { 3075, 1600 } } },
277 { LAYER_WIRE, { { 3075, 1600 }, { 3075, 2000 } } },
278 { LAYER_WIRE, { { 3075, 1600 }, { 3250, 1600 } } },
279 { LAYER_WIRE, { { 3075, 2000 }, { 2150, 2000 } } },
280 { LAYER_BUS, { { 1750, 1300 }, { 1850, 1300 } } },
281 { LAYER_BUS, { { 1850, 2500 }, { 1850, 1300 } } },
282 { LAYER_NOTES, { { 2350, 2125 }, { 2350, 2300 } } },
283 { LAYER_NOTES, { { 2350, 2125 }, { 2950, 2125 } } },
284 { LAYER_NOTES, { { 2950, 2125 }, { 2950, 2300 } } },
285 { LAYER_NOTES, { { 2950, 2300 }, { 2350, 2300 } } }
286 };
287
288 for( const std::pair<SCH_LAYER_ID, std::pair<VECTOR2I, VECTOR2I>>& line : lines )
289 {
290 SCH_LINE* wire = new SCH_LINE;
291 wire->SetLayer( line.first );
292 STROKE_PARAMS stroke = wire->GetStroke();
293 stroke.SetWidth( schIUScale.MilsToIU( 6 ) );
294
295 if( line.first != LAYER_NOTES )
296 {
297 stroke.SetLineStyle( LINE_STYLE::SOLID );
298
299 if( line.first == LAYER_BUS )
300 stroke.SetWidth( schIUScale.MilsToIU( 12 ) );
301
302 }
303
304 wire->SetStroke( stroke );
305
306 wire->SetStartPoint( VECTOR2I( schIUScale.MilsToIU( line.second.first.x ),
307 schIUScale.MilsToIU( line.second.first.y ) ) );
308 wire->SetEndPoint( VECTOR2I( schIUScale.MilsToIU( line.second.second.x ),
309 schIUScale.MilsToIU( line.second.second.y ) ) );
310 addItem( wire );
311 }
312
313#define MILS_POINT( x, y ) VECTOR2I( schIUScale.MilsToIU( x ), schIUScale.MilsToIU( y ) )
314
316 nc->SetPosition( MILS_POINT( 2350, 2600 ) );
317 addItem( nc );
318
320 e1->SetPosition( MILS_POINT( 1850, 1400 ) );
321 addItem( e1 );
322
324 e2->SetPosition( MILS_POINT( 1850, 2500 ) );
325 addItem( e2 );
326
327 SCH_TEXT* t1 = new SCH_TEXT( MILS_POINT( 2650, 2240 ), wxT( "PLAIN TEXT" ) );
328 addItem( t1 );
329
330 SCH_LABEL* t2 = new SCH_LABEL( MILS_POINT( 1975, 1500 ), wxT( "LABEL_{0}" ) );
332 t2->SetIsDangling( false );
333 addItem( t2 );
334
335 SCH_LABEL* t3 = new SCH_LABEL( MILS_POINT( 1975, 2600 ), wxT( "LABEL_{1}" ) );
337 t3->SetIsDangling( false );
338 addItem( t3 );
339
340 SCH_GLOBALLABEL* t4 = new SCH_GLOBALLABEL( MILS_POINT( 1750, 1300 ), wxT( "GLOBAL[0..3]" ) );
342 t4->SetIsDangling( false );
343 addItem( t4 );
344
345 SCH_HIERLABEL* t5 = new SCH_HIERLABEL( MILS_POINT( 3250, 1600 ), wxT( "HIER_LABEL" ) );
347 t5->SetIsDangling( false );
348 addItem( t5 );
349
350 SCH_JUNCTION* j = new SCH_JUNCTION( MILS_POINT( 3075, 1600 ) );
351 addItem( j );
352
353 t2->SetSelected();
354
355 {
356 auto mapLibItemPosition =
357 []( const VECTOR2I& aLibPosition ) -> VECTOR2I
358 {
359 // Currently, the mapping is a no-op.
360 return VECTOR2I( aLibPosition.x, aLibPosition.y );
361 };
362
363 LIB_SYMBOL* symbol = new LIB_SYMBOL( wxEmptyString );
364 VECTOR2I p( 2625, 1600 );
365
366 SCH_FIELD& ref = symbol->GetReferenceField();
367
368 ref.SetText( wxT( "U1" ) );
369 ref.SetPosition( MILS_POINT( p.x + 30, p.y - 260 ) );
371
372 SCH_FIELD& value = symbol->GetValueField();
373
374 value.SetText( wxT( "OPA604" ) );
375 value.SetPosition( MILS_POINT( p.x + 30, p.y - 180 ) );
377
378 symbol->SetShowPinNames( true );
379 symbol->SetShowPinNumbers( true );
380 symbol->SetPinNameOffset( 0 );
381
382 SCH_SHAPE* comp_body = new SCH_SHAPE( SHAPE_T::POLY, LAYER_DEVICE );
383
384 comp_body->SetParent( symbol );
385 comp_body->SetUnit( 0 );
386 comp_body->SetBodyStyle( 0 );
387 comp_body->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) );
388 comp_body->SetFillMode( FILL_T::FILLED_WITH_BG_BODYCOLOR );
389 comp_body->AddPoint( MILS_POINT( p.x - 200, p.y + 200 ) );
390 comp_body->AddPoint( MILS_POINT( p.x + 200, p.y ) );
391 comp_body->AddPoint( MILS_POINT( p.x - 200, p.y - 200 ) );
392 comp_body->AddPoint( MILS_POINT( p.x - 200, p.y + 200 ) );
393
394 addItem( comp_body );
395
396 SCH_PIN* pin = new SCH_PIN( symbol );
397
398 pin->SetPosition( MILS_POINT( p.x - 300, p.y - 100 ) );
399 pin->SetLength( schIUScale.MilsToIU( 100 ) );
400 pin->SetOrientation( PIN_ORIENTATION::PIN_RIGHT );
401 pin->SetType( ELECTRICAL_PINTYPE::PT_INPUT );
402 pin->SetNumber( wxT( "1" ) );
403 pin->SetName( wxT( "-" ) );
404 pin->SetNumberTextSize( schIUScale.MilsToIU( 50 ) );
405 pin->SetNameTextSize( schIUScale.MilsToIU( 50 ) );
406
407 endPointsByType.emplace_back( PIN_END, pin, mapLibItemPosition( pin->GetPosition() ) );
408 symbol->AddDrawItem( pin );
409
410 pin = new SCH_PIN( symbol );
411
412 pin->SetPosition( MILS_POINT( p.x - 300, p.y + 100 ) );
413 pin->SetLength( schIUScale.MilsToIU( 100 ) );
414 pin->SetOrientation( PIN_ORIENTATION::PIN_RIGHT );
415 pin->SetType( ELECTRICAL_PINTYPE::PT_INPUT );
416 pin->SetNumber( wxT( "2" ) );
417 pin->SetName( wxT( "+" ) );
418 pin->SetNumberTextSize( schIUScale.MilsToIU( 50 ) );
419 pin->SetNameTextSize( schIUScale.MilsToIU( 50 ) );
420
421 endPointsByType.emplace_back( PIN_END, pin, mapLibItemPosition( pin->GetPosition() ) );
422 symbol->AddDrawItem( pin );
423
424 pin = new SCH_PIN( symbol );
425
426 pin->SetPosition( MILS_POINT( p.x + 300, p.y ) );
427 pin->SetLength( schIUScale.MilsToIU( 100 ) );
428 pin->SetOrientation( PIN_ORIENTATION::PIN_LEFT );
429 pin->SetType( ELECTRICAL_PINTYPE::PT_OUTPUT );
430 pin->SetNumber( wxT( "3" ) );
431 pin->SetName( wxT( "OUT" ) );
432 pin->SetNumberTextSize( schIUScale.MilsToIU( 50 ) );
433 pin->SetNameTextSize( schIUScale.MilsToIU( 50 ) );
434
435 endPointsByType.emplace_back( PIN_END, pin, mapLibItemPosition( pin->GetPosition() ) );
436 symbol->AddDrawItem( pin );
437
438 addItem( symbol );
439 }
440
441 SCH_SHEET* s = new SCH_SHEET( nullptr, MILS_POINT( 4000, 1300 ), MILS_POINT( 800, 1300 ) );
442 s->GetField( FIELD_T::SHEET_NAME )->SetText( wxT( "SHEET" ) );
443 s->GetField( FIELD_T::SHEET_FILENAME )->SetText( _( "/path/to/sheet" ) );
444 s->AutoplaceFields( nullptr, AUTOPLACE_AUTO );
445 addItem( s );
446
447 SCH_SHEET_PIN* sp = new SCH_SHEET_PIN( s, MILS_POINT( 4500, 1500 ), wxT( "SHEET PIN" ) );
448 addItem( sp );
449
450 for( EDA_ITEM* item : m_previewItems )
451 {
452 SCH_ITEM* sch_item = dynamic_cast<SCH_ITEM*>( item );
453
454 if( sch_item && sch_item->IsConnectable() )
455 {
456 sch_item->AutoplaceFields( nullptr, AUTOPLACE_AUTO );
457 sch_item->GetEndPoints( endPointsByType );
458 }
459 }
460
461 std::vector<DANGLING_END_ITEM> endPointsByPos = endPointsByType;
462 DANGLING_END_ITEM_HELPER::sort_dangling_end_items( endPointsByType, endPointsByPos );
463
464 for( EDA_ITEM* item : m_previewItems )
465 {
466 SCH_ITEM* sch_item = dynamic_cast<SCH_ITEM*>( item );
467
468 if( sch_item && sch_item->IsConnectable() )
469 sch_item->UpdateDanglingState( endPointsByType, endPointsByPos, nullptr );
470 }
471
473}
474
475
477{
479}
480
481
483{
486}
487
488
490{
491 if( !m_preview )
492 return;
493
494 KIGFX::VIEW* view = m_preview->GetView();
495 auto settings = static_cast<SCH_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
496 settings->LoadColors( m_currentSettings );
497
498 m_preview->GetGAL()->SetClearColor( settings->GetBackgroundColor() );
499
501 auto rect = m_preview->GetScreenRect();
502 m_preview->Refresh( true, &rect );
503}
504
505
507{
508 if( m_preview )
509 {
510 KIGFX::VIEW* view = m_preview->GetView();
511
512 view->SetScale( 1.0 );
513 VECTOR2D screenSize = view->ToWorld( ToVECTOR2D( m_preview->GetClientSize() ), false );
514
517 double scale = view->GetScale() / std::max( fabs( psize.x / screenSize.x ),
518 fabs( psize.y / screenSize.y ) );
519
520 view->SetScale( scale * m_galDisplayOptions.m_scaleFactor * 0.8 /* margin */ );
523 }
524}
525
526
527void PANEL_EESCHEMA_COLOR_SETTINGS::OnSize( wxSizeEvent& aEvent )
528{
530 aEvent.Skip();
531}
532
533
535{
536 // If the theme is not overriding individual item colors then don't show them so that
537 // the user doesn't get seduced into thinking they'll have some effect.
540
543
544 m_colorsGridSizer->Layout();
545 m_colorsListWindow->Layout();
546}
547
548
550{
553}
int color
Definition: DXF_plotter.cpp:63
const char * name
Definition: DXF_plotter.cpp:62
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:114
WINDOW_SETTINGS m_Window
Definition: app_settings.h:233
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:236
constexpr Vec Centre() const
Definition: box2.h:97
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)
static void sort_dangling_end_items(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos)
Both contain the same information.
Definition: sch_item.cpp:816
const BOX2I ViewBBox() const override
void SetPageBorderColorLayer(int aLayerId)
Override 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:98
void SetSelected()
Definition: eda_item.h:134
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:113
void SetFillMode(FILL_T aFill)
Definition: eda_shape.cpp:540
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
Definition: eda_text.cpp:409
void ReadConfig(COMMON_SETTINGS &aCommonConfig, WINDOW_SETTINGS &aWindowConfig, wxWindow *aWindow)
Read application and common configs.
wxString GetFilename() const
Definition: json_settings.h:86
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
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.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:66
double GetScale() const
Definition: view.h:276
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
Definition: view.cpp:570
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:298
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:467
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition: view.cpp:1561
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:220
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
Definition: view.cpp:596
Define a library symbol object.
Definition: lib_symbol.h:85
SCH_FIELD & GetValueField()
Return reference to the value field.
Definition: lib_symbol.h:334
void AddDrawItem(SCH_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
Definition: lib_symbol.cpp:785
SCH_FIELD & GetReferenceField()
Return reference to the reference designator field.
Definition: lib_symbol.h:338
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:59
int GetHeightIU(double aIUScale) const
Gets the page height in IU.
Definition: page_info.h:162
static const wxChar Custom[]
"User" defined page type
Definition: page_info.h:82
void SetHeightMils(double aHeightInMils)
Definition: page_info.cpp:262
int GetWidthIU(double aIUScale) const
Gets the page width in IU.
Definition: page_info.h:153
void SetWidthMils(double aWidthInMils)
Definition: page_info.cpp:248
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.
GAL_DISPLAY_OPTIONS_IMPL m_galDisplayOptions
void OnSize(wxSizeEvent &aEvent) override
EDA_DRAW_PANEL_GAL::GAL_TYPE m_galType
void onColorChanged() override
Event fired when the user changes any color.
virtual COMMON_SETTINGS * GetCommonSettings() const
Definition: pgm_base.cpp:565
void SetPosition(const VECTOR2I &aPosition) override
Class for a wire to bus entry.
void SetPosition(const VECTOR2I &aPosition) override
Definition: sch_field.cpp:1317
void SetText(const wxString &aText) override
Definition: sch_field.cpp:1089
void SetSpinStyle(SPIN_STYLE aSpinStyle) override
Definition: sch_label.cpp:1950
void SetSpinStyle(SPIN_STYLE aSpinStyle) override
Definition: sch_label.cpp:2131
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:168
virtual void SetBodyStyle(int aBodyStyle)
Definition: sch_item.h:247
virtual bool IsConnectable() const
Definition: sch_item.h:498
virtual void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo)
Definition: sch_item.h:600
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:450
virtual bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos, const SCH_SHEET_PATH *aSheet=nullptr)
Test the schematic item to aItemList to check if it's dangling state has changed.
Definition: sch_item.h:470
void SetLayer(SCH_LAYER_ID aLayer)
Definition: sch_item.h:314
virtual void SetUnit(int aUnit)
Definition: sch_item.h:238
void SetIsDangling(bool aIsDangling)
Definition: sch_label.h:330
virtual void SetSpinStyle(SPIN_STYLE aSpinStyle)
Definition: sch_label.cpp:316
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:42
void SetStartPoint(const VECTOR2I &aPosition)
Definition: sch_line.h:140
virtual STROKE_PARAMS GetStroke() const override
Definition: sch_line.h:193
virtual void SetStroke(const STROKE_PARAMS &aStroke) override
Definition: sch_line.h:194
void SetEndPoint(const VECTOR2I &aPosition)
Definition: sch_line.h:145
void SetPosition(const VECTOR2I &aPosition) override
void Refresh(bool aEraseBackground, const wxRect *aRect) override
SCH_RENDER_SETTINGS * GetRenderSettings() const
void LoadColors(const COLOR_SETTINGS *aSettings) override
void SetStroke(const STROKE_PARAMS &aStroke) override
Definition: sch_shape.cpp:61
void AddPoint(const VECTOR2I &aPosition)
Definition: sch_shape.cpp:400
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:47
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this sheet.
Definition: sch_sheet.cpp:367
void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo) override
Definition: sch_sheet.cpp:635
Simple container to manage line stroke parameters.
Definition: stroke_params.h:94
void SetLineStyle(LINE_STYLE aLineStyle)
void SetWidth(int aWidth)
virtual void SetShowPinNumbers(bool aShow)
Set or clear the pin number visibility flag.
Definition: symbol.h:164
virtual void SetShowPinNames(bool aShow)
Set or clear the pin name visibility flag.
Definition: symbol.h:158
void SetPinNameOffset(int aOffset)
Set the offset in mils of the pin name text from the pin symbol.
Definition: symbol.h:152
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
#define _(s)
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
Definition: layer_id.cpp:31
SCH_LAYER_ID
Eeschema drawing layers.
Definition: layer_ids.h:439
@ LAYER_DANGLING
Definition: layer_ids.h:467
@ LAYER_DEVICE
Definition: layer_ids.h:456
@ LAYER_SHEET_BACKGROUND
Definition: layer_ids.h:475
@ LAYER_WIRE
Definition: layer_ids.h:442
@ LAYER_NOTES
Definition: layer_ids.h:457
@ LAYER_NET_COLOR_HIGHLIGHT
Definition: layer_ids.h:483
@ LAYER_BUS
Definition: layer_ids.h:443
@ SCH_LAYER_ID_END
Definition: layer_ids.h:493
@ SCH_LAYER_ID_START
Definition: layer_ids.h:440
@ LAYER_SCHEMATIC_DRAWINGSHEET
Definition: layer_ids.h:485
@ LAYER_SCHEMATIC_GRID_AXES
Definition: layer_ids.h:477
@ LAYER_NOTES_BACKGROUND
Definition: layer_ids.h:459
@ LAYER_SCHEMATIC_PAGE_LIMITS
Definition: layer_ids.h:486
@ LAYER_SHEET
Definition: layer_ids.h:461
@ LAYER_SCHEMATIC_BACKGROUND
Definition: layer_ids.h:478
@ COLOR
Color has changed.
Definition: view_item.h:54
#define MILS_POINT(x, y)
std::set< int > g_excludedLayers
PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:902
see class PGM_BASE
@ AUTOPLACE_AUTO
Definition: sch_item.h:71
@ PIN_END
Definition: sch_item.h:83
#define DEFAULT_THEME
COLOR_SETTINGS * GetColorSettings(const wxString &aName)
const int scale
int canvas_type
EDA_DRAW_PANEL_GAL::GAL_TYPE_* value, see gal_options_panel.cpp.
const double IU_PER_MILS
Definition: base_units.h:77
constexpr int MilsToIU(int mils) const
Definition: base_units.h:97
@ GR_TEXT_H_ALIGN_LEFT
VECTOR2< int32_t > VECTOR2I
Definition: vector2d.h:695
VECTOR2D ToVECTOR2D(const wxPoint &aPoint)
Definition: vector2wx.h:40