From 93bd2c73ff23580455f2b2a2d114ceccdfca8053 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 9 May 2024 12:08:12 +0200 Subject: [PATCH] Gerbview: rename diff mode by forced opacity display mode and make opacity adjustable. The diff mode (option in left toolbar) was never a differential display mode. It is actually an option to force the alpha channel (opacity) of layer colors to a given value. So change the name and tool tips to force opacity mode, and make the opacity parameter adjustable in preferences. Gerbview: cleanup: remove a old and dead code. --- .../panel_gerbview_display_options.cpp | 2 + .../panel_gerbview_display_options_base.cpp | 24 +- .../panel_gerbview_display_options_base.fbp | 1940 +++++++++-------- .../panel_gerbview_display_options_base.h | 8 +- gerbview/gbr_display_options.h | 6 +- gerbview/gerbview_frame.cpp | 6 +- gerbview/gerbview_frame.h | 8 - gerbview/gerbview_painter.cpp | 4 +- gerbview/gerbview_settings.cpp | 3 + gerbview/menubar.cpp | 2 +- gerbview/toolbars_gerber.cpp | 2 +- gerbview/tools/gerbview_actions.cpp | 8 +- gerbview/tools/gerbview_actions.h | 2 +- gerbview/tools/gerbview_control.cpp | 12 +- 14 files changed, 1102 insertions(+), 925 deletions(-) diff --git a/gerbview/dialogs/panel_gerbview_display_options.cpp b/gerbview/dialogs/panel_gerbview_display_options.cpp index 452dc64784..9c5af9bd68 100644 --- a/gerbview/dialogs/panel_gerbview_display_options.cpp +++ b/gerbview/dialogs/panel_gerbview_display_options.cpp @@ -59,6 +59,7 @@ void PANEL_GERBVIEW_DISPLAY_OPTIONS::loadSettings( GERBVIEW_SETTINGS* aCfg ) m_OptDisplayLines->SetValue( !aCfg->m_Display.m_DisplayLinesFill ); m_OptDisplayFlashedItems->SetValue( !aCfg->m_Display.m_DisplayFlashedItemsFill ); m_OptDisplayDCodes->SetValue( aCfg->m_Appearance.show_dcodes ); + m_spOpacityCtrl->SetValue( aCfg->m_Display.m_OpacityModeAlphaValue ); for( unsigned i = 0; i < arrayDim( gerberPageSizeList ); ++i ) { @@ -98,6 +99,7 @@ bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataFromWindow() cfg->m_Appearance.page_type = gerberPageSizeList[ m_PageSize->GetSelection() ]; cfg->m_Display.m_DisplayPageLimits = m_ShowPageLimitsOpt->GetValue(); + cfg->m_Display.m_OpacityModeAlphaValue = m_spOpacityCtrl->GetValue(); return true; } diff --git a/gerbview/dialogs/panel_gerbview_display_options_base.cpp b/gerbview/dialogs/panel_gerbview_display_options_base.cpp index 58ab9fab01..a44c1e1529 100644 --- a/gerbview/dialogs/panel_gerbview_display_options_base.cpp +++ b/gerbview/dialogs/panel_gerbview_display_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb) +// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf02) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -58,14 +58,35 @@ PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE( wxWind bDrawingModeSizer = new wxBoxSizer( wxVERTICAL ); m_OptDisplayFlashedItems = new wxCheckBox( this, wxID_ANY, _("Sketch flashed items"), wxDefaultPosition, wxDefaultSize, 0 ); + m_OptDisplayFlashedItems->SetToolTip( _("Display flashed items (items drawn using standard or macro apertures) in outlines mode") ); + bDrawingModeSizer->Add( m_OptDisplayFlashedItems, 0, wxALL, 5 ); m_OptDisplayLines = new wxCheckBox( this, wxID_ANY, _("Sketch lines"), wxDefaultPosition, wxDefaultSize, 0 ); bDrawingModeSizer->Add( m_OptDisplayLines, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_OptDisplayPolygons = new wxCheckBox( this, wxID_ANY, _("Sketch polygons"), wxDefaultPosition, wxDefaultSize, 0 ); + m_OptDisplayPolygons->SetValue(true); + m_OptDisplayPolygons->SetToolTip( _("Display polygon items in outline mode") ); + bDrawingModeSizer->Add( m_OptDisplayPolygons, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + wxStaticBoxSizer* sbSizerOpacity; + sbSizerOpacity = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Forced Opacity Display Mode") ), wxHORIZONTAL ); + + m_staticTextOpacity = new wxStaticText( sbSizerOpacity->GetStaticBox(), wxID_ANY, _("Forced opacity:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextOpacity->Wrap( -1 ); + m_staticTextOpacity->SetToolTip( _("Opacity in forced opacity display mode") ); + + sbSizerOpacity->Add( m_staticTextOpacity, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_spOpacityCtrl = new wxSpinCtrlDouble( sbSizerOpacity->GetStaticBox(), wxID_ANY, wxT("0.6"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0.2, 1, 0.600000, 0.1 ); + m_spOpacityCtrl->SetDigits( 2 ); + sbSizerOpacity->Add( m_spOpacityCtrl, 0, wxALL, 5 ); + + + bDrawingModeSizer->Add( sbSizerOpacity, 1, wxEXPAND|wxTOP, 5 ); + bRightSizer->Add( bDrawingModeSizer, 0, wxEXPAND|wxTOP|wxLEFT, 5 ); @@ -106,7 +127,6 @@ PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE( wxWind this->SetSizer( bDialogSizer ); this->Layout(); - bDialogSizer->Fit( this ); } PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE::~PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE() diff --git a/gerbview/dialogs/panel_gerbview_display_options_base.fbp b/gerbview/dialogs/panel_gerbview_display_options_base.fbp index 3b3da406f2..138c749fed 100644 --- a/gerbview/dialogs/panel_gerbview_display_options_base.fbp +++ b/gerbview/dialogs/panel_gerbview_display_options_base.fbp @@ -1,903 +1,1057 @@ - + - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - panel_gerbview_display_options_base - 1000 - none - - - 1 - PanelGerbviewDisplayOptions - - . - - 1 - 1 - 1 - 1 - UI - 0 - 0 - 0 - - 0 - wxAUI_MGR_DEFAULT - - - 1 - 1 - impl_virtual - - - 0 - wxID_ANY - + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + panel_gerbview_display_options_base + 1000 + none + + + 1 + PanelGerbviewDisplayOptions + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + 1 + 0 + 1 + impl_virtual + + + 0 + wxID_ANY + + + PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE + + 257,534 + RESETTABLE_PANEL; widgets/resettable_panel.h; Not forward_declare + + 0 + + + wxTAB_TRAVERSAL + + + bDialogSizer + wxVERTICAL + none + + 5 + wxEXPAND + 1 + - PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE - - -1,-1 - RESETTABLE_PANEL; widgets/resettable_panel.h; Not forward_declare - - 0 - - - wxTAB_TRAVERSAL - + m_UpperSizer + wxHORIZONTAL + protected + + 20 + wxEXPAND|wxRIGHT + 0 + - bDialogSizer + m_galOptionsSizer + wxVERTICAL + protected + + + + 5 + wxEXPAND|wxLEFT + 0 + + + bRightSizer wxVERTICAL none - - 5 - wxEXPAND - 1 - - - m_UpperSizer - wxHORIZONTAL - protected - - 20 - wxEXPAND|wxRIGHT - 0 - - - m_galOptionsSizer - wxVERTICAL - protected - - - - 5 - wxEXPAND|wxLEFT - 0 - - - bRightSizer - wxVERTICAL - none - - 13 - wxTOP|wxRIGHT|wxLEFT|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Annotations - 0 - - 0 - - - 0 - - 1 - m_staticText1 - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline1 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - - - - - 5 - wxEXPAND|wxTOP|wxLEFT - 0 - - - bAnnotationsSizer - wxVERTICAL - none - - 5 - wxTOP|wxBOTTOM|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show D codes - - 0 - - - 0 - - 1 - m_OptDisplayDCodes - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show page limits - - 0 - - - 0 - - 1 - m_ShowPageLimitsOpt - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - 5 - wxEXPAND - 0 - - 15 - protected - 0 - - - - 13 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Drawing Mode - 0 - - 0 - - - 0 - - 1 - m_staticText2 - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline2 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - - - - - 5 - wxEXPAND|wxTOP|wxLEFT - 0 - - - bDrawingModeSizer - wxVERTICAL - none - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Sketch flashed items - - 0 - - - 0 - - 1 - m_OptDisplayFlashedItems - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Sketch lines - - 0 - - - 0 - - 1 - m_OptDisplayLines - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Sketch polygons - - 0 - - - 0 - - 1 - m_OptDisplayPolygons - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - 5 - wxEXPAND - 0 - - 15 - protected - 0 - - - - 13 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Page Size - 0 - - 0 - - - 0 - - 1 - m_staticText3 - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline3 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - - - - - 5 - wxEXPAND|wxTOP|wxRIGHT - 0 - - - bPageSizeSizer - wxVERTICAL - none - - 10 - wxEXPAND|wxRIGHT - 0 - - - bMargins - wxVERTICAL - none - - 5 - wxEXPAND|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Full size" "Size A4" "Size A3" "Size A2" "Size A" "Size B" "Size C" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 1 - - 0 - - - 0 - - 1 - m_PageSize - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - + + 13 + wxTOP|wxRIGHT|wxLEFT|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Annotations + 0 + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + 5 + wxEXPAND|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 5 + wxEXPAND|wxTOP|wxLEFT + 0 + + + bAnnotationsSizer + wxVERTICAL + none + + 5 + wxTOP|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Show D codes + + 0 + + + 0 + + 1 + m_OptDisplayDCodes + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Show page limits + + 0 + + + 0 + + 1 + m_ShowPageLimitsOpt + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + 5 + wxEXPAND + 0 + + 15 + protected + 0 + + + + 13 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Drawing Mode + 0 + + 0 + + + 0 + + 1 + m_staticText2 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxEXPAND|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline2 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 5 + wxEXPAND|wxTOP|wxLEFT + 0 + + + bDrawingModeSizer + wxVERTICAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Sketch flashed items + + 0 + + + 0 + + 1 + m_OptDisplayFlashedItems + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + Display flashed items (items drawn using standard or macro apertures) in outlines mode + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Sketch lines + + 0 + + + 0 + + 1 + m_OptDisplayLines + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Sketch polygons + + 0 + + + 0 + + 1 + m_OptDisplayPolygons + 1 + + + protected + 1 + + Resizable + 1 + + + ; forward_declare + 0 + Display polygon items in outline mode + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND|wxTOP + 1 + + wxID_ANY + Forced Opacity Display Mode + + sbSizerOpacity + wxHORIZONTAL + 1 + none + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Forced opacity: + 0 + + 0 + + + 0 + + 1 + m_staticTextOpacity + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Opacity in forced opacity display mode + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 2 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + 0.1 + 0.600000 + 1 + + 0 + + 0.2 + + 0 + + 1 + m_spOpacityCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS + ; ; forward_declare + 0 + + 0.6 + + + + + + + + + + + 5 + wxEXPAND + 0 + + 15 + protected + 0 + + + + 13 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Page Size + 0 + + 0 + + + 0 + + 1 + m_staticText3 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxEXPAND|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline3 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT + 0 + + + bPageSizeSizer + wxVERTICAL + none + + 10 + wxEXPAND|wxRIGHT + 0 + + + bMargins + wxVERTICAL + none + + 5 + wxEXPAND|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Full size" "Size A4" "Size A3" "Size A2" "Size A" "Size B" "Size C" + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 1 + + 0 + + + 0 + + 1 + m_PageSize + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + diff --git a/gerbview/dialogs/panel_gerbview_display_options_base.h b/gerbview/dialogs/panel_gerbview_display_options_base.h index 0a60c55004..c2a3f40c0e 100644 --- a/gerbview/dialogs/panel_gerbview_display_options_base.h +++ b/gerbview/dialogs/panel_gerbview_display_options_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb) +// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf02) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include #include @@ -45,13 +47,15 @@ class PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE : public RESETTABLE_PANEL wxCheckBox* m_OptDisplayFlashedItems; wxCheckBox* m_OptDisplayLines; wxCheckBox* m_OptDisplayPolygons; + wxStaticText* m_staticTextOpacity; + wxSpinCtrlDouble* m_spOpacityCtrl; wxStaticText* m_staticText3; wxStaticLine* m_staticline3; wxRadioBox* m_PageSize; public: - PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 257,534 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE(); diff --git a/gerbview/gbr_display_options.h b/gerbview/gbr_display_options.h index 8cabe00a67..52b5440d16 100644 --- a/gerbview/gbr_display_options.h +++ b/gerbview/gbr_display_options.h @@ -40,13 +40,14 @@ public: bool m_DisplayPolygonsFill; ///< Option to draw polygons (filled/sketch) bool m_DisplayPageLimits; bool m_IsPrinting; ///< true when printing a page, false when drawing on screen - bool m_DiffMode; ///< Display layers in diff mode + bool m_ForceOpacityMode; ///< Display layers in transparency (alpha channel) forced mode bool m_XORMode; ///< Display layers in exclusive-or mode bool m_HighContrastMode; ///< High contrast mode (dim un-highlighted objects) bool m_FlipGerberView; ///< Display as a mirror image COLOR4D m_NegativeDrawColor; ///< The color used to draw negative objects, usually the ///< background color, but not always, when negative objects ///< must be visible + double m_OpacityModeAlphaValue; ///< the alpha channel (opacity) value in opacity forced mode public: GBR_DISPLAY_OPTIONS() @@ -57,7 +58,8 @@ public: m_DisplayPageLimits = false; m_IsPrinting = false; m_NegativeDrawColor = COLOR4D( DARKGRAY ); - m_DiffMode = false; + m_ForceOpacityMode = false; + m_OpacityModeAlphaValue = 0.6; m_XORMode = false; m_HighContrastMode = false; m_FlipGerberView = false; diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index cef9f759d2..1afdce6bc1 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -1146,10 +1146,10 @@ void GERBVIEW_FRAME::setupUIConditions() return gvconfig()->m_Appearance.show_dcodes; }; - auto diffModeCond = + auto forceOpacityModeCond = [this] ( const SELECTION& ) { - return gvconfig()->m_Display.m_DiffMode; + return gvconfig()->m_Display.m_ForceOpacityMode; }; auto xorModeCond = @@ -1181,7 +1181,7 @@ void GERBVIEW_FRAME::setupUIConditions() mgr->SetConditions( GERBVIEW_ACTIONS::polygonsDisplayOutlines, CHECK( polygonsFilledCond ) ); mgr->SetConditions( GERBVIEW_ACTIONS::negativeObjectDisplay, CHECK( negativeObjectsCond ) ); mgr->SetConditions( GERBVIEW_ACTIONS::dcodeDisplay, CHECK( dcodeCond ) ); - mgr->SetConditions( GERBVIEW_ACTIONS::toggleDiffMode, CHECK( diffModeCond ) ); + mgr->SetConditions( GERBVIEW_ACTIONS::toggleForceOpacityMode, CHECK( forceOpacityModeCond ) ); mgr->SetConditions( GERBVIEW_ACTIONS::toggleXORMode, CHECK( xorModeCond ) ); mgr->SetConditions( GERBVIEW_ACTIONS::flipGerberView, CHECK( flipGerberCond ) ); mgr->SetConditions( ACTIONS::highContrastMode, CHECK( highContrastModeCond ) ); diff --git a/gerbview/gerbview_frame.h b/gerbview/gerbview_frame.h index 522d4b3d57..8cdd152648 100644 --- a/gerbview/gerbview_frame.h +++ b/gerbview/gerbview_frame.h @@ -229,19 +229,11 @@ public: */ void OnSelectActiveLayer( wxCommandEvent& event ); - /** - * Called on a display mode selection. - * - * Mode selection can be fast display or exact mode with stacked images or with transparency. - */ - void OnSelectDisplayMode( wxCommandEvent& event ); - /** * Called on request of application quit. */ void OnQuit( wxCommandEvent& event ); - void OnUpdateDrawMode( wxUpdateUIEvent& aEvent ); void OnUpdateSelectDCode( wxUpdateUIEvent& aEvent ); void OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent ); diff --git a/gerbview/gerbview_painter.cpp b/gerbview/gerbview_painter.cpp index 3ccf97b3dd..1d1525b802 100644 --- a/gerbview/gerbview_painter.cpp +++ b/gerbview/gerbview_painter.cpp @@ -62,8 +62,8 @@ void GERBVIEW_RENDER_SETTINGS::LoadColors( const COLOR_SETTINGS* aSettings ) { COLOR4D baseColor = aSettings->GetColor( i ); - if( gvconfig()->m_Display.m_DiffMode ) - baseColor.a = 0.75; + if( gvconfig()->m_Display.m_ForceOpacityMode ) + baseColor.a = gvconfig()->m_Display.m_OpacityModeAlphaValue; m_layerColors[i] = baseColor; m_layerColorsHi[i] = baseColor.Brightened( 0.5 ); diff --git a/gerbview/gerbview_settings.cpp b/gerbview/gerbview_settings.cpp index bb21052cc2..ebea59044b 100644 --- a/gerbview/gerbview_settings.cpp +++ b/gerbview/gerbview_settings.cpp @@ -56,6 +56,9 @@ GERBVIEW_SETTINGS::GERBVIEW_SETTINGS() : m_params.emplace_back( new PARAM( "appearance.show_page_limit", &m_Display.m_DisplayPageLimits, false ) ); + m_params.emplace_back( new PARAM( "appearance.mode_opacity_value", + &m_Display.m_OpacityModeAlphaValue, 0.6 ) ); + m_params.emplace_back( new PARAM_LIST( "system.drill_file_history", &m_DrillFileHistory, {} ) ); diff --git a/gerbview/menubar.cpp b/gerbview/menubar.cpp index e8a5792082..65b1262d86 100644 --- a/gerbview/menubar.cpp +++ b/gerbview/menubar.cpp @@ -195,7 +195,7 @@ void GERBVIEW_FRAME::doReCreateMenuBar() viewMenu->Add( GERBVIEW_ACTIONS::polygonsDisplayOutlines, ACTION_MENU::CHECK ); viewMenu->Add( GERBVIEW_ACTIONS::dcodeDisplay, ACTION_MENU::CHECK ); viewMenu->Add( GERBVIEW_ACTIONS::negativeObjectDisplay, ACTION_MENU::CHECK ); - viewMenu->Add( GERBVIEW_ACTIONS::toggleDiffMode, ACTION_MENU::CHECK ); + viewMenu->Add( GERBVIEW_ACTIONS::toggleForceOpacityMode, ACTION_MENU::CHECK ); viewMenu->Add( GERBVIEW_ACTIONS::toggleXORMode, ACTION_MENU::CHECK ); viewMenu->Add( ACTIONS::highContrastMode, ACTION_MENU::CHECK ); viewMenu->Add( GERBVIEW_ACTIONS::flipGerberView, ACTION_MENU::CHECK ); diff --git a/gerbview/toolbars_gerber.cpp b/gerbview/toolbars_gerber.cpp index 5a1d106e89..9c9ce2bf44 100644 --- a/gerbview/toolbars_gerber.cpp +++ b/gerbview/toolbars_gerber.cpp @@ -256,7 +256,7 @@ void GERBVIEW_FRAME::ReCreateOptToolbar() m_optionsToolBar->Add( GERBVIEW_ACTIONS::negativeObjectDisplay, ACTION_TOOLBAR::TOGGLE ); m_optionsToolBar->Add( GERBVIEW_ACTIONS::dcodeDisplay, ACTION_TOOLBAR::TOGGLE ); m_optionsToolBar->AddScaledSeparator( this ); - m_optionsToolBar->Add( GERBVIEW_ACTIONS::toggleDiffMode, ACTION_TOOLBAR::TOGGLE ); + m_optionsToolBar->Add( GERBVIEW_ACTIONS::toggleForceOpacityMode, ACTION_TOOLBAR::TOGGLE ); m_optionsToolBar->Add( GERBVIEW_ACTIONS::toggleXORMode, ACTION_TOOLBAR::TOGGLE ); m_optionsToolBar->Add( ACTIONS::highContrastMode, ACTION_TOOLBAR::TOGGLE ); m_optionsToolBar->Add( GERBVIEW_ACTIONS::flipGerberView, ACTION_TOOLBAR::TOGGLE ); diff --git a/gerbview/tools/gerbview_actions.cpp b/gerbview/tools/gerbview_actions.cpp index 842c81ced1..30c97b747e 100644 --- a/gerbview/tools/gerbview_actions.cpp +++ b/gerbview/tools/gerbview_actions.cpp @@ -228,11 +228,11 @@ TOOL_ACTION GERBVIEW_ACTIONS::dcodeDisplay( TOOL_ACTION_ARGS() .Tooltip( _( "Show dcode number" ) ) .Icon( BITMAPS::show_dcodenumber ) ); -TOOL_ACTION GERBVIEW_ACTIONS::toggleDiffMode( TOOL_ACTION_ARGS() - .Name( "gerbview.Control.toggleDiffMode" ) +TOOL_ACTION GERBVIEW_ACTIONS::toggleForceOpacityMode( TOOL_ACTION_ARGS() + .Name( "gerbview.Control.toggleForceOpacityMode" ) .Scope( AS_GLOBAL ) - .FriendlyName( _( "Show in Differential Mode" ) ) - .Tooltip( _( "Show layers in differential compare mode" ) ) + .FriendlyName( _( "Show with Forced Opacity Mode" ) ) + .Tooltip( _( "Show layers using opacity color forced mode" ) ) .Icon( BITMAPS::gbr_select_mode1 ) ); TOOL_ACTION GERBVIEW_ACTIONS::toggleXORMode( TOOL_ACTION_ARGS() diff --git a/gerbview/tools/gerbview_actions.h b/gerbview/tools/gerbview_actions.h index 20c74d7aef..73c14d8698 100644 --- a/gerbview/tools/gerbview_actions.h +++ b/gerbview/tools/gerbview_actions.h @@ -63,7 +63,7 @@ public: static TOOL_ACTION polygonsDisplayOutlines; static TOOL_ACTION negativeObjectDisplay; static TOOL_ACTION dcodeDisplay; - static TOOL_ACTION toggleDiffMode; + static TOOL_ACTION toggleForceOpacityMode; static TOOL_ACTION toggleXORMode; static TOOL_ACTION flipGerberView; diff --git a/gerbview/tools/gerbview_control.cpp b/gerbview/tools/gerbview_control.cpp index 0af0b20bd3..a126480f71 100644 --- a/gerbview/tools/gerbview_control.cpp +++ b/gerbview/tools/gerbview_control.cpp @@ -300,11 +300,11 @@ int GERBVIEW_CONTROL::DisplayControl( const TOOL_EVENT& aEvent ) { cfg->m_Display.m_HighContrastMode = !cfg->m_Display.m_HighContrastMode; } - else if( aEvent.IsAction( &GERBVIEW_ACTIONS::toggleDiffMode ) ) + else if( aEvent.IsAction( &GERBVIEW_ACTIONS::toggleForceOpacityMode ) ) { - cfg->m_Display.m_DiffMode = !cfg->m_Display.m_DiffMode; + cfg->m_Display.m_ForceOpacityMode = !cfg->m_Display.m_ForceOpacityMode; - if( cfg->m_Display.m_DiffMode && cfg->m_Display.m_XORMode ) + if( cfg->m_Display.m_ForceOpacityMode && cfg->m_Display.m_XORMode ) cfg->m_Display.m_XORMode = false; m_frame->UpdateXORLayers(); @@ -313,8 +313,8 @@ int GERBVIEW_CONTROL::DisplayControl( const TOOL_EVENT& aEvent ) { cfg->m_Display.m_XORMode = !cfg->m_Display.m_XORMode; - if( cfg->m_Display.m_XORMode && cfg->m_Display.m_DiffMode ) - cfg->m_Display.m_DiffMode = false; + if( cfg->m_Display.m_XORMode && cfg->m_Display.m_ForceOpacityMode ) + cfg->m_Display.m_ForceOpacityMode = false; m_frame->UpdateXORLayers(); } @@ -541,7 +541,7 @@ void GERBVIEW_CONTROL::setTransitions() Go( &GERBVIEW_CONTROL::DisplayControl, GERBVIEW_ACTIONS::dcodeDisplay.MakeEvent() ); Go( &GERBVIEW_CONTROL::DisplayControl, ACTIONS::highContrastMode.MakeEvent() ); Go( &GERBVIEW_CONTROL::DisplayControl, ACTIONS::highContrastModeCycle.MakeEvent() ); - Go( &GERBVIEW_CONTROL::DisplayControl, GERBVIEW_ACTIONS::toggleDiffMode.MakeEvent() ); + Go( &GERBVIEW_CONTROL::DisplayControl, GERBVIEW_ACTIONS::toggleForceOpacityMode.MakeEvent() ); Go( &GERBVIEW_CONTROL::DisplayControl, GERBVIEW_ACTIONS::toggleXORMode.MakeEvent() ); Go( &GERBVIEW_CONTROL::DisplayControl, GERBVIEW_ACTIONS::flipGerberView.MakeEvent() );