From 800d8acb000a86efd73bb67b33bc9585bfb5e1c5 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 4 Sep 2020 17:44:05 +0100 Subject: [PATCH] Reinstate collapsable controls in Appearances widget. Also tries to fix highlighting on BOTH OSX and GTK (previuos efforts have all worked only on one or the other). --- pcbnew/widgets/appearance_controls.cpp | 48 +- pcbnew/widgets/appearance_controls.h | 6 +- pcbnew/widgets/appearance_controls_base.cpp | 73 +- pcbnew/widgets/appearance_controls_base.fbp | 1460 ++++++++++--------- pcbnew/widgets/appearance_controls_base.h | 5 + 5 files changed, 880 insertions(+), 712 deletions(-) diff --git a/pcbnew/widgets/appearance_controls.cpp b/pcbnew/widgets/appearance_controls.cpp index 397b1063bd..d7caea15c0 100644 --- a/pcbnew/widgets/appearance_controls.cpp +++ b/pcbnew/widgets/appearance_controls.cpp @@ -470,8 +470,6 @@ APPEARANCE_CONTROLS::APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFo m_netsGrid->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_DEFAULT ); m_netclassScrolledWindow->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_DEFAULT ); - m_currentLayer = F_Cu; - loadDefaultLayerPresets(); rebuildObjects(); OnBoardChanged(); @@ -500,6 +498,26 @@ wxSize APPEARANCE_CONTROLS::GetBestSize() const } +void APPEARANCE_CONTROLS::OnLayerDisplayPaneChanged( wxCollapsiblePaneEvent& event ) +{ + // Because wxWidgets is broken and will not properly lay these out automatically + Freeze(); + m_panelLayers->Fit(); + m_sizerOuter->Layout(); + Thaw(); +} + + +void APPEARANCE_CONTROLS::OnNetDisplayPaneChanged( wxCollapsiblePaneEvent& event ) +{ + // Because wxWidgets is broken and will not properly lay these out automatically + Freeze(); + m_panelNetsAndClasses->Fit(); + m_sizerOuter->Layout(); + Thaw(); +} + + void APPEARANCE_CONTROLS::OnNotebookPageChanged( wxNotebookEvent& aEvent ) { // Work around wxMac issue where the notebook pages are blank @@ -759,18 +777,32 @@ void APPEARANCE_CONTROLS::OnLayerChanged() pair.second->ctl_indicator->SetIndicatorState( ROW_ICON_PROVIDER::STATE::OFF ); } - wxColour highlightColor = m_layerPanelColour.ChangeLightness( 160 ); + wxChar r, g, b; + + r = m_layerPanelColour.Red(); + g = m_layerPanelColour.Green(); + b = m_layerPanelColour.Blue(); + + if( r < 240 || g < 240 || b < 240 ) + { + r = std::min( r + 15, 255 ); + g = std::min( g + 15, 255 ); + b = std::min( b + 15, 255 ); + } + else + { + r = std::max( r - 15, 0 ); + g = std::max( g - 15, 0 ); + b = std::max( b - 15, 0 ); + } + PCB_LAYER_ID current = m_frame->GetActiveLayer(); APPEARANCE_SETTING* newSetting = m_layerSettingsMap[ current ]; - newSetting->ctl_panel->SetBackgroundColour( highlightColor ); + newSetting->ctl_panel->SetBackgroundColour( wxColour( r, g, b ) ); newSetting->ctl_indicator->SetIndicatorState( ROW_ICON_PROVIDER::STATE::ON ); - m_currentLayer = current; - -#if defined( __WXMAC__ ) || defined( __WXMSW__ ) Refresh(); -#endif } diff --git a/pcbnew/widgets/appearance_controls.h b/pcbnew/widgets/appearance_controls.h index c4f3ebf6c1..9765a2f072 100644 --- a/pcbnew/widgets/appearance_controls.h +++ b/pcbnew/widgets/appearance_controls.h @@ -248,6 +248,10 @@ public: protected: + void OnLayerDisplayPaneChanged( wxCollapsiblePaneEvent& event ) override; + + void OnNetDisplayPaneChanged( wxCollapsiblePaneEvent& event ) override; + void OnNotebookPageChanged( wxNotebookEvent& event ) override; void OnSetFocus( wxFocusEvent& aEvent ) override; @@ -281,8 +285,6 @@ private: /// Grid cell that is being hovered over, for tooltips wxGridCellCoords m_hoveredCell; - PCB_LAYER_ID m_currentLayer; - std::vector> m_layerSettings; std::map m_layerSettingsMap; diff --git a/pcbnew/widgets/appearance_controls_base.cpp b/pcbnew/widgets/appearance_controls_base.cpp index 306630763c..0d940f4677 100644 --- a/pcbnew/widgets/appearance_controls_base.cpp +++ b/pcbnew/widgets/appearance_controls_base.cpp @@ -23,46 +23,49 @@ APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID m_windowLayers = new wxScrolledCanvas( m_panelLayers, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL ); m_panelLayersSizer->Add( m_windowLayers, 1, wxEXPAND, 5 ); + m_paneLayerDisplay = new wxCollapsiblePane( m_panelLayers, wxID_ANY, wxT("Layer Display Options"), wxDefaultPosition, wxDefaultSize, wxCP_DEFAULT_STYLE|wxCP_NO_TLW_RESIZE ); + m_paneLayerDisplay->Collapse( true ); + wxBoxSizer* bSizer121; bSizer121 = new wxBoxSizer( wxVERTICAL ); - m_staticText13 = new wxStaticText( m_panelLayers, wxID_ANY, wxT("Non-active layers:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText13 = new wxStaticText( m_paneLayerDisplay->GetPane(), wxID_ANY, wxT("Non-active layers:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText13->Wrap( -1 ); bSizer121->Add( m_staticText13, 0, wxEXPAND|wxBOTTOM, 2 ); wxBoxSizer* bSizer19; bSizer19 = new wxBoxSizer( wxHORIZONTAL ); - m_rbHighContrastNormal = new wxRadioButton( m_panelLayers, wxID_ANY, wxT("Normal"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + m_rbHighContrastNormal = new wxRadioButton( m_paneLayerDisplay->GetPane(), wxID_ANY, wxT("Normal"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_rbHighContrastNormal->SetValue( true ); m_rbHighContrastNormal->SetToolTip( wxT("Non-active layers will be shown in full color") ); - bSizer19->Add( m_rbHighContrastNormal, 0, wxRIGHT, 8 ); + bSizer19->Add( m_rbHighContrastNormal, 0, wxRIGHT, 4 ); - m_rbHighContrastDim = new wxRadioButton( m_panelLayers, wxID_ANY, wxT("Dim"), wxDefaultPosition, wxDefaultSize, 0 ); + m_rbHighContrastDim = new wxRadioButton( m_paneLayerDisplay->GetPane(), wxID_ANY, wxT("Dim"), wxDefaultPosition, wxDefaultSize, 0 ); m_rbHighContrastDim->SetToolTip( wxT("Non-active layers will be dimmed") ); - bSizer19->Add( m_rbHighContrastDim, 0, wxRIGHT, 14 ); + bSizer19->Add( m_rbHighContrastDim, 0, wxRIGHT|wxLEFT, 10 ); - m_rbHighContrastOff = new wxRadioButton( m_panelLayers, wxID_ANY, wxT("Hide"), wxDefaultPosition, wxDefaultSize, 0 ); + m_rbHighContrastOff = new wxRadioButton( m_paneLayerDisplay->GetPane(), wxID_ANY, wxT("Hide"), wxDefaultPosition, wxDefaultSize, 0 ); m_rbHighContrastOff->SetToolTip( wxT("Non-active layers will be hidden") ); - bSizer19->Add( m_rbHighContrastOff, 0, wxRIGHT, 5 ); + bSizer19->Add( m_rbHighContrastOff, 0, 0, 5 ); bSizer121->Add( bSizer19, 0, wxEXPAND, 5 ); - m_staticline5 = new wxStaticLine( m_panelLayers, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer121->Add( m_staticline5, 0, wxEXPAND|wxTOP, 5 ); + m_staticline5 = new wxStaticLine( m_paneLayerDisplay->GetPane(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer121->Add( m_staticline5, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + m_cbFlipBoard = new wxCheckBox( m_paneLayerDisplay->GetPane(), wxID_ANY, wxT("Flip board view"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer121->Add( m_cbFlipBoard, 0, 0, 5 ); - bSizer121->Add( 0, 3, 1, wxEXPAND, 5 ); - - m_cbFlipBoard = new wxCheckBox( m_panelLayers, wxID_ANY, wxT("Flip board view"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer121->Add( m_cbFlipBoard, 0, wxRIGHT, 5 ); - - - m_panelLayersSizer->Add( bSizer121, 0, wxEXPAND|wxTOP, 5 ); + m_paneLayerDisplay->GetPane()->SetSizer( bSizer121 ); + m_paneLayerDisplay->GetPane()->Layout(); + bSizer121->Fit( m_paneLayerDisplay->GetPane() ); + m_panelLayersSizer->Add( m_paneLayerDisplay, 0, wxBOTTOM|wxTOP|wxEXPAND, 5 ); m_panelLayers->SetSizer( m_panelLayersSizer ); @@ -186,39 +189,45 @@ APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID m_netsTabSplitter->SplitHorizontally( m_panelNets, m_panelNetclasses, 300 ); bSizer16->Add( m_netsTabSplitter, 1, wxEXPAND, 5 ); + m_paneNetDisplay = new wxCollapsiblePane( m_panelNetsAndClasses, wxID_ANY, wxT("Net Display Options"), wxDefaultPosition, wxDefaultSize, wxCP_DEFAULT_STYLE|wxCP_NO_TLW_RESIZE ); + m_paneNetDisplay->Collapse( true ); + wxBoxSizer* bSizerNetDisplay; bSizerNetDisplay = new wxBoxSizer( wxVERTICAL ); - m_staticTextNetDsplayTitle = new wxStaticText( m_panelNetsAndClasses, wxID_ANY, wxT("Apply net and netclass colors to:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextNetDsplayTitle = new wxStaticText( m_paneNetDisplay->GetPane(), wxID_ANY, wxT("Net colors:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextNetDsplayTitle->Wrap( -1 ); m_staticTextNetDsplayTitle->SetToolTip( wxT("Choose when to show net and netclass colors") ); - bSizerNetDisplay->Add( m_staticTextNetDsplayTitle, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 2 ); + bSizerNetDisplay->Add( m_staticTextNetDsplayTitle, 0, wxEXPAND|wxBOTTOM, 2 ); wxBoxSizer* bSizer191; bSizer191 = new wxBoxSizer( wxHORIZONTAL ); - m_rbNetColorAll = new wxRadioButton( m_panelNetsAndClasses, wxID_ANY, wxT("All"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + m_rbNetColorAll = new wxRadioButton( m_paneNetDisplay->GetPane(), wxID_ANY, wxT("All"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_rbNetColorAll->SetToolTip( wxT("Net and netclass colors are shown on all copper items") ); - bSizer191->Add( m_rbNetColorAll, 0, wxRIGHT, 16 ); + bSizer191->Add( m_rbNetColorAll, 0, wxRIGHT, 10 ); - m_rbNetColorRatsnest = new wxRadioButton( m_panelNetsAndClasses, wxID_ANY, wxT("Ratsnest"), wxDefaultPosition, wxDefaultSize, 0 ); + m_rbNetColorRatsnest = new wxRadioButton( m_paneNetDisplay->GetPane(), wxID_ANY, wxT("Ratsnest"), wxDefaultPosition, wxDefaultSize, 0 ); m_rbNetColorRatsnest->SetValue( true ); m_rbNetColorRatsnest->SetToolTip( wxT("Net and netclass colors are shown on the ratsnest only") ); - bSizer191->Add( m_rbNetColorRatsnest, 0, wxRIGHT, 8 ); + bSizer191->Add( m_rbNetColorRatsnest, 0, wxRIGHT, 4 ); - m_rbNetColorOff = new wxRadioButton( m_panelNetsAndClasses, wxID_ANY, wxT("None"), wxDefaultPosition, wxDefaultSize, 0 ); + m_rbNetColorOff = new wxRadioButton( m_paneNetDisplay->GetPane(), wxID_ANY, wxT("None"), wxDefaultPosition, wxDefaultSize, 0 ); m_rbNetColorOff->SetToolTip( wxT("Net and netclass colors are not shown") ); bSizer191->Add( m_rbNetColorOff, 0, 0, 5 ); - bSizerNetDisplay->Add( bSizer191, 0, wxEXPAND, 5 ); + bSizerNetDisplay->Add( bSizer191, 0, wxEXPAND|wxBOTTOM, 5 ); - bSizer16->Add( bSizerNetDisplay, 0, wxEXPAND|wxTOP, 5 ); + m_paneNetDisplay->GetPane()->SetSizer( bSizerNetDisplay ); + m_paneNetDisplay->GetPane()->Layout(); + bSizerNetDisplay->Fit( m_paneNetDisplay->GetPane() ); + bSizer16->Add( m_paneNetDisplay, 0, wxEXPAND|wxTOP, 5 ); m_panelNetsAndClasses->SetSizer( bSizer16 ); @@ -239,14 +248,14 @@ APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID presetsLabel = new wxStaticText( this, wxID_ANY, wxT("Presets:"), wxDefaultPosition, wxDefaultSize, 0 ); presetsLabel->Wrap( -1 ); - bPresetsLabels->Add( presetsLabel, 1, wxTOP|wxRIGHT|wxLEFT, 2 ); + bPresetsLabels->Add( presetsLabel, 1, wxRIGHT|wxLEFT, 2 ); presetsHotkey = new wxStaticText( this, wxID_ANY, wxT("(Ctrl+Tab)"), wxDefaultPosition, wxDefaultSize, 0 ); presetsHotkey->Wrap( -1 ); - bPresetsLabels->Add( presetsHotkey, 0, wxTOP|wxRIGHT|wxLEFT, 2 ); + bPresetsLabels->Add( presetsHotkey, 0, wxRIGHT|wxLEFT, 2 ); - bPresets->Add( bPresetsLabels, 1, wxEXPAND|wxTOP, 3 ); + bPresets->Add( bPresetsLabels, 1, wxEXPAND|wxTOP, 7 ); wxString m_cbLayerPresetsChoices[] = { wxT("All Layers"), wxT("(unsaved)") }; int m_cbLayerPresetsNChoices = sizeof( m_cbLayerPresetsChoices ) / sizeof( wxString ); @@ -273,6 +282,8 @@ APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID m_notebook->Connect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( APPEARANCE_CONTROLS_BASE::OnNotebookPageChanged ), NULL, this ); m_notebook->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); m_panelLayers->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); + m_paneLayerDisplay->Connect( wxEVT_COLLAPSIBLEPANE_CHANGED, wxCollapsiblePaneEventHandler( APPEARANCE_CONTROLS_BASE::OnLayerDisplayPaneChanged ), NULL, this ); + m_paneLayerDisplay->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); m_cbFlipBoard->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( APPEARANCE_CONTROLS_BASE::OnFlipBoardChecked ), NULL, this ); m_panelObjects->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); m_panelNetsAndClasses->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); @@ -282,6 +293,8 @@ APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID m_netsGrid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( APPEARANCE_CONTROLS_BASE::OnNetGridRightClick ), NULL, this ); m_netsGrid->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); m_panelNetclasses->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); + m_paneNetDisplay->Connect( wxEVT_COLLAPSIBLEPANE_CHANGED, wxCollapsiblePaneEventHandler( APPEARANCE_CONTROLS_BASE::OnNetDisplayPaneChanged ), NULL, this ); + m_paneNetDisplay->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); m_cbLayerPresets->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( APPEARANCE_CONTROLS_BASE::onLayerPresetChanged ), NULL, this ); } @@ -293,6 +306,8 @@ APPEARANCE_CONTROLS_BASE::~APPEARANCE_CONTROLS_BASE() m_notebook->Disconnect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( APPEARANCE_CONTROLS_BASE::OnNotebookPageChanged ), NULL, this ); m_notebook->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); m_panelLayers->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); + m_paneLayerDisplay->Disconnect( wxEVT_COLLAPSIBLEPANE_CHANGED, wxCollapsiblePaneEventHandler( APPEARANCE_CONTROLS_BASE::OnLayerDisplayPaneChanged ), NULL, this ); + m_paneLayerDisplay->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); m_cbFlipBoard->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( APPEARANCE_CONTROLS_BASE::OnFlipBoardChecked ), NULL, this ); m_panelObjects->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); m_panelNetsAndClasses->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); @@ -302,6 +317,8 @@ APPEARANCE_CONTROLS_BASE::~APPEARANCE_CONTROLS_BASE() m_netsGrid->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( APPEARANCE_CONTROLS_BASE::OnNetGridRightClick ), NULL, this ); m_netsGrid->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); m_panelNetclasses->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); + m_paneNetDisplay->Disconnect( wxEVT_COLLAPSIBLEPANE_CHANGED, wxCollapsiblePaneEventHandler( APPEARANCE_CONTROLS_BASE::OnNetDisplayPaneChanged ), NULL, this ); + m_paneNetDisplay->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( APPEARANCE_CONTROLS_BASE::OnSetFocus ), NULL, this ); m_cbLayerPresets->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( APPEARANCE_CONTROLS_BASE::onLayerPresetChanged ), NULL, this ); } diff --git a/pcbnew/widgets/appearance_controls_base.fbp b/pcbnew/widgets/appearance_controls_base.fbp index 13a93bc5aa..e27e98639b 100644 --- a/pcbnew/widgets/appearance_controls_base.fbp +++ b/pcbnew/widgets/appearance_controls_base.fbp @@ -240,408 +240,459 @@ 5 - wxEXPAND|wxTOP + wxBOTTOM|wxTOP|wxEXPAND 0 - + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Layer Display Options + + 0 + + + 0 - bSizer121 - wxVERTICAL - none - - 2 - wxEXPAND|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Non-active layers: - 0 - - 0 - - - 0 - - 1 - m_staticText13 - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 + 1 + m_paneLayerDisplay + 1 + + + protected + 1 + + Resizable + 1 + + wxCP_DEFAULT_STYLE|wxCP_NO_TLW_RESIZE + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnLayerDisplayPaneChanged + OnSetFocus + + + bSizer121 + wxVERTICAL + none + + 2 + wxEXPAND|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Non-active layers: + 0 + + 0 + + + 0 + + 1 + m_staticText13 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + - - - 5 - wxEXPAND - 0 - - - bSizer19 - wxHORIZONTAL - none - - 8 - wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Normal - - 0 - - - 0 - - 1 - m_rbHighContrastNormal - 1 - - - protected - 1 - - Resizable - 1 - - wxRB_GROUP - ; ; forward_declare - 0 - Non-active layers will be shown in full color - - wxFILTER_NONE - wxDefaultValidator - - 1 - - - + + 5 + wxEXPAND + 0 + + + bSizer19 + wxHORIZONTAL + none + + 4 + wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Normal + + 0 + + + 0 + + 1 + m_rbHighContrastNormal + 1 + + + protected + 1 + + Resizable + 1 + + wxRB_GROUP + ; ; forward_declare + 0 + Non-active layers will be shown in full color + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + - - - 14 - wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Dim - - 0 - - - 0 - - 1 - m_rbHighContrastDim - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Non-active layers will be dimmed - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - + + 10 + wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Dim + + 0 + + + 0 + + 1 + m_rbHighContrastDim + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Non-active layers will be dimmed + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + - - - 5 - wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Hide - - 0 - - - 0 - - 1 - m_rbHighContrastOff - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Non-active layers will be hidden - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Hide + + 0 + + + 0 + + 1 + m_rbHighContrastOff + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Non-active layers will be hidden + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + - - - 5 - wxEXPAND|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline5 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline5 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + - - - 5 - wxEXPAND - 1 - - 3 - protected - 0 - - - - 5 - wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Flip board view - - 0 - - - 0 - - 1 - m_cbFlipBoard - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnFlipBoardChecked + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Flip board view + + 0 + + + 0 + + 1 + m_cbFlipBoard + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnFlipBoardChecked + @@ -779,7 +830,7 @@ Nets 0 - + 1 1 1 @@ -831,16 +882,16 @@ wxTAB_TRAVERSAL OnSetFocus - + bSizer16 wxVERTICAL none - + 5 wxEXPAND 1 - + 1 1 1 @@ -897,8 +948,8 @@ - - + + 1 1 1 @@ -950,16 +1001,16 @@ wxTAB_TRAVERSAL OnSetFocus - + bSizer192 wxVERTICAL none - + 5 wxEXPAND 0 - + bSizer17 wxHORIZONTAL @@ -1163,11 +1214,11 @@ - + 5 wxALL|wxEXPAND 1 - + 1 1 1 @@ -1258,8 +1309,8 @@ - - + + 1 1 1 @@ -1311,16 +1362,16 @@ wxTAB_TRAVERSAL OnSetFocus - + bSizerNetClasses wxVERTICAL none - + 5 wxEXPAND 0 - + bSizer20 wxHORIZONTAL @@ -1530,275 +1581,336 @@ - + 5 wxEXPAND|wxTOP 0 - + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Net Display Options + + 0 + + + 0 - bSizerNetDisplay - wxVERTICAL - none - - 2 - wxEXPAND|wxBOTTOM|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Apply net and netclass colors to: - 0 - - 0 - - - 0 - - 1 - m_staticTextNetDsplayTitle - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Choose when to show net and netclass colors - - - - -1 + 1 + m_paneNetDisplay + 1 + + + protected + 1 + + Resizable + 1 + + wxCP_DEFAULT_STYLE|wxCP_NO_TLW_RESIZE + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnNetDisplayPaneChanged + OnSetFocus + + + bSizerNetDisplay + wxVERTICAL + none + + 2 + wxEXPAND|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Net colors: + 0 + + 0 + + + 0 + + 1 + m_staticTextNetDsplayTitle + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Choose when to show net and netclass colors + + + + -1 + - - - 5 - wxEXPAND - 0 - - - bSizer191 - wxHORIZONTAL - none - - 16 - wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - All - - 0 - - - 0 - - 1 - m_rbNetColorAll - 1 - - - protected - 1 - - Resizable - 1 - - wxRB_GROUP - ; ; forward_declare - 0 - Net and netclass colors are shown on all copper items - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - + + 5 + wxEXPAND|wxBOTTOM + 0 + + + bSizer191 + wxHORIZONTAL + none + + 10 + wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + All + + 0 + + + 0 + + 1 + m_rbNetColorAll + 1 + + + protected + 1 + + Resizable + 1 + + wxRB_GROUP + ; ; forward_declare + 0 + Net and netclass colors are shown on all copper items + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + - - - 8 - wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Ratsnest - - 0 - - - 0 - - 1 - m_rbNetColorRatsnest - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Net and netclass colors are shown on the ratsnest only - - wxFILTER_NONE - wxDefaultValidator - - 1 - - - + + 4 + wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Ratsnest + + 0 + + + 0 + + 1 + m_rbNetColorRatsnest + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Net and netclass colors are shown on the ratsnest only + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + - - - 5 - - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - None - - 0 - - - 0 - - 1 - m_rbNetColorOff - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Net and netclass colors are not shown - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + None + + 0 + + + 0 + + 1 + m_rbNetColorOff + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Net and netclass colors are not shown + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + @@ -1829,7 +1941,7 @@ wxVERTICAL none - 3 + 7 wxEXPAND|wxTOP 1 @@ -1839,7 +1951,7 @@ none 2 - wxTOP|wxRIGHT|wxLEFT + wxRIGHT|wxLEFT 1 1 @@ -1900,7 +2012,7 @@ 2 - wxTOP|wxRIGHT|wxLEFT + wxRIGHT|wxLEFT 0 1 diff --git a/pcbnew/widgets/appearance_controls_base.h b/pcbnew/widgets/appearance_controls_base.h index 5bbdfbd9d2..7271e328ed 100644 --- a/pcbnew/widgets/appearance_controls_base.h +++ b/pcbnew/widgets/appearance_controls_base.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +49,7 @@ class APPEARANCE_CONTROLS_BASE : public wxPanel wxPanel* m_panelLayers; wxBoxSizer* m_panelLayersSizer; wxScrolledCanvas* m_windowLayers; + wxCollapsiblePane* m_paneLayerDisplay; wxStaticText* m_staticText13; wxRadioButton* m_rbHighContrastNormal; wxRadioButton* m_rbHighContrastDim; @@ -69,6 +71,7 @@ class APPEARANCE_CONTROLS_BASE : public wxPanel wxBitmapButton* m_btnConfigureNetClasses; wxScrolledWindow* m_netclassScrolledWindow; wxBoxSizer* m_netclassOuterSizer; + wxCollapsiblePane* m_paneNetDisplay; wxStaticText* m_staticTextNetDsplayTitle; wxRadioButton* m_rbNetColorAll; wxRadioButton* m_rbNetColorRatsnest; @@ -81,10 +84,12 @@ class APPEARANCE_CONTROLS_BASE : public wxPanel virtual void OnSetFocus( wxFocusEvent& event ) { event.Skip(); } virtual void OnSize( wxSizeEvent& event ) { event.Skip(); } virtual void OnNotebookPageChanged( wxNotebookEvent& event ) { event.Skip(); } + virtual void OnLayerDisplayPaneChanged( wxCollapsiblePaneEvent& event ) { event.Skip(); } virtual void OnFlipBoardChecked( wxCommandEvent& event ) { event.Skip(); } virtual void OnNetGridClick( wxGridEvent& event ) { event.Skip(); } virtual void OnNetGridDoubleClick( wxGridEvent& event ) { event.Skip(); } virtual void OnNetGridRightClick( wxGridEvent& event ) { event.Skip(); } + virtual void OnNetDisplayPaneChanged( wxCollapsiblePaneEvent& event ) { event.Skip(); } virtual void onLayerPresetChanged( wxCommandEvent& event ) { event.Skip(); }