52#include <wx/bmpbuttn.h>
53#include <wx/checkbox.h>
54#include <wx/hyperlink.h>
55#include <wx/radiobut.h>
58#include <wx/statline.h>
59#include <wx/textdlg.h>
71 m_labelAttr->SetBackgroundColour( aBackgroundColor );
84 wxGridCellAttr* attr =
nullptr;
103 wxASSERT(
static_cast<size_t>( aRow ) <
m_nets.size() );
110 default:
return wxEmptyString;
117 wxASSERT(
static_cast<size_t>( aRow ) <
m_nets.size() );
129 net.
visible = ( aValue != wxT(
"0" ) );
149 case COL_LABEL:
return wxGRID_VALUE_STRING;
150 default:
return wxGRID_VALUE_STRING;
157 wxASSERT(
static_cast<size_t>( aRow ) <
m_nets.size() );
160 return m_nets[aRow].visible;
166 wxASSERT(
static_cast<size_t>( aRow ) <
m_nets.size() );
169 m_nets[aRow].visible = aValue;
177 wxASSERT( aTypeName == wxT(
"COLOR4D" ) );
178 wxASSERT(
static_cast<size_t>( aRow ) <
m_nets.size() );
187 wxASSERT( aTypeName == wxT(
"COLOR4D" ) );
188 wxASSERT(
static_cast<size_t>( aRow ) <
m_nets.size() );
195 wxGridTableMessage msg(
this, wxGRIDTABLE_REQUEST_VIEW_GET_VALUES );
196 GetView()->ProcessTableMessage( msg );
203 wxASSERT(
static_cast<size_t>( aRow ) <
m_nets.size() );
213 return aEntry.code == aCode;
234 int deleted =
m_nets.size();
239 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, 0, deleted );
240 GetView()->ProcessTableMessage( msg );
243 for(
const std::pair<const wxString, NETINFO_ITEM*>& pair : nets )
245 int netCode = pair.second->GetNetCode();
247 if( netCode > 0 && !pair.first.StartsWith( wxT(
"unconnected-(" ) ) )
249 COLOR4D color = netColors.count( netCode ) ? netColors.at( netCode ) :
250 COLOR4D::UNSPECIFIED;
252 bool visible = hiddenNets.count( netCode ) == 0;
262 return a.name < b.name;
267 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED,
m_nets.size() );
268 GetView()->ProcessTableMessage( msg );
282 GetView()->ForceRefresh();
290 net.visible = ( net.code == aNet.
code );
295 GetView()->ForceRefresh();
313 std::map<int, KIGFX::COLOR4D>& netColors = renderSettings->
GetNetColorMap();
315 if( aNet.
color != COLOR4D::UNSPECIFIED )
318 netColors.erase( aNet.
code );
329#define RR APPEARANCE_CONTROLS::APPEARANCE_SETTING
399 bool aFpEditorMode ) :
402 m_focusOwner( aFocusOwner ),
404 m_isFpEditor( aFpEditorMode ),
405 m_currentPreset( nullptr ),
406 m_lastSelectedUserPreset( nullptr ),
407 m_layerContextMenu( nullptr )
412 int screenHeight = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y );
414 m_pointSize = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ).GetPointSize();
439 "Use %s+Tab to activate selector.\n"
440 "Successive Tabs while holding %s down will "
441 "cycle through presets in the popup." ),
446 "Use %s+Tab to activate selector.\n"
447 "Successive Tabs while holding %s down will "
448 "cycle through viewports in the popup." ),
462 if( screenHeight <= 900 && m_pointSize >= indicatorSize )
472 auto setHighContrastMode =
483 [=]( wxCommandEvent& aEvent )
489 [=]( wxCommandEvent& aEvent )
495 [=]( wxCommandEvent& aEvent )
503 [&]( wxCommandEvent& aEvent )
510 [&]( wxCommandEvent& aEvent )
514 editframe->ShowBoardSetupDialog(
_(
"Net Classes" ) );
521 [&]( wxCommandEvent& aEvent )
531 m_netsGrid->RegisterDataType( wxT(
"COLOR4D" ),
539 m_netsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
543 const int cellPadding = 6;
545 const int rowHeightPadding = 5;
547 const int rowHeightPadding = 3;
557 m_netsGrid->SetDefaultRowSize( font.GetPixelSize().y + rowHeightPadding );
566 m_netsGrid->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_DEFAULT );
611 _(
"Layer Display Options" ) );
617 wxBoxSizer* layerDisplayOptionsSizer;
618 layerDisplayOptionsSizer =
new wxBoxSizer( wxVERTICAL );
625 msg =
_(
"Inactive layers:" );
632 wxBoxSizer* contrastModeSizer;
633 contrastModeSizer =
new wxBoxSizer( wxHORIZONTAL );
636 wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
642 contrastModeSizer->AddStretchSpacer();
649 contrastModeSizer->AddStretchSpacer();
656 contrastModeSizer->AddStretchSpacer();
658 layerDisplayOptionsSizer->Add( contrastModeSizer, 0, wxEXPAND, 5 );
661 wxDefaultSize, wxLI_HORIZONTAL );
664 m_cbFlipBoard =
new wxCheckBox( layerDisplayPane, wxID_ANY,
_(
"Flip board view" ) );
666 layerDisplayOptionsSizer->Add(
m_cbFlipBoard, 0, wxTOP | wxBOTTOM, 5 );
668 layerDisplayPane->SetSizer( layerDisplayOptionsSizer );
669 layerDisplayPane->Layout();
670 layerDisplayOptionsSizer->Fit( layerDisplayPane );
675 [&]( wxCommandEvent& aEvent )
686 _(
"Net Display Options" ) );
691 wxBoxSizer* netDisplayOptionsSizer =
new wxBoxSizer( wxVERTICAL );
700 msg =
_(
"Net colors:" );
709 wxBoxSizer* netColorSizer =
new wxBoxSizer( wxHORIZONTAL );
711 m_rbNetColorAll =
new wxRadioButton( netDisplayPane, wxID_ANY,
_(
"All" ), wxDefaultPosition,
712 wxDefaultSize, wxRB_GROUP );
714 m_rbNetColorAll->SetToolTip(
_(
"Net and netclass colors are shown on all copper items" ) );
717 netColorSizer->AddStretchSpacer();
725 netColorSizer->AddStretchSpacer();
727 m_rbNetColorOff =
new wxRadioButton( netDisplayPane, wxID_ANY,
_(
"None" ) );
729 m_rbNetColorOff->SetToolTip(
_(
"Net and netclass colors are not shown" ) );
733 netDisplayOptionsSizer->Add( netColorSizer, 0, wxEXPAND | wxBOTTOM, 5 );
742 msg =
_(
"Ratsnest display:" );
751 wxBoxSizer* ratsnestDisplayModeSizer =
new wxBoxSizer( wxHORIZONTAL );
754 wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
760 ratsnestDisplayModeSizer->AddStretchSpacer();
767 ratsnestDisplayModeSizer->AddStretchSpacer();
775 netDisplayOptionsSizer->Add( ratsnestDisplayModeSizer, 0, wxEXPAND | wxBOTTOM, 5 );
779 netDisplayPane->SetSizer( netDisplayOptionsSizer );
780 netDisplayPane->Layout();
781 netDisplayOptionsSizer->Fit( netDisplayPane );
786 [&]( wxCommandEvent& aEvent )
817 int page = aEvent.GetSelection();
820 m_notebook->ChangeSelection(
static_cast<unsigned>( page ) );
849 if( wxBitmapButton* btn =
dynamic_cast<wxBitmapButton*
>( aEvent.GetEventObject() ) )
851 wxCommandEvent evt( wxEVT_BUTTON );
852 wxPostEvent( btn, evt );
869 int row =
event.GetRow();
870 int col =
event.GetCol();
887 int row =
event.GetRow();
888 int col =
event.GetCol();
910 menu.Append(
new wxMenuItem( &menu,
ID_SET_NET_COLOR,
_(
"Set Net Color" ), wxEmptyString,
917 wxEmptyString, wxITEM_NORMAL ) );
920 wxEmptyString, wxITEM_NORMAL ) );
922 menu.AppendSeparator();
924 menu.Append(
new wxMenuItem( &menu,
ID_SHOW_ALL_NETS,
_(
"Show All Nets" ), wxEmptyString,
927 wxEmptyString, wxITEM_NORMAL ) );
937 wxPoint pos =
m_netsGrid->CalcUnscrolledPosition( aEvent.GetPosition() );
938 wxGridCellCoords cell =
m_netsGrid->XYToCell( pos );
940 if( aEvent.Moving() || aEvent.Entering() )
958 wxString showOrHide = net.
visible ?
_(
"Click to hide ratsnest for %s" )
959 :
_(
"Click to show ratsnest for %s" );
964 tip.Printf( showOrHide,
name );
968 tip =
_(
"Double click (or middle click) to change color; "
969 "right click for more actions" );
972 m_netsGrid->GetGridWindow()->SetToolTip( tip );
974 else if( aEvent.Leaving() )
979 else if( aEvent.Dragging() )
987 else if( aEvent.ButtonUp( wxMOUSE_BTN_MIDDLE ) && !!cell )
989 int row = cell.GetRow();
990 int col = cell.GetCol();
1079 bool rebuild = std::any_of( aBoardItems.begin(), aBoardItems.end(),
1082 return a->Type() == PCB_NETINFO_T;
1161 if( child && child->GetWindow() )
1166 m_netsGrid->RegisterDataType( wxT(
"COLOR4D" ),
1172 if( pair.second->ctl_color )
1173 pair.second->ctl_color->OnDarkModeToggle();
1182 for(
const std::unique_ptr<APPEARANCE_SETTING>& setting :
m_layerSettings )
1185 setting->ctl_indicator->SetIndicatorState( ROW_ICON_PROVIDER::STATE::OFF );
1192 if( r < 240 || g < 240 || b < 240 )
1194 r = wxChar( std::min( (
int) r + 15, 255 ) );
1195 g = wxChar( std::min( (
int) g + 15, 255 ) );
1196 b = wxChar( std::min( (
int) b + 15, 255 ) );
1200 r = wxChar( std::max( (
int) r - 15, 0 ) );
1201 g = wxChar( std::max( (
int) g - 15, 0 ) );
1202 b = wxChar( std::max( (
int) b - 15, 0 ) );
1215 newSetting->
ctl_panel->SetBackgroundColour( wxColour( r, g, b ) );
1227 if( visible.test( layer ) == isVisible )
1230 visible.set( layer, isVisible );
1275 return dynamic_cast<PCB_VIA*
>( aItem ) ||
dynamic_cast<PAD*
>( aItem );
1328 for(
size_t i = 0; i < set.size(); i++ )
1380 std::vector<LAYER_PRESET> ret;
1382 for(
const std::pair<const wxString, LAYER_PRESET>& pair :
m_layerPresets )
1384 if( !pair.second.readOnly )
1385 ret.emplace_back( pair.second );
1433 wxCommandEvent
dummy;
1455 std::vector<VIEWPORT> ret;
1457 for(
const std::pair<const wxString, VIEWPORT>& pair :
m_viewports )
1458 ret.emplace_back( pair.second );
1468 for(
const VIEWPORT& viewport : aViewportList )
1486 wxCommandEvent
dummy;
1510 m_windowLayersSizerItem->SetFlag( m_windowLayersSizerItem->GetFlag() & ~wxTOP );
1514 [&]( std::unique_ptr<APPEARANCE_SETTING>& aSetting )
1516 int layer = aSetting->id;
1519 wxBoxSizer* sizer =
new wxBoxSizer( wxHORIZONTAL );
1520 panel->SetSizer( sizer );
1524 aSetting->visible = visible[layer];
1528 ROW_ICON_PROVIDER::STATE::OFF,
1534 swatch->SetToolTip(
_(
"Double click or middle click for color change, "
1535 "right click for menu" ) );
1540 aSetting->visible );
1541 btn_visible->SetToolTip(
_(
"Show or hide this layer" ) );
1543 wxStaticText* label =
new wxStaticText( panel, layer, aSetting->label );
1545 label->SetToolTip( aSetting->tooltip );
1547 sizer->AddSpacer( 1 );
1548 sizer->Add( indicator, 0, wxALIGN_CENTER_VERTICAL | wxTOP, 2 );
1549 sizer->AddSpacer( 5 );
1550 sizer->Add( swatch, 0, wxALIGN_CENTER_VERTICAL | wxTOP, 2 );
1551 sizer->AddSpacer( 6 );
1552 sizer->Add( btn_visible, 0, wxALIGN_CENTER_VERTICAL | wxTOP, 2 );
1553 sizer->AddSpacer( 5 );
1554 sizer->Add( label, 1, wxALIGN_CENTER_VERTICAL | wxTOP, 2 );
1558 aSetting->ctl_panel = panel;
1559 aSetting->ctl_indicator = indicator;
1560 aSetting->ctl_visibility = btn_visible;
1561 aSetting->ctl_color = swatch;
1562 aSetting->ctl_text = label;
1569 btn_visible->Bind( TOGGLE_CHANGED,
1570 [&]( wxCommandEvent& aEvent )
1572 wxObject* btn = aEvent.GetEventObject();
1573 int layerId =
static_cast<wxWindow*
>( btn )->GetId();
1592 [&]( std::unique_ptr<APPEARANCE_SETTING>& aSetting )
1594 int layer = aSetting->id;
1595 aSetting->visible = visible[layer];
1596 aSetting->ctl_panel->Show();
1597 aSetting->ctl_panel->SetId( layer );
1598 aSetting->ctl_indicator->SetWindowID( layer );
1599 aSetting->ctl_color->SetWindowID( layer );
1600 aSetting->ctl_color->SetSwatchColor( theme->
GetColor( layer ), false );
1601 aSetting->ctl_visibility->SetWindowID( layer );
1602 aSetting->ctl_text->SetLabelText( aSetting->label );
1603 aSetting->ctl_text->SetId( layer );
1604 aSetting->ctl_text->SetToolTip( aSetting->tooltip );
1610 static const struct {
1616 {
F_Paste,
_HKI(
"Solder paste on board's front" ) },
1617 {
B_Paste,
_HKI(
"Solder paste on board's back" ) },
1618 {
F_SilkS,
_HKI(
"Silkscreen on board's front" ) },
1619 {
B_SilkS,
_HKI(
"Silkscreen on board's back" ) },
1620 {
F_Mask,
_HKI(
"Solder mask on board's front" ) },
1621 {
B_Mask,
_HKI(
"Solder mask on board's back" ) },
1627 {
Margin,
_HKI(
"Board's edge setback outline" ) },
1628 {
F_CrtYd,
_HKI(
"Footprint courtyards on board's front" ) },
1629 {
B_CrtYd,
_HKI(
"Footprint courtyards on board's back" ) },
1630 {
F_Fab,
_HKI(
"Footprint assembly on board's front" ) },
1631 {
B_Fab,
_HKI(
"Footprint assembly on board's back" ) },
1658 std::size_t total_layers = enabled.
CuStack().size();
1660 for(
const auto& entry : non_cu_seq )
1662 if( enabled[entry.layerId] )
1672 for( std::size_t ii = total_layers; ii <
m_layerSettings.size(); ++ii )
1681 for(
LSEQ cu_stack = enabled.
CuStack(); cu_stack; ++cu_stack, ++layer_it )
1688 case F_Cu: dsc =
_(
"Front copper layer" );
break;
1689 case B_Cu: dsc =
_(
"Back copper layer" );
break;
1690 default: dsc =
_(
"Inner copper layer" );
break;
1693 std::unique_ptr<APPEARANCE_SETTING>& setting = *layer_it;
1696 setting->id = layer;
1697 setting->tooltip = dsc;
1699 if( setting->ctl_panel ==
nullptr )
1700 appendLayer( setting );
1702 updateLayer( setting );
1708 setting->ctl_text->Disable();
1709 setting->ctl_color->SetToolTip( wxEmptyString );
1713 for(
const auto& entry : non_cu_seq )
1717 if( !enabled[layer] )
1720 std::unique_ptr<APPEARANCE_SETTING>& setting = *layer_it;
1723 setting->id = layer;
1726 setting->tooltip = wxGetTranslation( entry.tooltip );
1728 if( setting->ctl_panel ==
nullptr )
1729 appendLayer( setting );
1731 updateLayer( setting );
1737 setting->ctl_text->Disable();
1738 setting->ctl_color->SetToolTip( wxEmptyString );
1756 msg =
_(
"Inactive layers:" );
1838 switch( aEvent.GetId() )
1861 visible &= ~presetAllCopper.layers;
1863 if( !visible.test( current ) && visible.count() > 0 )
1872 if( !visible.test( current ) && visible.count() > 0 )
1879 visible |= ~presetAllCopper.layers;
1930 if( aTab >= 0 &&
static_cast<size_t>( aTab ) < max )
1946 int layer = setting->id;
1948 if( setting->ctl_visibility )
1949 setting->ctl_visibility->SetValue( visible[layer] );
1951 if( setting->ctl_color )
1954 setting->ctl_color->SetSwatchColor(
color,
false );
1955 setting->ctl_color->SetReadOnly( readOnly );
1963 if( setting->ctl_visibility )
1964 setting->ctl_visibility->SetValue( objects.
Contains( layer ) );
1966 if( setting->ctl_color )
1969 setting->ctl_color->SetSwatchColor(
color,
false );
1970 setting->ctl_color->SetReadOnly( readOnly );
1985 wxWindow* eventSource =
static_cast<wxWindow*
>( aEvent.GetEventObject() );
2009 visibleLayers.set( aLayer, !visibleLayers.test( aLayer ) );
2078 if( visible.
Contains( aLayer ) != isVisible )
2080 visible.
set( aLayer, isVisible );
2099 int swatchWidth =
m_windowObjects->ConvertDialogToPixels( wxSize( 8, 0 ) ).x;
2107 [&](
const std::unique_ptr<APPEARANCE_SETTING>& aSetting )
2109 wxBoxSizer* sizer =
new wxBoxSizer( wxHORIZONTAL );
2110 int layer = aSetting->id;
2116 if(
color != COLOR4D::UNSPECIFIED )
2120 swatch->SetToolTip(
_(
"Left double click or middle click for color change, "
2121 "right click for menu" ) );
2123 sizer->Add( swatch, 0, wxALIGN_CENTER_VERTICAL, 0 );
2124 aSetting->ctl_color = swatch;
2134 sizer->AddSpacer( swatchWidth );
2140 aSetting->visible );
2143 tip.Printf(
_(
"Show or hide %s" ), aSetting->label.Lower() );
2144 btn_visible->SetToolTip( tip );
2146 aSetting->ctl_visibility = btn_visible;
2148 sizer->AddSpacer( 5 );
2150 btn_visible->Bind( TOGGLE_CHANGED,
2151 [&]( wxCommandEvent& aEvent )
2153 int id =
static_cast<wxWindow*
>( aEvent.GetEventObject() )->GetId();
2154 bool isVisible = aEvent.GetInt();
2158 wxStaticText* label =
new wxStaticText(
m_windowObjects, layer, aSetting->label );
2160 label->SetToolTip( aSetting->tooltip );
2162 if( aSetting->can_control_opacity )
2164 label->SetMinSize( wxSize( labelWidth, -1 ) );
2166 sizer->Add( btn_visible, 0, wxALIGN_CENTER_VERTICAL | wxBOTTOM, 10 );
2167 sizer->AddSpacer( 5 );
2168 sizer->Add( label, 0, wxALIGN_CENTER_VERTICAL | wxBOTTOM, 10 );
2170 sizer->Add( btn_visible, 0, wxALIGN_CENTER_VERTICAL, 0 );
2171 sizer->AddSpacer( 5 );
2172 sizer->Add( label, 0, wxALIGN_CENTER_VERTICAL, 0 );
2175 wxSlider* slider =
new wxSlider(
m_windowObjects, wxID_ANY, 100, 0, 100,
2176 wxDefaultPosition, wxDefaultSize,
2179 slider->SetMinSize( wxSize( 80, 16 ) );
2181 slider->SetMinSize( wxSize( 80, -1 ) );
2184 tip.Printf(
_(
"Set opacity of %s" ), aSetting->label.Lower() );
2185 slider->SetToolTip( tip );
2187 sizer->Add( slider, 1, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5 );
2188 aSetting->ctl_opacity = slider;
2190 auto opacitySliderHandler =
2191 [=]( wxCommandEvent& aEvent )
2193 wxSlider* ctrl =
static_cast<wxSlider*
>( aEvent.GetEventObject() );
2194 int value = ctrl->GetValue();
2198 slider->Bind( wxEVT_SCROLL_CHANGED, opacitySliderHandler );
2199 slider->Bind( wxEVT_SCROLL_THUMBTRACK, opacitySliderHandler );
2204 sizer->Add( btn_visible, 0, wxALIGN_CENTER_VERTICAL, 0 );
2205 sizer->AddSpacer( 5 );
2206 sizer->Add( label, 0, wxALIGN_CENTER_VERTICAL, 0 );
2209 aSetting->ctl_text = label;
2212 if( !aSetting->can_control_opacity )
2221 if( !s_setting.spacer )
2223 m_objectSettings.emplace_back( std::make_unique<APPEARANCE_SETTING>( s_setting ) );
2229 setting->tooltip = wxGetTranslation( s_setting.tooltip );
2230 setting->label = wxGetTranslation( s_setting.label );
2232 if( setting->can_control_opacity )
2235 labelWidth = std::max( labelWidth, width );
2242 for(
const std::unique_ptr<APPEARANCE_SETTING>& setting :
m_objectSettings )
2244 if( setting->spacer )
2247 appendObject( setting );
2262 if( setting->spacer )
2267 if( setting->ctl_visibility )
2268 setting->ctl_visibility->SetValue( visible.
Contains( layer ) );
2270 if( setting->ctl_color )
2273 setting->ctl_color->SetSwatchColor(
color,
false );
2292 const wxString& aName )
2294 if( !isDefaultClass)
2296 aMenu.Append(
new wxMenuItem( &aMenu,
ID_SET_NET_COLOR,
_(
"Set Netclass Color" ),
2297 wxEmptyString, wxITEM_NORMAL ) );
2304 wxEmptyString, wxITEM_NORMAL ) );
2307 wxEmptyString, wxITEM_NORMAL ) );
2310 wxEmptyString, wxITEM_NORMAL ) );
2312 aMenu.AppendSeparator();
2314 aMenu.Append(
new wxMenuItem( &aMenu,
ID_SHOW_ALL_NETS,
_(
"Show All Netclasses" ),
2315 wxEmptyString, wxITEM_NORMAL ) );
2316 aMenu.Append(
new wxMenuItem( &aMenu,
ID_HIDE_OTHER_NETS,
_(
"Hide All Other Netclasses" ),
2317 wxEmptyString, wxITEM_NORMAL ) );
2345 auto appendNetclass =
2346 [&](
int aId,
const std::shared_ptr<NETCLASS>& aClass,
bool isDefaultClass = false )
2348 wxString
name = aClass->GetName();
2355 wxBoxSizer* sizer =
new wxBoxSizer( wxHORIZONTAL );
2358 COLOR4D::UNSPECIFIED;
2362 setting->
ctl_color->SetToolTip(
_(
"Left double click or middle click for color "
2363 "change, right click for menu" ) );
2365 setting->
ctl_color->Bind( COLOR_SWATCH_CHANGED,
2369 if( isDefaultClass )
2375 !hiddenClasses.count(
name ) );
2378 tip.Printf(
_(
"Show or hide ratsnest for nets in %s" ),
name );
2384 int flags = wxALIGN_CENTER_VERTICAL;
2386 sizer->Add( setting->
ctl_color, 0, flags | wxRESERVE_SPACE_EVEN_IF_HIDDEN, 5 );
2387 sizer->AddSpacer( 7 );
2389 sizer->AddSpacer( 3 );
2390 sizer->Add( setting->
ctl_text, 1, flags, 5 );
2400 [&,
name, isDefaultClass]( wxMouseEvent& aEvent )
2409 setting->
ctl_panel->Bind( wxEVT_RIGHT_DOWN, menuHandler );
2411 setting->
ctl_color->Bind( wxEVT_RIGHT_DOWN, menuHandler );
2412 setting->
ctl_text->Bind( wxEVT_RIGHT_DOWN, menuHandler );
2417 std::vector<wxString> names;
2419 for(
const auto& [
name, netclass ] : netSettings->m_NetClasses )
2420 names.emplace_back(
name );
2422 std::sort( names.begin(), names.end() );
2426 int idx = wxID_HIGHEST;
2429 appendNetclass( idx++, netSettings->m_DefaultNetClass,
true );
2431 for(
const wxString&
name : names )
2434 appendNetclass( idx++, netSettings->m_NetClasses.at(
name ) );
2447 msg =
_(
"Net colors:" );
2453 m_rbNetColorAll->SetToolTip(
_(
"Net and netclass colors are shown on all copper items" ) );
2459 m_rbNetColorOff->SetToolTip(
_(
"Net and netclass colors are not shown" ) );
2466 msg =
_(
"Ratsnest display:" );
2497 int default_idx = 0;
2499 for( std::pair<const wxString, LAYER_PRESET>& pair :
m_layerPresets )
2502 static_cast<void*
>( &pair.second ) );
2529 [&](
const std::pair<const wxString, LAYER_PRESET>& aPair )
2531 return ( aPair.second.layers == visibleLayers
2532 && aPair.second.renderLayers == visibleObjects );
2539 bool do_translate = it->second.readOnly;
2540 wxString
text = do_translate ? wxGetTranslation( it->first ) : it->first;
2560 wxString ui_label = aName;
2562 for( std::pair<const wxString, LAYER_PRESET>& pair :
m_layerPresets )
2564 if( pair.first != aName )
2567 if( pair.second.readOnly ==
true )
2568 ui_label = wxGetTranslation( aName );
2592 auto resetSelection =
2601 if( index == count - 3 )
2607 else if( index == count - 2 )
2615 wxTextEntryDialog dlg(
this,
_(
"Layer preset name:" ),
_(
"Save Layer Preset" ),
name );
2617 if( dlg.ShowModal() != wxID_OK )
2623 name = dlg.GetValue();
2653 else if( index == count - 1 )
2656 wxArrayString headers;
2657 std::vector<wxArrayString> items;
2659 headers.Add(
_(
"Presets" ) );
2661 for( std::pair<const wxString, LAYER_PRESET>& pair :
m_layerPresets )
2663 if( !pair.second.readOnly )
2666 item.Add( pair.first );
2667 items.emplace_back( item );
2674 if( dlg.ShowModal() == wxID_OK )
2679 if( idx != wxNOT_FOUND )
2726 activeLayer = *aPreset.
layers.
Seq().begin();
2749 for( std::pair<const wxString, VIEWPORT>& pair :
m_viewports )
2750 m_cbViewports->Append( pair.first,
static_cast<void*
>( &pair.second ) );
2783 if( index >= 0 && index < count - 3 )
2787 wxCHECK( viewport, );
2791 if( !viewport->
name.IsEmpty() )
2797 else if( index == count - 2 )
2802 wxTextEntryDialog dlg(
this,
_(
"Viewport name:" ),
_(
"Save Viewport" ),
name );
2804 if( dlg.ShowModal() != wxID_OK )
2814 name = dlg.GetValue();
2835 else if( index == count - 1 )
2838 wxArrayString headers;
2839 std::vector<wxArrayString> items;
2841 headers.Add(
_(
"Viewports" ) );
2843 for( std::pair<const wxString, VIEWPORT>& pair :
m_viewports )
2846 item.Add( pair.first );
2847 items.emplace_back( item );
2853 if( dlg.ShowModal() == wxID_OK )
2858 if( idx != wxNOT_FOUND )
2889 int layer = swatch->GetId();
2905 else if( layer ==
B_Cu )
2942 wxASSERT(
m_netsGrid->GetSelectedRows().size() == 1 );
2949 switch( aEvent.GetId() )
2960 static_cast<intptr_t
>( net.
code ) );
2966 static_cast<intptr_t
>( net.
code ) );
2972 static_cast<intptr_t
>( net.
code ) );
2995 bool show = aEvent.GetInt();
3005 if( net->GetNetClass()->GetName() == aClassName )
3010 static_cast<intptr_t
>( net->GetNetCode() ) );
3051 int classId = s->GetId();
3097 editframe->OnDisplayOptionsChanged();
3098 editframe->GetCanvas()->RedrawRatsnest();
3099 editframe->GetCanvas()->Refresh();
3118 setting = it->second;
3120 auto runOnNetsOfClass =
3121 [&](
const wxString& netClassName, std::function<
void(
NETINFO_ITEM* )> aFunction )
3125 if( net->GetNetClass()->GetName() == netClassName )
3130 switch( aEvent.GetId() )
3141 if(
color != COLOR4D::UNSPECIFIED )
3157 static bool first =
true;
3191 static_cast<intptr_t
>( aItem->
GetNetCode() ) );
3202 for(
const auto& [
name, netclass ] : netSettings->m_NetClasses )
3219 for(
const auto& [
name, netclass ] : netSettings->m_NetClasses )
3253 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Open Preferences" ),
3256 button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<
void( wxHyperlinkEvent& aEvent )>(
3257 [&]( wxHyperlinkEvent& aEvent )
3259 wxCommandEvent
dummy;
3267 infobar->
ShowMessageFor(
_(
"The current color theme is read-only. Create a new theme in "
3268 "Preferences to enable color editing." ),
3269 10000, wxICON_INFORMATION );
static std::set< int > s_allowedInFpEditor
These GAL layers are shown in the Objects tab in the footprint editor.
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Create and insert a menu item with an icon into aMenu.
@ show_front_assembly_layers
@ show_back_assembly_layers
HIGH_CONTRAST_MODE
Determine how inactive layers should be displayed.
@ NORMAL
Inactive layers are shown normally (no high-contrast mode)
@ HIDDEN
Inactive layers are hidden.
@ DIMMED
Inactive layers are dimmed (old high-contrast mode)
@ RATSNEST
Net/netclass colors are shown on ratsnest lines only.
@ ALL
Net/netclass colors are shown on all net copper.
@ OFF
Net (and netclass) colors are not shown.
@ VISIBLE
Ratsnest lines are drawn to items on visible layers only.
@ ALL
Ratsnest lines are drawn to items on all layers (default)
static TOOL_ACTION highContrastModeCycle
Class APPEARANCE_CONTROLS_BASE.
wxPanel * m_panelNetsAndClasses
wxBoxSizer * m_sizerOuter
wxBoxSizer * m_netsTabOuterSizer
wxStaticText * m_staticTextNetClasses
wxChoice * m_cbLayerPresets
wxBoxSizer * m_netclassOuterSizer
wxScrolledCanvas * m_windowLayers
wxStaticText * m_viewportsLabel
BITMAP_BUTTON * m_btnConfigureNetClasses
wxBoxSizer * m_panelLayersSizer
wxTextCtrl * m_txtNetFilter
BITMAP_BUTTON * m_btnNetInspector
wxScrolledCanvas * m_windowObjects
wxScrolledWindow * m_netclassScrolledWindow
wxStaticText * m_staticTextNets
wxStaticText * m_presetsLabel
void OnBoardNetSettingsChanged(BOARD &aBoard) override
void doApplyLayerPreset(const LAYER_PRESET &aPreset)
std::map< PCB_LAYER_ID, APPEARANCE_SETTING * > m_layerSettingsMap
wxArrayString m_presetMRU
wxStaticText * m_inactiveLayersLabel
void syncColorsAndVisibility()
std::map< GAL_LAYER_ID, APPEARANCE_SETTING * > m_objectSettingsMap
void ApplyLayerPreset(const wxString &aPresetName)
wxRadioButton * m_rbHighContrastNormal
void onObjectVisibilityChanged(GAL_LAYER_ID aLayer, bool isVisible, bool isFinal)
static LAYER_PRESET presetFrontAssembly
void OnBoardItemAdded(BOARD &aBoard, BOARD_ITEM *aItem) override
void syncLayerPresetSelection()
static LAYER_PRESET presetBackAssembly
void OnNetGridClick(wxGridEvent &event) override
void setVisibleObjects(GAL_SET aObjects)
wxRadioButton * m_rbRatsnestNone
WX_COLLAPSIBLE_PANE * m_paneLayerDisplayOptions
void buildNetClassMenu(wxMenu &aMenu, bool isDefaultClass, const wxString &aName)
void onLayerVisibilityToggled(PCB_LAYER_ID aLayer)
void onLayerPresetChanged(wxCommandEvent &aEvent) override
void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aItem) override
wxMenu * m_layerContextMenu
wxRadioButton * m_rbRatsnestVisLayers
@ ID_PRESET_FRONT_ASSEMBLY
@ ID_SHOW_ALL_COPPER_LAYERS
@ ID_HIDE_ALL_COPPER_LAYERS
@ ID_PRESET_BACK_ASSEMBLY
wxRadioButton * m_rbNetColorAll
bool doesBoardItemNeedRebuild(BOARD_ITEM *aBoardItem)
wxCheckBox * m_cbFlipBoard
void SetUserLayerPresets(std::vector< LAYER_PRESET > &aPresetList)
std::vector< LAYER_PRESET > GetUserLayerPresets() const
Update the current layer presets from those saved in the project file.
static LAYER_PRESET presetInnerCopper
void updateViewportSelection(const wxString &aName)
std::map< wxString, VIEWPORT > m_viewports
void onViewportChanged(wxCommandEvent &aEvent) override
NET_GRID_TABLE * m_netsTable
std::vector< std::unique_ptr< APPEARANCE_SETTING > > m_layerSettings
void loadDefaultLayerPresets()
std::vector< std::unique_ptr< APPEARANCE_SETTING > > m_objectSettings
void onObjectOpacitySlider(int aLayer, float aOpacity)
void rebuildViewportsWidget()
wxRadioButton * m_rbRatsnestAllLayers
wxBoxSizer * m_objectsOuterSizer
wxSize GetBestSize() const
void setVisibleLayers(LSET aLayers)
LAYER_PRESET * m_lastSelectedUserPreset
wxString m_contextMenuNetclass
The name of the netclass that was right-clicked.
wxRadioButton * m_rbNetColorRatsnest
void onRatsnestMode(wxCommandEvent &aEvent)
wxRadioButton * m_rbNetColorOff
static LAYER_PRESET presetFront
void doApplyViewport(const VIEWPORT &aViewport)
static const APPEARANCE_SETTING s_objectSettings[]
Template for object appearance settings.
void OnNetGridMouseEvent(wxMouseEvent &aEvent)
WX_COLLAPSIBLE_PANE * m_paneNetDisplayOptions
void OnNotebookPageChanged(wxNotebookEvent &event) override
int GetTabIndex() const
Set the current notebook tab.
void onNetclassVisibilityChanged(wxCommandEvent &aEvent)
void OnBoardItemsRemoved(BOARD &aBoard, std::vector< BOARD_ITEM * > &aItems) override
void onNetContextMenu(wxCommandEvent &aEvent)
void OnColorSwatchChanged(wxCommandEvent &aEvent)
void updateLayerPresetSelection(const wxString &aName)
ROW_ICON_PROVIDER * m_iconProvider
std::map< wxString, LAYER_PRESET > m_layerPresets
static LAYER_PRESET presetBack
void rebuildLayerContextMenu()
void RefreshCollapsiblePanes()
Function to force a redraw of the collapsible panes in this control.
static LAYER_PRESET presetNoLayers
void idleFocusHandler(wxIdleEvent &aEvent)
void rightClickHandler(wxMouseEvent &aEvent)
void OnNetGridRightClick(wxGridEvent &event) override
void OnBoardItemsChanged(BOARD &aBoard, std::vector< BOARD_ITEM * > &aItems) override
Update the colors on all the widgets from the new chosen color theme.
wxBoxSizer * m_layersOuterSizer
void UpdateDisplayOptions()
Return a list of the layer presets created by the user.
std::vector< std::unique_ptr< APPEARANCE_SETTING > > m_netclassSettings
wxRadioButton * m_rbHighContrastOff
void OnBoardItemsAdded(BOARD &aBoard, std::vector< BOARD_ITEM * > &aItems) override
void OnColorThemeChanged()
Respond to change in OS's DarkMode.
LAYER_PRESET * m_currentPreset
std::map< wxString, APPEARANCE_SETTING * > m_netclassSettingsMap
GAL_SET getVisibleObjects()
void OnSetFocus(wxFocusEvent &aEvent) override
static LAYER_PRESET presetAllCopper
void SetUserViewports(std::vector< VIEWPORT > &aPresetList)
void handleBoardItemsChanged()
wxRadioButton * m_rbHighContrastDim
void OnSize(wxSizeEvent &aEvent) override
wxString netclassNameFromEvent(wxEvent &aEvent)
wxGridCellCoords m_hoveredCell
Grid cell that is being hovered over, for tooltips.
void showNetclass(const wxString &aClassName, bool aShow=true)
wxStaticText * m_txtRatsnestVisibility
void rebuildLayerPresetsWidget()
void onLayerLeftClick(wxMouseEvent &aEvent)
std::vector< VIEWPORT > GetUserViewports() const
Update the current viewports from those saved in the project file.
VIEWPORT * m_lastSelectedViewport
wxArrayString m_viewportMRU
void SetTabIndex(int aTab)
wxColour m_layerPanelColour
void OnLanguageChanged()
Update the panel contents from the application and board models.
std::map< int, wxString > m_netclassIdMap
Stores wxIDs for each netclass for control event mapping.
void OnLayerContextMenu(wxCommandEvent &aEvent)
Return the index of the current tab (0-2).
void onNetColorMode(wxCommandEvent &aEvent)
void OnNetVisibilityChanged(int aNetCode, bool aVisibility)
Notifies the panel when a net has been hidden or shown via the external tool.
void OnDarkModeToggle()
Update the widget when the active board layer is changed.
static LAYER_PRESET presetAllLayers
void onNetclassContextMenu(wxCommandEvent &aEvent)
wxStaticText * m_txtNetDisplayTitle
wxStaticLine * m_layerDisplaySeparator
void syncObjectSettings()
APPEARANCE_CONTROLS(PCB_BASE_FRAME *aParent, wxWindow *aFocusOwner, bool aFpEditor=false)
void SetObjectVisible(GAL_LAYER_ID aLayer, bool isVisible=true)
void OnNetGridDoubleClick(wxGridEvent &event) override
void SetLayerVisible(int aLayer, bool isVisible)
void OnBoardItemChanged(BOARD &aBoard, BOARD_ITEM *aItem) override
void onNetclassColorChanged(wxCommandEvent &aEvent)
void ApplyViewport(const wxString &aPresetName)
GRID_BITMAP_TOGGLE_RENDERER * m_toggleGridRenderer
A checkbox control except with custom bitmaps for the checked and unchecked states.
void SetValue(bool aValue)
Read the checkbox state.
std::shared_ptr< NET_SETTINGS > m_NetSettings
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
Information pertinent to a Pcbnew printed circuit board.
const NETINFO_LIST & GetNetInfo() const
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
LSET GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings.
void AddListener(BOARD_LISTENER *aListener)
Add a listener to the board to receive calls whenever something on the board has been modified.
GAL_SET GetVisibleElements() const
Return a set of all the element categories that are visible.
void SetHighLightNet(int aNetCode, bool aMulti=false)
Select the netcode to be highlighted.
int GetCopperLayerCount() const
void SetVisibleLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings changes the bit-mask of vis...
void SetElementVisibility(GAL_LAYER_ID aLayer, bool aNewState)
Change the visibility of an element category.
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
PROJECT * GetProject() const
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
void HighLightON(bool aValue=true)
Enable or disable net highlighting.
void SetVisibleElements(const GAL_SET &aMask)
A proxy function that calls the correspondent function in m_BoardSettings.
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)
COLOR4D GetColor(int aLayer) const
COLOR4D GetDefaultColor(int aLayer)
A simple color swatch of the kind used to set layer colors.
void GetNewSwatchColor()
Prompt for a new colour, using the colour picker dialog.
KIGFX::COLOR4D GetSwatchColor() const
void SetReadOnlyCallback(std::function< void()> aCallback)
Registers a handler for when the user tries to interact with a read-only swatch.
void SetReadOnly(bool aReadOnly=true)
Class to handle configuration and automatic determination of the DPI scale to use for canvases.
double GetScaleFactor() const
Get the DPI scale from all known sources in order:
double GetContentScaleFactor() const
Get the content scale factor, which may be different from the scale factor on some platforms.
void OnPreferences(wxCommandEvent &event)
Displays the preferences and settings of all opened editors paged dialog.
bool IsType(FRAME_T aType) const
WX_INFOBAR * GetInfoBar()
virtual void SetGridVisibility(bool aVisible)
bool IsGridVisible() const
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
KICAD_T Type() const
Returns the type of object.
wxString GetTextSelection(int aColumn=0)
Return the selected text from aColumn in the wxListCtrl in the dialog.
void SetListLabel(const wxString &aLabel)
Helper for storing and iterating over GAL_LAYER_IDs.
bool Contains(GAL_LAYER_ID aPos)
static GAL_SET DefaultVisible()
A toggle button renderer for a wxGrid, similar to BITMAP_TOGGLE.
A text renderer that can unescape text for display This is useful where it's desired to keep the unde...
representing a row indicator icon for use in places like the layer widget
void SetIndicatorState(ICON_ID aIconId)
Set the row indicator to the given state.
A color representation with 4 components: red, green, blue, alpha.
bool SetFromWxString(const wxString &aColorString)
Set color values by parsing a string using wxColour::Set().
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
PCB specific render settings.
std::set< int > & GetHiddenNets()
std::map< int, KIGFX::COLOR4D > & GetNetColorMap()
std::map< wxString, KIGFX::COLOR4D > & GetNetclassColorMap()
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void SetHighlight(bool aEnabled, int aNetcode=-1, bool aMulti=false)
Turns on/off highlighting.
An abstract base class for deriving all objects that can be added to a VIEW.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
BOX2D GetViewport() const
Return the current viewport visible area rectangle.
void SetViewport(const BOX2D &aViewport)
Set the visible area of the VIEW.
void UpdateAllLayersColor()
Apply the new coloring scheme to all layers.
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
bool IsMirroredX() const
Return true if view is flipped across the X axis.
void UpdateLayerColor(int aLayer)
Apply the new coloring scheme held by RENDER_SETTINGS in case that it has changed.
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
static LSET AllLayersMask()
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
bool Contains(PCB_LAYER_ID aLayer)
See if the layer set contains a PCB layer.
LSEQ CuStack() const
Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
static LSET FrontAssembly()
Return a complete set of all top assembly layers which is all F_SilkS and F_Mask.
static LSET InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
static LSET ForbiddenFootprintLayers()
Layers which are not allowed within footprint definitions.
static LSET BackAssembly()
Return a complete set of all bottom assembly layers which is all B_SilkS and B_Mask.
static LSET FrontMask()
Return a mask holding all technical layers and the external CU layer on front side.
static LSET BackMask()
Return a mask holding all technical layers and the external CU layer on back side.
static const char Default[]
the name of the default NETCLASS
Handle the data for a net.
const NETNAMES_MAP & NetsByName() const
Return the name map, at least for python.
void SetValue(int aRow, int aCol, const wxString &aValue) override
void SetValueAsCustom(int aRow, int aCol, const wxString &aTypeName, void *aValue) override
std::vector< NET_GRID_ENTRY > m_nets
void updateNetColor(const NET_GRID_ENTRY &aNet)
NET_GRID_ENTRY & GetEntry(int aRow)
void SetValueAsBool(int aRow, int aCol, bool aValue) override
void * GetValueAsCustom(int aRow, int aCol, const wxString &aTypeName) override
NET_GRID_TABLE(PCB_BASE_FRAME *aFrame, wxColor aBackgroundColor)
void updateNetVisibility(const NET_GRID_ENTRY &aNet)
wxString GetValue(int aRow, int aCol) override
wxGridCellAttr * m_labelAttr
void HideOtherNets(const NET_GRID_ENTRY &aNet)
wxGridCellAttr * m_defaultAttr
bool GetValueAsBool(int aRow, int aCol) override
wxGridCellAttr * GetAttr(int aRow, int aCol, wxGridCellAttr::wxAttrKind) override
static void * ColorToVoid(COLOR4D &aColor)
int GetRowByNetcode(int aCode) const
wxString GetTypeName(int aRow, int aCol) override
static COLOR4D VoidToColor(void *aColor)
DISPLAY_OPTIONS m_Display
static TOOL_ACTION listNets
static TOOL_ACTION highlightNet
static TOOL_ACTION hideNetInRatsnest
static TOOL_ACTION showNetInRatsnest
static TOOL_ACTION ratsnestModeCycle
static TOOL_ACTION netColorModeCycle
static TOOL_ACTION selectNet
Select all connections belonging to a single net.
static TOOL_ACTION flipBoard
static TOOL_ACTION deselectNet
Remove all connections belonging to a single net from the active selection.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual void OnDisplayOptionsChanged()
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
PCBNEW_SETTINGS * GetPcbNewSettings() const
virtual PCB_LAYER_ID GetActiveLayer() const
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void SetDrawBgColor(const COLOR4D &aColor) override
void SetDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions, bool aRefresh=true)
Updates the current display options from the given options struct.
virtual void SetActiveLayer(PCB_LAYER_ID aLayer)
virtual COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
double m_TrackOpacity
Opacity override for all tracks.
double m_ZoneOpacity
Opacity override for filled zone areas.
double m_ImageOpacity
Opacity override for user images.
double m_PadOpacity
Opacity override for SMD pads and PTHs.
double m_ViaOpacity
Opacity override for all types of via.
HIGH_CONTRAST_MODE m_ContrastModeDisplay
How inactive layers are displayed.
NET_COLOR_MODE m_NetColorMode
How to use color overrides on specific nets and netclasses.
void UpdateColors()
Update the color settings in the painter and GAL.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
void RedrawRatsnest()
Return the bounding box of the view that should be used if model is not valid.
The main frame for Pcbnew.
void ReCreateLayerBox(bool aForceResizeToolbar=true)
Recreate the layer box by clearing the old list and building a new one from the new layer names and c...
The project local settings are things that are attached to a particular project, but also might be pa...
std::set< wxString > m_HiddenNetclasses
virtual PROJECT_LOCAL_SETTINGS & GetLocalSettings() const
Icon provider for the "standard" row indicators, for example in layer selection lists.
A better wxCollapsiblePane that.
void Collapse(bool aCollapse=true)
void SetLabel(const wxString &aLabel) override
bool SetBackgroundColour(const wxColour &aColor) override
void SetTable(wxGridTableBase *table, bool aTakeOwnership=false)
Hide wxGrid's SetTable() method with one which doesn't mess up the grid column widths when setting th...
void SetColLabelSize(int aHeight)
Hide wxGrid's SetColLabelSize() method with one which makes sure the size is tall enough for the syst...
A modified version of the wxInfoBar class that allows us to:
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION, MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the infobar with the provided message and icon for a specific period of time.
void AddButton(wxButton *aButton)
Add an already created button to the infobar.
void AddCloseButton(const wxString &aTooltip=_("Hide this message."))
Add the default close button to the infobar on the right side.
void SetBorders(bool aLeft, bool aRight, bool aTop, bool aBottom)
static const wxSize SWATCH_SIZE_SMALL_DU(8, 6)
#define VIEWPORT_SWITCH_KEY
#define PRESET_SWITCH_KEY
wxString KeyNameFromKeyCode(int aKeycode, bool *aIsFound)
Return the key name from the key code.
GAL_LAYER_ID ToGalLayer(int aInteger)
int GetNetnameLayer(int aLayer)
Returns a netname layer corresponding to the given layer.
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
@ LAYER_MOD_TEXT_INVISIBLE
text marked as invisible
@ LAYER_LOCKED_ITEM_SHADOW
shadow layer for locked items
@ LAYER_PAD_FR
smd pads, front layer
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
@ LAYER_DRAW_BITMAPS
to handle and draw images bitmaps
@ LAYER_DRC_EXCLUSION
layer for drc markers which have been individually excluded
@ LAYER_PCB_BACKGROUND
PCB background color.
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored)
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored)
@ LAYER_DRC_WARNING
layer for drc markers with SEVERITY_WARNING
@ LAYER_MOD_FR
show footprints on front
@ LAYER_ZONE_START
Virtual layers for stacking zones and tracks on a given copper layer.
@ LAYER_ANCHOR
anchor of items having an anchor point (texts, footprints)
@ LAYER_PAD_BK
smd pads, back layer
@ LAYER_MOD_VALUES
show footprints values (when texts are visible)
@ LAYER_PADS_TH
multilayer pads, usually with holes
@ LAYER_DRC_ERROR
layer for drc markers with SEVERITY_ERROR
@ LAYER_VIAS
Meta control for all vias opacity/visibility.
@ LAYER_MOD_BK
show footprints on back
@ LAYER_MOD_REFERENCES
show footprints references (when texts are visible)
PCB_LAYER_ID
A quick note on layer IDs:
#define ZONE_LAYER_FOR(boardLayer)
#define GAL_LAYER_INDEX(x)
Use this macro to convert a GAL layer to a 0-indexed offset from LAYER_VIAS.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
@ ALL
All except INITIAL_ADD.
@ TARGET_NONCACHED
Auxiliary rendering target (noncached)
wxFont GetInfoFont(wxWindow *aWindow)
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
static float distance(const SFVEC2UI &a, const SFVEC2UI &b)
std::vector< FAB_LAYER_COLOR > dummy
wxString UnescapeString(const wxString &aSource)
Container for an appearance setting (can control a single board layer, or GAL layer,...
BITMAP_TOGGLE * ctl_visibility
INDICATOR_ICON * ctl_indicator
A saved set of layers that are visible.
GAL_SET renderLayers
Render layers (e.g. object types) that are visible.
wxString name
A name for this layer set.
LSET layers
Board layers that are visible.
bool readOnly
True if this is a read-only (built-in) preset.
PCB_LAYER_ID activeLayer
Optional layer to set active when this preset is loaded.
bool appearance_expand_layer_display
bool appearance_expand_net_display
RATSNEST_MODE m_RatsnestMode
bool m_ShowGlobalRatsnest
@ PCB_NETINFO_T
class NETINFO_ITEM, a description of a net