2011-09-23 20:00:30 +00:00
|
|
|
/*
|
2011-09-30 18:15:37 +00:00
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
2011-09-23 20:00:30 +00:00
|
|
|
*
|
2014-11-23 11:41:57 +00:00
|
|
|
* Copyright (C) 2004-2010 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2011-09-23 20:00:30 +00:00
|
|
|
* Copyright (C) 2010 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
2019-04-10 13:40:01 +00:00
|
|
|
* Copyright (C) 2018-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-09-23 20:00:30 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
|
|
|
#include <common.h>
|
|
|
|
#include <macros.h>
|
2018-01-29 12:26:58 +00:00
|
|
|
#include <gbr_layer_box_selector.h>
|
2018-02-28 09:21:37 +00:00
|
|
|
#include <menus_helpers.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <gerbview.h>
|
2014-06-27 17:07:42 +00:00
|
|
|
#include <gerbview_frame.h>
|
2018-01-29 12:26:58 +00:00
|
|
|
#include <gerber_file_image_list.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <layer_widget.h>
|
2018-01-29 12:26:58 +00:00
|
|
|
#include <gerbview_layer_widget.h>
|
2017-09-17 22:43:20 +00:00
|
|
|
#include <view/view.h>
|
|
|
|
#include <gerbview_painter.h>
|
|
|
|
#include <gal/graphics_abstraction_layer.h>
|
|
|
|
|
2011-09-23 20:00:30 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Class GERBER_LAYER_WIDGET
|
|
|
|
* is here to implement the abtract functions of LAYER_WIDGET so they
|
|
|
|
* may be tied into the GERBVIEW_FRAME's data and so we can add a popup
|
2011-09-30 18:15:37 +00:00
|
|
|
* menu which is specific to Pcbnew's needs.
|
2011-09-23 20:00:30 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2018-05-02 14:46:09 +00:00
|
|
|
GERBER_LAYER_WIDGET::GERBER_LAYER_WIDGET( GERBVIEW_FRAME* aParent, wxWindow* aFocusOwner ) :
|
|
|
|
LAYER_WIDGET( aParent, aFocusOwner ),
|
2011-09-23 20:00:30 +00:00
|
|
|
myframe( aParent )
|
|
|
|
{
|
2013-04-06 12:01:53 +00:00
|
|
|
m_alwaysShowActiveLayer = false;
|
|
|
|
|
2011-09-23 20:00:30 +00:00
|
|
|
ReFillRender();
|
|
|
|
|
2011-09-30 18:15:37 +00:00
|
|
|
// Update default tabs labels for GerbView
|
2011-09-23 20:00:30 +00:00
|
|
|
SetLayersManagerTabsText( );
|
|
|
|
|
|
|
|
//-----<Popup menu>-------------------------------------------------
|
|
|
|
// handle the popup menu over the layer window.
|
|
|
|
m_LayerScrolledWindow->Connect( wxEVT_RIGHT_DOWN,
|
|
|
|
wxMouseEventHandler( GERBER_LAYER_WIDGET::onRightDownLayers ), NULL, this );
|
|
|
|
|
|
|
|
// since Popupmenu() calls this->ProcessEvent() we must call this->Connect()
|
|
|
|
// and not m_LayerScrolledWindow->Connect()
|
2014-11-22 11:52:57 +00:00
|
|
|
Connect( ID_LAYER_MANAGER_START, ID_LAYER_MANAGER_END,
|
2013-04-06 12:01:53 +00:00
|
|
|
wxEVT_COMMAND_MENU_SELECTED,
|
2011-09-23 20:00:30 +00:00
|
|
|
wxCommandEventHandler( GERBER_LAYER_WIDGET::onPopupSelection ), NULL, this );
|
|
|
|
}
|
|
|
|
|
2016-06-17 18:00:29 +00:00
|
|
|
GERBER_FILE_IMAGE_LIST* GERBER_LAYER_WIDGET::GetImagesList()
|
|
|
|
{
|
|
|
|
return &GERBER_FILE_IMAGE_LIST::GetImagesList();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-09-23 20:00:30 +00:00
|
|
|
void GERBER_LAYER_WIDGET::SetLayersManagerTabsText( )
|
|
|
|
{
|
2018-02-22 23:54:50 +00:00
|
|
|
m_notebook->SetPageText(0, _("Layers") );
|
|
|
|
m_notebook->SetPageText(1, _("Items") );
|
2011-09-23 20:00:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function ReFillRender
|
|
|
|
* Rebuild Render for instance after the config is read
|
|
|
|
*/
|
|
|
|
void GERBER_LAYER_WIDGET::ReFillRender()
|
|
|
|
{
|
|
|
|
ClearRenderRows();
|
|
|
|
|
|
|
|
// Fixed "Rendering" tab rows within the LAYER_WIDGET, only the initial color
|
|
|
|
// is changed before appending to the LAYER_WIDGET. This is an automatic variable
|
|
|
|
// not a static variable, change the color & state after copying from code to renderRows
|
|
|
|
// on the stack.
|
2018-07-07 08:50:13 +00:00
|
|
|
LAYER_WIDGET::ROW renderRows[6] = {
|
2011-09-23 20:00:30 +00:00
|
|
|
|
|
|
|
#define RR LAYER_WIDGET::ROW // Render Row abreviation to reduce source width
|
|
|
|
|
2018-07-07 08:50:13 +00:00
|
|
|
// text id color tooltip checked
|
|
|
|
RR( _( "DCodes" ), LAYER_DCODES, WHITE, _( "Show DCodes identification" ) ),
|
|
|
|
RR( _( "Negative Objects" ), LAYER_NEGATIVE_OBJECTS, DARKGRAY, _( "Show negative objects in this color" ) ),
|
|
|
|
RR(),
|
|
|
|
RR( _( "Grid" ), LAYER_GERBVIEW_GRID, WHITE, _( "Show the (x,y) grid dots" ) ),
|
|
|
|
RR( _( "Worksheet" ), LAYER_WORKSHEET, DARKRED, _( "Show worksheet") ),
|
|
|
|
RR( _( "Background" ), LAYER_PCB_BACKGROUND, BLACK, _( "PCB Background" ), true, false )
|
2011-09-23 20:00:30 +00:00
|
|
|
};
|
|
|
|
|
2019-01-06 16:43:12 +00:00
|
|
|
for( unsigned row=0; row<arrayDim(renderRows); ++row )
|
2011-09-23 20:00:30 +00:00
|
|
|
{
|
2017-02-20 17:48:27 +00:00
|
|
|
if( renderRows[row].color != COLOR4D::UNSPECIFIED ) // does this row show a color?
|
2018-07-07 08:50:13 +00:00
|
|
|
renderRows[row].color = myframe->GetVisibleElementColor( renderRows[row].id );
|
2018-07-29 16:26:13 +00:00
|
|
|
|
|
|
|
if( renderRows[row].id ) // if not the separator
|
|
|
|
renderRows[row].state = myframe->IsElementVisible( renderRows[row].id );
|
2011-09-23 20:00:30 +00:00
|
|
|
}
|
|
|
|
|
2019-01-06 16:43:12 +00:00
|
|
|
AppendRenderRows( renderRows, arrayDim(renderRows) );
|
2011-09-23 20:00:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-02-28 09:21:37 +00:00
|
|
|
void GERBER_LAYER_WIDGET::AddRightClickMenuItems( wxMenu* aMenu )
|
2011-09-23 20:00:30 +00:00
|
|
|
{
|
2014-11-22 11:52:57 +00:00
|
|
|
// Remember: menu text is capitalized (see our rules_for_capitalization_in_Kicad_UI.txt)
|
2018-02-28 09:21:37 +00:00
|
|
|
AddMenuItem( aMenu, ID_SHOW_ALL_LAYERS, _( "Show All Layers" ),
|
|
|
|
KiBitmap( show_all_layers_xpm ) );
|
2012-02-17 19:43:43 +00:00
|
|
|
|
2018-02-28 09:21:37 +00:00
|
|
|
AddMenuItem( aMenu, ID_SHOW_NO_LAYERS_BUT_ACTIVE,
|
|
|
|
_( "Hide All Layers But Active" ),
|
|
|
|
KiBitmap( select_w_layer_xpm ) );
|
2011-09-23 20:00:30 +00:00
|
|
|
|
2018-02-28 09:21:37 +00:00
|
|
|
AddMenuItem( aMenu, ID_ALWAYS_SHOW_NO_LAYERS_BUT_ACTIVE,
|
|
|
|
_( "Always Hide All Layers But Active" ),
|
|
|
|
KiBitmap( select_w_layer_xpm ) );
|
2013-04-06 12:01:53 +00:00
|
|
|
|
2018-02-28 09:21:37 +00:00
|
|
|
AddMenuItem( aMenu, ID_SHOW_NO_LAYERS, _( "Hide All Layers" ),
|
|
|
|
KiBitmap( show_no_layers_xpm ) );
|
2011-09-23 20:00:30 +00:00
|
|
|
|
2018-02-28 09:21:37 +00:00
|
|
|
aMenu->AppendSeparator();
|
|
|
|
AddMenuItem( aMenu, ID_SORT_GBR_LAYERS, _( "Sort Layers if X2 Mode" ),
|
|
|
|
KiBitmap( reload_xpm ) );
|
2017-09-22 10:36:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GERBER_LAYER_WIDGET::onRightDownLayers( wxMouseEvent& event )
|
|
|
|
{
|
|
|
|
wxMenu menu;
|
|
|
|
|
2018-02-28 09:21:37 +00:00
|
|
|
AddRightClickMenuItems( &menu );
|
2011-09-23 20:00:30 +00:00
|
|
|
PopupMenu( &menu );
|
|
|
|
|
|
|
|
passOnFocus();
|
|
|
|
}
|
|
|
|
|
|
|
|
void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
|
|
|
|
{
|
2014-06-27 17:07:42 +00:00
|
|
|
int rowCount;
|
|
|
|
int menuId = event.GetId();
|
2015-01-17 08:01:16 +00:00
|
|
|
bool visible = (menuId == ID_SHOW_ALL_LAYERS) ? true : false;
|
2019-04-10 13:40:01 +00:00
|
|
|
LSET visibleLayers;
|
2013-04-06 12:01:53 +00:00
|
|
|
bool force_active_layer_visible;
|
|
|
|
|
2011-09-23 20:00:30 +00:00
|
|
|
switch( menuId )
|
|
|
|
{
|
2013-04-06 12:01:53 +00:00
|
|
|
case ID_SHOW_ALL_LAYERS:
|
|
|
|
case ID_SHOW_NO_LAYERS:
|
|
|
|
case ID_ALWAYS_SHOW_NO_LAYERS_BUT_ACTIVE:
|
|
|
|
case ID_SHOW_NO_LAYERS_BUT_ACTIVE:
|
2018-02-28 09:21:37 +00:00
|
|
|
// Set the display layers options. Sorting layers has no effect to these options
|
|
|
|
m_alwaysShowActiveLayer = ( menuId == ID_ALWAYS_SHOW_NO_LAYERS_BUT_ACTIVE );
|
|
|
|
force_active_layer_visible = ( menuId == ID_SHOW_NO_LAYERS_BUT_ACTIVE ||
|
|
|
|
menuId == ID_ALWAYS_SHOW_NO_LAYERS_BUT_ACTIVE );
|
2019-04-10 13:40:01 +00:00
|
|
|
|
2018-02-28 09:21:37 +00:00
|
|
|
// Update icons and check boxes
|
2011-09-23 20:00:30 +00:00
|
|
|
rowCount = GetLayerRowCount();
|
2019-04-10 13:40:01 +00:00
|
|
|
|
|
|
|
for( int row = 0; row < rowCount; ++row )
|
2011-09-23 20:00:30 +00:00
|
|
|
{
|
2014-07-20 17:41:12 +00:00
|
|
|
wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, COLUMN_COLOR_LYR_CB );
|
2014-06-27 17:07:42 +00:00
|
|
|
int layer = getDecodedId( cb->GetId() );
|
2012-02-17 19:43:43 +00:00
|
|
|
bool loc_visible = visible;
|
2013-04-06 12:01:53 +00:00
|
|
|
|
2019-04-10 13:40:01 +00:00
|
|
|
if( force_active_layer_visible && (layer == myframe->GetActiveLayer() ) )
|
2012-02-17 19:43:43 +00:00
|
|
|
loc_visible = true;
|
|
|
|
|
|
|
|
cb->SetValue( loc_visible );
|
2019-04-10 13:40:01 +00:00
|
|
|
visibleLayers[ row ] = loc_visible;
|
2011-09-23 20:00:30 +00:00
|
|
|
}
|
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
myframe->SetVisibleLayers( visibleLayers );
|
2019-05-30 12:25:08 +00:00
|
|
|
myframe->GetGalCanvas()->Refresh();
|
2011-09-23 20:00:30 +00:00
|
|
|
break;
|
2014-11-22 11:52:57 +00:00
|
|
|
|
|
|
|
case ID_SORT_GBR_LAYERS:
|
2018-02-28 02:33:41 +00:00
|
|
|
myframe->SortLayersByX2Attributes();
|
2014-11-22 11:52:57 +00:00
|
|
|
break;
|
2011-09-23 20:00:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-06 12:01:53 +00:00
|
|
|
bool GERBER_LAYER_WIDGET::OnLayerSelected()
|
|
|
|
{
|
|
|
|
if( !m_alwaysShowActiveLayer )
|
|
|
|
return false;
|
|
|
|
|
2014-11-22 11:52:57 +00:00
|
|
|
// postprocess after active layer selection
|
2013-04-06 12:01:53 +00:00
|
|
|
// ensure active layer visible
|
|
|
|
wxCommandEvent event;
|
|
|
|
event.SetId( ID_ALWAYS_SHOW_NO_LAYERS_BUT_ACTIVE );
|
|
|
|
onPopupSelection( event );
|
|
|
|
return true;
|
|
|
|
}
|
2011-09-23 20:00:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
void GERBER_LAYER_WIDGET::ReFill()
|
|
|
|
{
|
2014-11-22 11:52:57 +00:00
|
|
|
Freeze();
|
|
|
|
|
2011-09-23 20:00:30 +00:00
|
|
|
ClearLayerRows();
|
2011-12-22 13:28:11 +00:00
|
|
|
|
2014-06-27 17:07:42 +00:00
|
|
|
for( int layer = 0; layer < GERBER_DRAWLAYERS_COUNT; ++layer )
|
2011-09-23 20:00:30 +00:00
|
|
|
{
|
2016-06-17 18:00:29 +00:00
|
|
|
wxString msg = GetImagesList()->GetDisplayName( layer );
|
2014-11-22 11:52:57 +00:00
|
|
|
|
2017-09-17 22:43:20 +00:00
|
|
|
bool visible = true;
|
2018-03-04 04:43:16 +00:00
|
|
|
|
2017-09-17 22:43:20 +00:00
|
|
|
if( auto canvas = myframe->GetGalCanvas() )
|
|
|
|
{
|
|
|
|
visible = canvas->GetView()->IsLayerVisible( GERBER_DRAW_LAYER( layer ) );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
visible = myframe->IsLayerVisible( layer );
|
|
|
|
}
|
|
|
|
|
2018-03-04 04:43:16 +00:00
|
|
|
AppendLayerRow( LAYER_WIDGET::ROW( msg, layer,
|
2017-09-17 22:43:20 +00:00
|
|
|
myframe->GetLayerColor( GERBER_DRAW_LAYER( layer ) ),
|
|
|
|
wxEmptyString, visible, true ) );
|
2011-09-23 20:00:30 +00:00
|
|
|
}
|
|
|
|
|
2018-08-03 19:41:57 +00:00
|
|
|
UpdateLayouts();
|
2014-11-22 11:52:57 +00:00
|
|
|
Thaw();
|
2011-09-23 20:00:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----<LAYER_WIDGET callbacks>-------------------------------------------
|
|
|
|
|
2017-09-22 10:36:47 +00:00
|
|
|
void GERBER_LAYER_WIDGET::OnLayerRightClick( wxMenu& aMenu )
|
|
|
|
{
|
2018-02-28 09:21:37 +00:00
|
|
|
AddRightClickMenuItems( &aMenu );
|
2017-09-22 10:36:47 +00:00
|
|
|
}
|
|
|
|
|
2018-03-04 04:43:16 +00:00
|
|
|
|
2017-02-20 16:57:41 +00:00
|
|
|
void GERBER_LAYER_WIDGET::OnLayerColorChange( int aLayer, COLOR4D aColor )
|
2011-09-23 20:00:30 +00:00
|
|
|
{
|
2018-03-04 04:43:16 +00:00
|
|
|
// NOTE: Active layer in GerbView is stored as 0-indexed, but layer color is
|
|
|
|
// stored according to the GERBER_DRAW_LAYER() offset.
|
|
|
|
|
|
|
|
myframe->SetLayerColor( GERBER_DRAW_LAYER( aLayer ), aColor );
|
2011-09-23 20:00:30 +00:00
|
|
|
myframe->m_SelLayerBox->ResyncBitmapOnly();
|
2017-09-17 22:43:20 +00:00
|
|
|
|
2019-05-27 16:16:54 +00:00
|
|
|
KIGFX::VIEW* view = myframe->GetGalCanvas()->GetView();
|
|
|
|
view->GetPainter()->GetSettings()->ImportLegacyColors( myframe->m_colorsSettings );
|
|
|
|
view->UpdateLayerColor( GERBER_DRAW_LAYER( aLayer ) );
|
2017-09-17 22:43:20 +00:00
|
|
|
|
2019-05-30 12:25:08 +00:00
|
|
|
myframe->GetGalCanvas()->Refresh();
|
2011-09-23 20:00:30 +00:00
|
|
|
}
|
|
|
|
|
2018-03-04 04:43:16 +00:00
|
|
|
|
2014-06-27 17:07:42 +00:00
|
|
|
bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer )
|
2011-09-23 20:00:30 +00:00
|
|
|
{
|
|
|
|
// the layer change from the GERBER_LAYER_WIDGET can be denied by returning
|
|
|
|
// false from this function.
|
2018-03-04 04:43:16 +00:00
|
|
|
int layer = myframe->GetActiveLayer();
|
|
|
|
|
|
|
|
myframe->SetActiveLayer( aLayer, false );
|
2011-09-23 20:00:30 +00:00
|
|
|
myframe->syncLayerBox();
|
2011-12-22 13:28:11 +00:00
|
|
|
|
2018-03-04 04:43:16 +00:00
|
|
|
if( layer != myframe->GetActiveLayer() )
|
2013-04-06 12:01:53 +00:00
|
|
|
{
|
|
|
|
if( ! OnLayerSelected() )
|
2019-05-30 12:25:08 +00:00
|
|
|
myframe->GetGalCanvas()->Refresh();
|
2013-04-06 12:01:53 +00:00
|
|
|
}
|
2011-09-23 20:00:30 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-03-04 04:43:16 +00:00
|
|
|
|
2014-06-27 17:07:42 +00:00
|
|
|
void GERBER_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal )
|
2011-09-23 20:00:30 +00:00
|
|
|
{
|
2019-04-10 13:40:01 +00:00
|
|
|
LSET visibleLayers = myframe->GetVisibleLayers();
|
2011-09-23 20:00:30 +00:00
|
|
|
|
2019-04-10 13:40:01 +00:00
|
|
|
visibleLayers[ aLayer ] = isVisible;
|
2011-09-23 20:00:30 +00:00
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
myframe->SetVisibleLayers( visibleLayers );
|
2011-09-23 20:00:30 +00:00
|
|
|
|
|
|
|
if( isFinal )
|
2019-05-30 12:25:08 +00:00
|
|
|
myframe->GetGalCanvas()->Refresh();
|
2011-09-23 20:00:30 +00:00
|
|
|
}
|
|
|
|
|
2018-03-04 04:43:16 +00:00
|
|
|
|
2017-02-20 16:57:41 +00:00
|
|
|
void GERBER_LAYER_WIDGET::OnRenderColorChange( int aId, COLOR4D aColor )
|
2011-09-23 20:00:30 +00:00
|
|
|
{
|
2018-07-07 08:50:13 +00:00
|
|
|
myframe->SetVisibleElementColor( aId, aColor );
|
2017-09-17 22:43:20 +00:00
|
|
|
|
|
|
|
auto galCanvas = myframe->GetGalCanvas();
|
2019-05-27 16:16:54 +00:00
|
|
|
auto view = galCanvas->GetView();
|
2017-09-17 22:43:20 +00:00
|
|
|
|
2019-05-27 16:16:54 +00:00
|
|
|
view->GetPainter()->GetSettings()->ImportLegacyColors( myframe->m_colorsSettings );
|
|
|
|
view->UpdateLayerColor( aId );
|
2017-09-17 22:43:20 +00:00
|
|
|
|
2019-05-27 16:16:54 +00:00
|
|
|
view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
|
|
|
view->UpdateAllItems( KIGFX::COLOR );
|
|
|
|
galCanvas->Refresh();
|
2011-09-23 20:00:30 +00:00
|
|
|
}
|
|
|
|
|
2018-03-04 04:43:16 +00:00
|
|
|
|
2011-09-23 20:00:30 +00:00
|
|
|
void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
|
|
|
|
{
|
2018-07-07 08:50:13 +00:00
|
|
|
myframe->SetElementVisibility( aId, isEnabled );
|
2017-09-17 22:43:20 +00:00
|
|
|
|
|
|
|
auto galCanvas = myframe->GetGalCanvas();
|
|
|
|
|
|
|
|
if( galCanvas )
|
|
|
|
{
|
|
|
|
if( aId == LAYER_GERBVIEW_GRID )
|
|
|
|
{
|
|
|
|
galCanvas->GetGAL()->SetGridVisibility( myframe->IsGridVisible() );
|
|
|
|
galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
galCanvas->GetView()->SetLayerVisible( aId, isEnabled );
|
|
|
|
}
|
|
|
|
|
2019-05-27 16:16:54 +00:00
|
|
|
galCanvas->Refresh();
|
2011-09-23 20:00:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----</LAYER_WIDGET callbacks>------------------------------------------
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Virtual Function useAlternateBitmap
|
|
|
|
* return true if bitmaps shown in Render layer list
|
2017-11-02 20:36:45 +00:00
|
|
|
* must be alternate bitmap (when a gerber image is loaded), or false to use "normal" bitmap
|
2011-09-23 20:00:30 +00:00
|
|
|
*/
|
|
|
|
bool GERBER_LAYER_WIDGET::useAlternateBitmap(int aRow)
|
|
|
|
{
|
2016-06-17 18:00:29 +00:00
|
|
|
return GetImagesList()->GetGbrImage( aRow ) != NULL;
|
2011-09-23 20:00:30 +00:00
|
|
|
}
|