26#include <wx/checkbox.h>
27#include <wx/filedlg.h>
91 for(
int layer: render_layers )
101 aColorSettings->
SetColor( layer, color );
114 aColorSettings->
SetColor( layer, color );
129#define RR LAYER_WIDGET::ROW
132 _(
"Show DCodes identification" ) ),
134 _(
"Show negative objects in this color" ) ),
137 _(
"Show the (x,y) grid dots" ) ),
139 _(
"Show drawing sheet border and title block") ),
141 _(
"Show drawing sheet page limits" ) ),
143 _(
"PCB Background" ),
true,
false )
146 for(
unsigned row = 0; row <
arrayDim( renderRows ); ++row )
149 renderRows[row].
color =
m_frame->GetVisibleElementColor( renderRows[row].
id );
151 if( renderRows[row].
id )
152 renderRows[row].
state =
m_frame->IsElementVisible( renderRows[row].
id );
169 _(
"Always Hide All Layers But Active" ),
175 aMenu->AppendSeparator();
183 aMenu->AppendSeparator();
186 _(
"Layers Display Parameters: Offset and Rotation" ),
189 aMenu->AppendSeparator();
217 int menuId =
event.GetId();
220 bool force_active_layer_visible;
236 for(
int row = 0; row < rowCount; ++row )
240 bool loc_visible = visible;
242 if( force_active_layer_visible && (layer ==
m_frame->GetActiveLayer() ) )
245 cb->SetValue( loc_visible );
246 visibleLayers[ layer ] = loc_visible;
249 m_frame->SetVisibleLayers( visibleLayers );
250 m_frame->GetCanvas()->Refresh();
254 m_frame->SortLayersByX2Attributes();
258 m_frame->SortLayersByFileExtension();
274 m_frame->Erase_Current_DrawLayer(
false );
286 wxCommandEvent event;
315 visible =
m_frame->IsLayerVisible( layer );
347 color_settings->
SetColor( aLayer, aColor );
352 m_frame->GetCanvas()->Refresh();
360 int layer =
m_frame->GetActiveLayer();
362 m_frame->SetActiveLayer( aLayer,
false );
365 if( layer !=
m_frame->GetActiveLayer() )
371 int dcodeSelected =
m_frame->m_DCodeSelector->GetSelectedDCodeId();
372 settings->m_dcodeHighlightValue = dcodeSelected;
374 m_frame->GetCanvas()->Refresh();
386 visibleLayers[ aLayer ] = isVisible;
388 m_frame->SetVisibleLayers( visibleLayers );
391 m_frame->GetCanvas()->Refresh();
397 m_frame->SetVisibleElementColor( aId, aColor );
399 auto view =
m_frame->GetCanvas()->GetView();
402 color_settings->
SetColor( aId, aColor );
404 view->GetPainter()->GetSettings()->LoadColors( color_settings );
405 view->UpdateLayerColor( aId );
408 m_frame->GetCanvas()->Refresh();
414 m_frame->SetElementVisibility( aId, isEnabled );
420 m_frame->GetCanvas()->GetGAL()->SetGridVisibility(
m_frame->IsGridVisible() );
425 m_frame->GetCanvas()->GetView()->SetLayerVisible( aId, isEnabled );
429 m_frame->GetCanvas()->Refresh();
#define RR
Render Row abbreviation to reduce source width.
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
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)
GERBER_FILE_IMAGE_LIST is a helper class to handle a list of GERBER_FILE_IMAGE files which are loaded...
static GERBER_FILE_IMAGE_LIST & GetImagesList()
const wxString GetDisplayName(int aIdx, bool aNameOnly=false, bool aFullName=false)
Get the display name for the layer at aIdx.
static TOOL_ACTION moveLayerUp
static TOOL_ACTION moveLayerDown
A color representation with 4 components: red, green, blue, alpha.
Methods for drawing GerbView specific items.
virtual GERBVIEW_RENDER_SETTINGS * GetSettings() override
Return a pointer to current settings that are going to be used when drawing items.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
void UpdateLayerColor(int aLayer)
Apply the new coloring scheme held by RENDER_SETTINGS in case that it has changed.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
LSET is a set of PCB_LAYER_IDs.
@ LAYER_GERBVIEW_DRAWINGSHEET
@ GERBVIEW_LAYER_ID_START
@ LAYER_GERBVIEW_BACKGROUND
@ LAYER_GERBVIEW_PAGE_LIMITS
#define GERBER_DRAWLAYERS_COUNT
Number of draw layers in Gerbview.
#define GERBER_DRAW_LAYER(x)
@ COLOR
Color has changed.
@ TARGET_NONCACHED
Auxiliary rendering target (noncached)
KICOMMON_API wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmapBundle &aImage, wxItemKind aType=wxITEM_NORMAL)
Create and insert a menu item with an icon into aMenu.