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" ) );
332 wxCHECK2( dcode,
continue );
334 if( !dcode->m_InUse && !dcode->m_Defined )
337 msg.Printf( wxT(
"tool %d [%.3fx%.3f %s] %s" ),
339 dcode->m_Size.x /
scale, dcode->m_Size.y /
scale,
343 if( !dcode->m_AperFunction.IsEmpty() )
344 msg << wxT(
", " ) << dcode->m_AperFunction;
346 dcode_list.Add( msg );
351 if( dcode_list.size() > 1 )
354 size.x = std::max( size.x, 100 );
366 std::map<wxString, int> full_list;
372 if( gerber ==
nullptr )
382 for(
const std::pair<const wxString, int>& entry : full_list )
394 std::map<wxString, int> full_list;
400 if( gerber ==
nullptr )
410 for(
const std::pair<const wxString, int>& entry : full_list )
422 std::map<wxString, int> full_list;
428 if( gerber ==
nullptr )
436 if( aperture ==
nullptr )
439 if( !aperture->m_InUse && !aperture->m_Defined )
442 if( !aperture->m_AperFunction.IsEmpty() )
443 full_list.insert( std::make_pair( aperture->m_AperFunction, 0 ) );
451 for(
const std::pair<const wxString, int>& entry : full_list )
467 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)
static const wxChar * ShowApertureType(APERTURE_T aType)
Return a character string telling what type of aperture type aType is.
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
std::map< int, D_CODE * > m_ApertureList
Dcode (Aperture) List for this layer (see dcode.h)
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)