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
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#include <regex>
22
24#include <eeschema_settings.h>
27#include <layer_ids.h>
28#include <sch_shape.h>
29#include <math/vector2wx.h>
30#include <page_info.h>
32#include <pgm_base.h>
33#include <sch_bus_entry.h>
34#include <sch_junction.h>
35#include <sch_line.h>
36#include <sch_no_connect.h>
37#include <sch_painter.h>
38#include <sch_preview_panel.h>
39#include <sch_sheet_pin.h>
40#include <sch_text.h>
44#include <title_block.h>
45#include <view/view.h>
47#include <sch_base_frame.h>
49#include <widgets/wx_panel.h>
50#include <wx/msgdlg.h>
51
52
60
61
63 PANEL_COLOR_SETTINGS( aParent ),
64 m_preview( nullptr ),
65 m_page( nullptr ),
66 m_titleBlock( nullptr ),
67 m_drawingSheet( nullptr ),
69{
70 m_colorNamespace = "schematic";
71
72 COMMON_SETTINGS* common_settings = Pgm().GetCommonSettings();
73 EESCHEMA_SETTINGS* app_settings = GetAppSettings<EESCHEMA_SETTINGS>( "eeschema" );
74 COLOR_SETTINGS* current = ::GetColorSettings( app_settings ? app_settings->m_ColorTheme : DEFAULT_THEME );
75
76 // Saved theme doesn't exist? Reset to default
77 if( current->GetFilename() != app_settings->m_ColorTheme )
78 app_settings->m_ColorTheme = current->GetFilename();
79
80 createThemeList( app_settings->m_ColorTheme );
81
82 m_optOverrideColors->SetValue( current->GetOverrideSchItemColors() );
83
84 m_currentSettings = new COLOR_SETTINGS( *current );
85
86 for( int id = SCH_LAYER_ID_START; id < SCH_LAYER_ID_END; id++ )
87 {
88 if( g_excludedLayers.count( id ) )
89 continue;
90
91 m_validLayers.push_back( id );
92 }
93
95
96 m_galDisplayOptions.ReadConfig( *common_settings, app_settings->m_Window, this );
97 m_galDisplayOptions.m_forceDisplayCursor = false;
98
100}
101
102
104{
105 delete m_page;
106 delete m_titleBlock;
107 delete m_drawingSheet;
108 delete m_currentSettings;
109
110 for( EDA_ITEM* item : m_previewItems )
111 {
112 // Avoid referencing items after they are deleted (we don't control order)
113 item->SetParent( nullptr );
114 delete item;
115 }
116}
117
118
120{
121 m_currentSettings->SetOverrideSchItemColors( m_optOverrideColors->GetValue() );
122
123 if( !saveCurrentTheme( true ) )
124 return false;
125
127 cfg->m_ColorTheme = m_currentSettings->GetFilename();
128
129 return true;
130}
131
132
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,
154 wxGetTopLevelParent( this ) ) == wxNO )
155 return false;
156
157 break;
158 }
159 }
160
161 return true;
162}
163
164
166{
167 for( int layer : m_validLayers )
168 {
169 COLOR4D color = m_currentSettings->GetColor( layer );
170
171 // Do not allow non-background layers to be completely white.
172 // This ensures the BW printing recognizes that the colors should be printed black.
173 if( color == COLOR4D::WHITE && layer != LAYER_SCHEMATIC_BACKGROUND
174 && layer != LAYER_SHEET_BACKGROUND )
175 {
176 color.Darken( 0.01 );
177 }
178
179 m_currentSettings->SetColor( layer, color );
180 }
181
182 return PANEL_COLOR_SETTINGS::saveCurrentTheme( aValidate );
183}
184
185
187{
188 std::vector<SCH_LAYER_ID> layers;
189
191 {
192 if( g_excludedLayers.count( i ) )
193 continue;
194
195 layers.push_back( i );
196 }
197
198 std::sort( layers.begin(), layers.end(),
199 []( SCH_LAYER_ID a, SCH_LAYER_ID b )
200 {
201 return LayerName( a ) < LayerName( b );
202 } );
203
204 for( int layer : layers )
205 {
206 wxString name = LayerName( layer );
207
208 if( layer == LAYER_SCHEMATIC_GRID_AXES )
209 name += wxS( " " ) + _( "(symbol editor only)" );
210
211 createSwatch( layer, name );
212 }
213
214 // Give a minimal width to m_colorsListWindow, in order to always having
215 // a full row shown
216 int min_width = m_colorsGridSizer->GetMinSize().x;
217 const int margin = 20; // A margin around the sizer
218 m_colorsListWindow->SetMinSize( wxSize( min_width + margin, -1 ) );
219
220 m_preview = new SCH_PREVIEW_PANEL( m_panel1, wxID_ANY, wxDefaultPosition, wxSize( -1, -1 ),
222 m_preview->SetStealsFocus( false );
223 m_preview->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER );
224 m_preview->GetGAL()->SetAxesEnabled( false );
225
226 SCH_RENDER_SETTINGS* settings = m_preview->GetRenderSettings();
227 settings->m_IsSymbolEditor = true;
228
229 m_colorsMainSizer->Add( m_preview, 1, wxTOP | wxEXPAND, 1 );
230
231 m_colorsMainSizer->Layout();
232
237}
238
239
245
246
248{
249 KIGFX::VIEW* view = m_preview->GetView();
250
251 std::vector<DANGLING_END_ITEM> endPointsByType;
252
255 m_titleBlock->SetTitle( _( "Color Preview" ) );
256 m_titleBlock->SetDate( wxDateTime::Now().FormatDate() );
257
258 m_page->SetHeightMils( 5000 );
259 m_page->SetWidthMils( 6000 );
260
263 m_drawingSheet->SetPageBorderColorLayer( LAYER_SCHEMATIC_PAGE_LIMITS );
264 view->Add( m_drawingSheet );
265
266 // TODO: It would be nice to parse a schematic file here.
267
268 auto addItem = [&]( EDA_ITEM* aItem )
269 {
270 view->Add( aItem );
271 m_previewItems.push_back( aItem );
272 };
273
274 std::vector<std::pair<SCH_LAYER_ID, std::pair<VECTOR2I, VECTOR2I>>> lines = {
275 { LAYER_WIRE, { { 1950, 1500 }, { 2325, 1500 } } },
276 { LAYER_WIRE, { { 1950, 2600 }, { 2350, 2600 } } },
277 { LAYER_WIRE, { { 2150, 1700 }, { 2325, 1700 } } },
278 { LAYER_WIRE, { { 2150, 2000 }, { 2150, 1700 } } },
279 { LAYER_WIRE, { { 2925, 1600 }, { 3075, 1600 } } },
280 { LAYER_WIRE, { { 3075, 1600 }, { 3075, 2000 } } },
281 { LAYER_WIRE, { { 3075, 1600 }, { 3250, 1600 } } },
282 { LAYER_WIRE, { { 3075, 2000 }, { 2150, 2000 } } },
283 { LAYER_BUS, { { 1750, 1300 }, { 1850, 1300 } } },
284 { LAYER_BUS, { { 1850, 2500 }, { 1850, 1300 } } },
285 { LAYER_NOTES, { { 2350, 2125 }, { 2350, 2300 } } },
286 { LAYER_NOTES, { { 2350, 2125 }, { 2950, 2125 } } },
287 { LAYER_NOTES, { { 2950, 2125 }, { 2950, 2300 } } },
288 { LAYER_NOTES, { { 2950, 2300 }, { 2350, 2300 } } }
289 };
290
291 for( const std::pair<SCH_LAYER_ID, std::pair<VECTOR2I, VECTOR2I>>& line : lines )
292 {
293 SCH_LINE* wire = new SCH_LINE;
294 wire->SetLayer( line.first );
295 STROKE_PARAMS stroke = wire->GetStroke();
296 stroke.SetWidth( schIUScale.MilsToIU( 6 ) );
297
298 if( line.first != LAYER_NOTES )
299 {
301
302 if( line.first == LAYER_BUS )
303 stroke.SetWidth( schIUScale.MilsToIU( 12 ) );
304
305 }
306
307 wire->SetStroke( stroke );
308
309 wire->SetStartPoint( VECTOR2I( schIUScale.MilsToIU( line.second.first.x ),
310 schIUScale.MilsToIU( line.second.first.y ) ) );
311 wire->SetEndPoint( VECTOR2I( schIUScale.MilsToIU( line.second.second.x ),
312 schIUScale.MilsToIU( line.second.second.y ) ) );
313 addItem( wire );
314 }
315
316#define MILS_POINT( x, y ) VECTOR2I( schIUScale.MilsToIU( x ), schIUScale.MilsToIU( y ) )
317
319 nc->SetPosition( MILS_POINT( 2350, 2600 ) );
320 addItem( nc );
321
323 e1->SetPosition( MILS_POINT( 1850, 1400 ) );
324 addItem( e1 );
325
327 e2->SetPosition( MILS_POINT( 1850, 2500 ) );
328 addItem( e2 );
329
330 SCH_TEXT* t1 = new SCH_TEXT( MILS_POINT( 2650, 2240 ), wxT( "PLAIN TEXT" ) );
331 addItem( t1 );
332
333 SCH_LABEL* t2 = new SCH_LABEL( MILS_POINT( 1975, 1500 ), wxT( "LABEL_{0}" ) );
335 t2->SetIsDangling( false );
336 addItem( t2 );
337
338 SCH_LABEL* t3 = new SCH_LABEL( MILS_POINT( 1975, 2600 ), wxT( "LABEL_{1}" ) );
340 t3->SetIsDangling( false );
341 addItem( t3 );
342
343 SCH_GLOBALLABEL* t4 = new SCH_GLOBALLABEL( MILS_POINT( 1750, 1300 ), wxT( "GLOBAL[0..3]" ) );
345 t4->SetIsDangling( false );
346 addItem( t4 );
347
348 SCH_HIERLABEL* t5 = new SCH_HIERLABEL( MILS_POINT( 3250, 1600 ), wxT( "HIER_LABEL" ) );
350 t5->SetIsDangling( false );
351 addItem( t5 );
352
353 SCH_JUNCTION* j = new SCH_JUNCTION( MILS_POINT( 3075, 1600 ) );
354 addItem( j );
355
356 t2->SetSelected();
357
358 {
359 auto mapLibItemPosition =
360 []( const VECTOR2I& aLibPosition ) -> VECTOR2I
361 {
362 // Currently, the mapping is a no-op.
363 return VECTOR2I( aLibPosition.x, aLibPosition.y );
364 };
365
366 LIB_SYMBOL* symbol = new LIB_SYMBOL( wxEmptyString );
367 VECTOR2I p( 2625, 1600 );
368
369 SCH_FIELD& ref = symbol->GetReferenceField();
370
371 ref.SetText( wxT( "U1" ) );
372 ref.SetPosition( MILS_POINT( p.x + 30, p.y - 260 ) );
374
375 SCH_FIELD& value = symbol->GetValueField();
376
377 value.SetText( wxT( "OPA604" ) );
378 value.SetPosition( MILS_POINT( p.x + 30, p.y - 180 ) );
380
381 symbol->SetShowPinNames( true );
382 symbol->SetShowPinNumbers( true );
383 symbol->SetPinNameOffset( 0 );
384
385 SCH_SHAPE* comp_body = new SCH_SHAPE( SHAPE_T::POLY, LAYER_DEVICE );
386
387 comp_body->SetParent( symbol );
388 comp_body->SetUnit( 0 );
389 comp_body->SetBodyStyle( 0 );
390 comp_body->SetStroke( STROKE_PARAMS( schIUScale.MilsToIU( 10 ), LINE_STYLE::SOLID ) );
392 comp_body->AddPoint( MILS_POINT( p.x - 200, p.y + 200 ) );
393 comp_body->AddPoint( MILS_POINT( p.x + 200, p.y ) );
394 comp_body->AddPoint( MILS_POINT( p.x - 200, p.y - 200 ) );
395 comp_body->AddPoint( MILS_POINT( p.x - 200, p.y + 200 ) );
396
397 addItem( comp_body );
398
399 SCH_PIN* pin = new SCH_PIN( symbol );
400
401 pin->SetPosition( MILS_POINT( p.x - 300, p.y - 100 ) );
402 pin->SetLength( schIUScale.MilsToIU( 100 ) );
403 pin->SetOrientation( PIN_ORIENTATION::PIN_RIGHT );
405 pin->SetNumber( wxT( "1" ) );
406 pin->SetName( wxT( "-" ) );
407 pin->SetNumberTextSize( schIUScale.MilsToIU( 50 ) );
408 pin->SetNameTextSize( schIUScale.MilsToIU( 50 ) );
409
410 endPointsByType.emplace_back( PIN_END, pin, mapLibItemPosition( pin->GetPosition() ) );
411 symbol->AddDrawItem( pin );
412
413 pin = new SCH_PIN( symbol );
414
415 pin->SetPosition( MILS_POINT( p.x - 300, p.y + 100 ) );
416 pin->SetLength( schIUScale.MilsToIU( 100 ) );
417 pin->SetOrientation( PIN_ORIENTATION::PIN_RIGHT );
419 pin->SetNumber( wxT( "2" ) );
420 pin->SetName( wxT( "+" ) );
421 pin->SetNumberTextSize( schIUScale.MilsToIU( 50 ) );
422 pin->SetNameTextSize( schIUScale.MilsToIU( 50 ) );
423
424 endPointsByType.emplace_back( PIN_END, pin, mapLibItemPosition( pin->GetPosition() ) );
425 symbol->AddDrawItem( pin );
426
427 pin = new SCH_PIN( symbol );
428
429 pin->SetPosition( MILS_POINT( p.x + 300, p.y ) );
430 pin->SetLength( schIUScale.MilsToIU( 100 ) );
431 pin->SetOrientation( PIN_ORIENTATION::PIN_LEFT );
433 pin->SetNumber( wxT( "3" ) );
434 pin->SetName( wxT( "OUT" ) );
435 pin->SetNumberTextSize( schIUScale.MilsToIU( 50 ) );
436 pin->SetNameTextSize( schIUScale.MilsToIU( 50 ) );
437
438 endPointsByType.emplace_back( PIN_END, pin, mapLibItemPosition( pin->GetPosition() ) );
439 symbol->AddDrawItem( pin );
440
441 addItem( symbol );
442 }
443
444 SCH_SHEET* s = new SCH_SHEET( nullptr, MILS_POINT( 4000, 1300 ), MILS_POINT( 800, 1300 ) );
445 s->GetField( FIELD_T::SHEET_NAME )->SetText( wxT( "SHEET" ) );
446 s->GetField( FIELD_T::SHEET_FILENAME )->SetText( _( "/path/to/sheet" ) );
447 s->AutoplaceFields( nullptr, AUTOPLACE_AUTO );
448 addItem( s );
449
450 SCH_SHEET_PIN* sp = new SCH_SHEET_PIN( s, MILS_POINT( 4500, 1500 ), wxT( "SHEET PIN" ) );
451 addItem( sp );
452
453 for( EDA_ITEM* item : m_previewItems )
454 {
455 SCH_ITEM* sch_item = dynamic_cast<SCH_ITEM*>( item );
456
457 if( sch_item && sch_item->IsConnectable() )
458 {
459 sch_item->AutoplaceFields( nullptr, AUTOPLACE_AUTO );
460 sch_item->GetEndPoints( endPointsByType );
461 }
462 }
463
464 std::vector<DANGLING_END_ITEM> endPointsByPos = endPointsByType;
465 DANGLING_END_ITEM_HELPER::sort_dangling_end_items( endPointsByType, endPointsByPos );
466
467 for( EDA_ITEM* item : m_previewItems )
468 {
469 SCH_ITEM* sch_item = dynamic_cast<SCH_ITEM*>( item );
470
471 if( sch_item && sch_item->IsConnectable() )
472 sch_item->UpdateDanglingState( endPointsByType, endPointsByPos, nullptr );
473 }
474
476}
477
478
483
484
490
491
493{
494 if( !m_preview )
495 return;
496
497 KIGFX::VIEW* view = m_preview->GetView();
498 auto settings = static_cast<SCH_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
499 settings->LoadColors( m_currentSettings );
500
501 m_preview->GetGAL()->SetClearColor( settings->GetBackgroundColor() );
502
504 auto rect = m_preview->GetScreenRect();
505 m_preview->Refresh( true, &rect );
506}
507
508
510{
511 if( m_preview )
512 {
513 KIGFX::VIEW* view = m_preview->GetView();
514
515 view->SetScale( 1.0 );
516 VECTOR2D screenSize = view->ToWorld( ToVECTOR2D( m_preview->GetClientSize() ), false );
517
518 VECTOR2I psize( m_page->GetWidthIU( schIUScale.IU_PER_MILS ),
519 m_page->GetHeightIU( schIUScale.IU_PER_MILS ) );
520 double scale = view->GetScale() / std::max( fabs( psize.x / screenSize.x ),
521 fabs( psize.y / screenSize.y ) );
522
523 view->SetScale( scale * m_galDisplayOptions.m_scaleFactor * 0.8 /* margin */ );
524 view->SetCenter( m_drawingSheet->ViewBBox().Centre() );
525 m_preview->ForceRefresh();
526 }
527}
528
529
530void PANEL_EESCHEMA_COLOR_SETTINGS::OnSize( wxSizeEvent& aEvent )
531{
533 aEvent.Skip();
534}
535
536
538{
539 // If the theme is not overriding individual item colors then don't show them so that
540 // the user doesn't get seduced into thinking they'll have some effect.
541
542 if( m_labels.count( LAYER_SHEET ) )
543 m_labels[ LAYER_SHEET ]->Show( m_currentSettings->GetOverrideSchItemColors() );
544
545 if( m_swatches.count( LAYER_SHEET ) )
546 m_swatches[ LAYER_SHEET ]->Show( m_currentSettings->GetOverrideSchItemColors() );
547
548 if( m_labels.count( LAYER_SHEET_BACKGROUND ) )
549 m_labels[ LAYER_SHEET_BACKGROUND ]->Show( m_currentSettings->GetOverrideSchItemColors() );
550
552 m_swatches[ LAYER_SHEET_BACKGROUND ]->Show( m_currentSettings->GetOverrideSchItemColors() );
553
554 m_colorsGridSizer->Layout();
555 m_colorsListWindow->Layout();
556}
557
558
560{
561 m_currentSettings->SetOverrideSchItemColors( m_optOverrideColors->GetValue() );
563}
const char * name
constexpr EDA_IU_SCALE schIUScale
Definition base_units.h:130
WINDOW_SETTINGS m_Window
wxString m_ColorTheme
Active color theme name.
static const COLOR4D WHITE
Definition color4d.h:403
Color settings are a bit different than most of the settings objects in that there can be more than o...
bool GetOverrideSchItemColors() const
static void sort_dangling_end_items(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos)
static GAL_TYPE ResolveStoredCanvasType(int aStoredCanvasType)
Convert a stored canvas type setting into a backend that can actually be used.
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:150
virtual void SetParent(EDA_ITEM *aParent)
Definition eda_item.cpp:153
void SetFillMode(FILL_T aFill)
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
Definition eda_text.cpp:370
wxString GetFilename() const
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
COLOR4D & Darken(double aFactor)
Makes the color darker by a given factor.
Definition color4d.h:223
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:68
double GetScale() const
Definition view.h:298
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
Definition view.cpp:901
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition view.cpp:365
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:791
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition view.cpp:2475
PAINTER * GetPainter() const
Return the painter object used by the view for drawing VIEW_ITEM objects.
Definition view.h:242
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
Definition view.cpp:971
Define a library symbol object.
Definition lib_symbol.h:114
SCH_FIELD & GetValueField()
Definition lib_symbol.h:447
void AddDrawItem(SCH_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
SCH_FIELD & GetReferenceField()
Definition lib_symbol.h:451
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition page_info.h:75
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
PANEL_COLOR_SETTINGS(wxWindow *aParent)
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
void onColorChanged() override
Event fired when the user changes any color.
virtual COMMON_SETTINGS * GetCommonSettings() const
Definition pgm_base.cpp:562
void SetPosition(const VECTOR2I &aPosition) override
Class for a wire to bus entry.
void SetPosition(const VECTOR2I &aPosition) override
void SetText(const wxString &aText) override
void SetSpinStyle(SPIN_STYLE aSpinStyle) override
void SetSpinStyle(SPIN_STYLE aSpinStyle) override
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:170
virtual void SetBodyStyle(int aBodyStyle)
Definition sch_item.h:252
virtual bool IsConnectable() const
Definition sch_item.h:550
virtual void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo)
Definition sch_item.h:681
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:502
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:522
void SetLayer(SCH_LAYER_ID aLayer)
Definition sch_item.h:354
virtual void SetUnit(int aUnit)
Definition sch_item.h:242
void SetIsDangling(bool aIsDangling)
Definition sch_label.h:326
virtual void SetSpinStyle(SPIN_STYLE aSpinStyle)
Segment description base class to describe items which have 2 end points (track, wire,...
Definition sch_line.h:39
void SetStartPoint(const VECTOR2I &aPosition)
Definition sch_line.h:137
virtual STROKE_PARAMS GetStroke() const override
Definition sch_line.h:198
virtual void SetStroke(const STROKE_PARAMS &aStroke) override
Definition sch_line.h:199
void SetEndPoint(const VECTOR2I &aPosition)
Definition sch_line.h:146
void SetPosition(const VECTOR2I &aPosition) override
void LoadColors(const COLOR_SETTINGS *aSettings) override
void SetStroke(const STROKE_PARAMS &aStroke) override
Definition sch_shape.cpp:98
void AddPoint(const VECTOR2I &aPosition)
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:48
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this sheet.
void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo) override
Simple container to manage line stroke parameters.
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:174
virtual void SetShowPinNames(bool aShow)
Set or clear the pin name visibility flag.
Definition symbol.h:168
void SetPinNameOffset(int aOffset)
Set the offset in mils of the pin name text from the pin symbol.
Definition symbol.h:162
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition title_block.h:38
#define _(s)
@ FILLED_WITH_BG_BODYCOLOR
Definition eda_fill.h:32
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:477
@ LAYER_DANGLING
Definition layer_ids.h:505
@ LAYER_DEVICE
Definition layer_ids.h:494
@ LAYER_SHEET_BACKGROUND
Definition layer_ids.h:513
@ LAYER_WIRE
Definition layer_ids.h:480
@ LAYER_NOTES
Definition layer_ids.h:495
@ LAYER_NET_COLOR_HIGHLIGHT
Definition layer_ids.h:521
@ LAYER_BUS
Definition layer_ids.h:481
@ LAYER_GROUP
Definition layer_ids.h:531
@ SCH_LAYER_ID_END
Definition layer_ids.h:533
@ SCH_LAYER_ID_START
Definition layer_ids.h:478
@ LAYER_SCHEMATIC_DRAWINGSHEET
Definition layer_ids.h:524
@ LAYER_SCHEMATIC_GRID_AXES
Definition layer_ids.h:515
@ LAYER_NOTES_BACKGROUND
Definition layer_ids.h:497
@ LAYER_SCHEMATIC_PAGE_LIMITS
Definition layer_ids.h:525
@ LAYER_SHEET
Definition layer_ids.h:499
@ LAYER_SCHEMATIC_BACKGROUND
Definition layer_ids.h:516
@ COLOR
Color has changed.
Definition view_item.h:50
#define MILS_POINT(x, y)
std::set< int > g_excludedLayers
PGM_BASE & Pgm()
The global program "get" accessor.
see class PGM_BASE
@ PT_INPUT
usual pin input: must be connected
Definition pin_type.h:33
@ PT_OUTPUT
usual output
Definition pin_type.h:34
@ PIN_RIGHT
The pin extends rightwards from the connection point.
Definition pin_type.h:107
@ PIN_LEFT
The pin extends leftwards from the connection point: Probably on the right side of the symbol.
Definition pin_type.h:114
@ AUTOPLACE_AUTO
Definition sch_item.h:75
@ PIN_END
Definition sch_item.h:87
#define DEFAULT_THEME
COLOR_SETTINGS * GetColorSettings(const wxString &aName)
T * GetAppSettings(const char *aFilename)
const int scale
int canvas_type
EDA_DRAW_PANEL_GAL::GAL_TYPE_* value, see gal_options_panel.cpp.
KIBIS_PIN * pin
@ GR_TEXT_H_ALIGN_LEFT
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708
VECTOR2< double > VECTOR2D
Definition vector2d.h:707
VECTOR2D ToVECTOR2D(const wxPoint &aPoint)
Definition vector2wx.h:36