26#include <wx/checkbox.h>
27#include <wx/filedlg.h>
90 for(
int layer: render_layers )
128#define RR LAYER_WIDGET::ROW
131 _(
"Show DCodes identification" ) ),
133 _(
"Show negative objects in this color" ) ),
136 _(
"Show the (x,y) grid dots" ) ),
138 _(
"Show drawing sheet border and title block") ),
140 _(
"Show drawing sheet page limits" ) ),
142 _(
"PCB Background" ),
true,
false )
145 for(
unsigned row = 0; row <
arrayDim( renderRows ); ++row )
148 renderRows[row].
color =
m_frame->GetVisibleElementColor( renderRows[row].
id );
150 if( renderRows[row].
id )
151 renderRows[row].
state =
m_frame->IsElementVisible( renderRows[row].
id );
168 _(
"Always Hide All Layers But Active" ),
174 aMenu->AppendSeparator();
182 aMenu->AppendSeparator();
185 _(
"Layers Display Parameters: Offset and Rotation" ),
188 aMenu->AppendSeparator();
216 int menuId =
event.GetId();
219 bool force_active_layer_visible;
235 for(
int row = 0; row < rowCount; ++row )
239 bool loc_visible = visible;
241 if( force_active_layer_visible && (layer ==
m_frame->GetActiveLayer() ) )
244 cb->SetValue( loc_visible );
245 visibleLayers[ row ] = loc_visible;
248 m_frame->SetVisibleLayers( visibleLayers );
249 m_frame->GetCanvas()->Refresh();
253 m_frame->SortLayersByX2Attributes();
257 m_frame->SortLayersByFileExtension();
273 m_frame->Erase_Current_DrawLayer(
false );
285 wxCommandEvent event;
314 visible =
m_frame->IsLayerVisible( layer );
346 color_settings->
SetColor( aLayer, aColor );
351 m_frame->GetCanvas()->Refresh();
359 int layer =
m_frame->GetActiveLayer();
361 m_frame->SetActiveLayer( aLayer,
false );
364 if( layer !=
m_frame->GetActiveLayer() )
370 int dcodeSelected =
m_frame->m_DCodeSelector->GetSelectedDCodeId();
371 settings->m_dcodeHighlightValue = dcodeSelected;
373 m_frame->GetCanvas()->Refresh();
385 visibleLayers[ aLayer ] = isVisible;
387 m_frame->SetVisibleLayers( visibleLayers );
390 m_frame->GetCanvas()->Refresh();
396 m_frame->SetVisibleElementColor( aId, aColor );
398 auto view =
m_frame->GetCanvas()->GetView();
401 color_settings->
SetColor( aId, aColor );
403 view->GetPainter()->GetSettings()->LoadColors( color_settings );
404 view->UpdateLayerColor( aId );
407 m_frame->GetCanvas()->Refresh();
413 m_frame->SetElementVisibility( aId, isEnabled );
419 m_frame->GetCanvas()->GetGAL()->SetGridVisibility(
m_frame->IsGridVisible() );
424 m_frame->GetCanvas()->GetView()->SetLayerVisible( aId, isEnabled );
428 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.