22#include <wx/wupdlock.h>
23#include <wx/stattext.h>
48 case TOOLBAR_LOC::RIGHT:
51 case TOOLBAR_LOC::LEFT:
80 case TOOLBAR_LOC::TOP_MAIN:
102 case TOOLBAR_LOC::TOP_AUX:
128 auto layerBoxFactory =
135 wxDefaultPosition, wxDefaultSize, 0,
nullptr );
142 aToolbar->Bind( wxEVT_UPDATE_UI,
143 [
this]( wxUpdateUIEvent& aEvent )
147 if( m_SelLayerBox->GetSelection() != GetActiveLayer() )
148 m_SelLayerBox->SetSelection( GetActiveLayer() );
157 auto textInfoFactory =
163 wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
175 auto componentBoxFactory =
182 m_cmpText =
new wxStaticText( aToolbar, wxID_ANY,
_(
"Cmp:" ) + wxS(
" " ) );
185 m_cmpText->SetLabel(
_(
"Cmp:" ) + wxS(
" " ) );
204 m_netText =
new wxStaticText( aToolbar, wxID_ANY,
_(
"Net:" ) );
219 auto appertureBoxFactory =
229 m_apertText =
new wxStaticText( aToolbar, wxID_ANY,
_(
"Attr:" ) );
244 auto dcodeSelectorFactory =
251 wxDefaultPosition, wxSize( 150, -1 ) );
255 m_dcodeText =
new wxStaticText( aToolbar, wxID_ANY,
_(
"DCode:" ) );
269 _(
"Text info entry" ) );
271 _(
"Component highlight" ),
272 _(
"Highlight items belonging to this component" ) );
274 _(
"Highlight items belonging to this net" ) );
276 _(
"Highlight items with this aperture attribute" ));
278 _(
"Select all items with the selected DCode" ) );
281#define NO_SELECTION_STRING _("<No selection>")
303 wxArrayString dcode_list;
316 case EDA_UNITS::INCH:
321 case EDA_UNITS::MILS:
323 units = wxT(
"mil" );
327 wxASSERT_MSG(
false, wxT(
"Invalid units" ) );
334 if( dcode ==
nullptr )
340 msg.Printf( wxT(
"tool %d [%.3fx%.3f %s] %s" ),
349 dcode_list.Add( msg );
354 if( dcode_list.size() > 1 )
357 size.x = std::max( size.x, 100 );
369 std::map<wxString, int> full_list;
375 if( gerber ==
nullptr )
385 for(
const std::pair<const wxString, int>& entry : full_list )
397 std::map<wxString, int> full_list;
403 if( gerber ==
nullptr )
413 for(
const std::pair<const wxString, int>& entry : full_list )
425 std::map<wxString, int> full_list;
431 if( gerber ==
nullptr )
441 if( aperture ==
nullptr )
448 full_list.insert( std::make_pair( aperture->
m_AperFunction, 0 ) );
456 for(
const std::pair<const wxString, int>& entry : full_list )
472 aEvent.Enable( gerber !=
nullptr );
constexpr EDA_IU_SCALE gerbIUScale
static TOOL_ACTION toggleGrid
static TOOL_ACTION zoomRedraw
static TOOL_ACTION millimetersUnits
static TOOL_ACTION zoomOutCenter
static TOOL_ACTION togglePolarCoords
static TOOL_ACTION milsUnits
static TOOL_ACTION inchesUnits
static TOOL_ACTION highContrastMode
static TOOL_ACTION toggleCursorStyle
static TOOL_ACTION measureTool
static TOOL_ACTION selectionTool
static TOOL_ACTION zoomFitScreen
static TOOL_ACTION zoomTool
static TOOL_ACTION zoomInCenter
Helper to display a DCode list and select a DCode id.
void SetDCodeSelection(int aDCodeId)
void AppendDCodeList(const wxArrayString &aChoices)
A gerber DCODE (also called Aperture) definition.
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command).
int m_Num_Dcode
D code value ( >= 10 )
static const wxChar * ShowApertureType(APERTURE_T aType)
Return a character string telling what type of aperture type aType is.
VECTOR2I m_Size
Horizontal and vertical dimensions.
APERTURE_T m_ApertType
Aperture type ( Line, rectangle, circle, oval poly, macro )
bool m_Defined
false if the aperture is not defined in the header
bool m_InUse
false if the aperture (previously defined) is not used to draw something
void RegisterCustomToolbarControlFactory(const ACTION_TOOLBAR_CONTROL &aControlDesc, const ACTION_TOOLBAR_CONTROL_FACTORY &aControlFactory)
Register a creation factory for toolbar controls that are present in this frame.
void configureToolbars() override
unsigned ImagesMaxCount()
GERBER_FILE_IMAGE * GetGbrImage(int aIdx)
Hold the image data and parameters for one gerber file and layer parameters.
std::map< wxString, int > m_ComponentsList
D_CODE * GetDCODE(int aDCODE) const
Return a pointer to the D_CODE within this GERBER for the given aDCODE.
std::map< wxString, int > m_NetnamesList
static TOOL_ACTION dcodeDisplay
static TOOL_ACTION negativeObjectDisplay
static TOOL_ACTION flashedDisplayOutlines
static TOOL_ACTION toggleXORMode
static TOOL_ACTION toggleLayerManager
static TOOL_ACTION openGerber
static TOOL_ACTION clearAllLayers
static TOOL_ACTION flipGerberView
static TOOL_ACTION openAutodetected
static TOOL_ACTION reloadAllLayers
static TOOL_ACTION toggleForceOpacityMode
static TOOL_ACTION linesDisplayOutlines
static TOOL_ACTION openDrillFile
static TOOL_ACTION polygonsDisplayOutlines
void OnUpdateSelectDCode(wxUpdateUIEvent &aEvent)
wxStaticText * m_dcodeText
wxChoice * m_SelAperAttributesBox
void configureToolbars() override
GBR_LAYER_BOX_SELECTOR * m_SelLayerBox
GERBER_FILE_IMAGE_LIST * GetImagesList() const
Accessors to GERBER_FILE_IMAGE_LIST and GERBER_FILE_IMAGE data.
void updateDCodeSelectBox()
wxChoice * m_SelComponentBox
wxChoice * m_SelNetnameBox
int GetActiveLayer() const
Return the active layer.
DCODE_SELECTION_BOX * m_DCodeSelector
void updateAperAttributesSelectBox()
wxStaticText * m_apertText
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const
void updateComponentListSelectBox()
void updateNetnameListSelectBox()
EDA_UNITS GetUserUnits() const
@ ID_GBR_AUX_TOOLBAR_PCB_NET_CHOICE
@ ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER
@ ID_GBR_AUX_TOOLBAR_PCB_CMP_CHOICE
@ ID_TOOLBARH_GERBER_SELECT_ACTIVE_DCODE
@ ID_GBR_AUX_TOOLBAR_PCB_APERATTRIBUTES_CHOICE
@ ID_TOOLBARH_GERBER_DATA_TEXT_BOX
wxString UnescapeString(const wxString &aSource)