41#include <wx/textdlg.h>
42#include <wx/choicdlg.h>
65 m_frame = getEditFrame<GERBVIEW_FRAME>();
96 wxASSERT_MSG(
false, wxT(
"Invalid units" ) );
109 if( curr_layer ==
static_cast<int>( layer ) )
110 Line.Printf( wxT(
"*** Active layer (%2.2d) ***" ), layer + 1 );
112 Line.Printf( wxT(
"*** layer %2.2d ***" ), layer + 1 );
119 if( pt_D_code ==
nullptr )
122 if( !pt_D_code->m_InUse && !pt_D_code->m_Defined )
125 Line.Printf( wxT(
"tool %d: Dcode D%d V %.4f %s H %.4f %s %s attribute '%s'" ),
127 pt_D_code->m_Num_Dcode,
128 pt_D_code->m_Size.y /
scale, units,
129 pt_D_code->m_Size.x /
scale, units,
131 pt_D_code->m_AperFunction.IsEmpty()? wxString( wxT(
"none" ) ) : pt_D_code->m_AperFunction
134 if( !pt_D_code->m_Defined )
135 Line += wxT(
" (not defined)" );
137 if( pt_D_code->m_InUse )
138 Line += wxT(
" (in use)" );
145 wxSingleChoiceDialog dlg(
m_frame, wxEmptyString,
_(
"D Codes" ), list, (
void**)
nullptr,
146 wxCHOICEDLG_STYLE & ~wxCANCEL );
163 if( !editorname.IsEmpty() )
170 if( !fn.FileExists() )
173 msg.Printf(
_(
"Source file '%s' not found." ), fn.GetFullPath() );
183 wxMessageBox(
_(
"No text editor selected in KiCad. Please choose one." ) );
189 msg.Printf(
_(
"No file loaded on the active layer %d." ), layer + 1 );
203 bool originSet =
false;
239 if( evt->IsCancelInteractive() )
251 else if( evt->IsActivate() )
256 if( evt->IsMoveTool() )
267 else if( !originSet && ( evt->IsDrag(
BUT_LEFT ) || evt->IsClick(
BUT_LEFT ) ) )
271 twoPtMgr.
SetEnd( cursorPos );
278 else if( originSet && ( evt->IsClick(
BUT_LEFT ) || evt->IsMouseUp(
BUT_LEFT ) ) )
286 else if( originSet && ( evt->IsMotion() || evt->IsDrag(
BUT_LEFT ) ) )
290 twoPtMgr.
SetEnd( cursorPos );
constexpr EDA_IU_SCALE gerbIUScale
static TOOL_ACTION updateUnits
static TOOL_ACTION measureTool
static const wxChar * ShowApertureType(APERTURE_T aType)
Return a character string telling what type of aperture type aType is.
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
Hold the image data and parameters for one gerber file and layer parameters.
wxString m_FileName
Full File Name for this layer.
std::map< int, D_CODE * > m_ApertureList
Dcode (Aperture) List for this layer (see dcode.h)
static TOOL_ACTION showDCodes
static TOOL_ACTION showSource
int GetActiveLayer() const
Return the active layer.
unsigned ImagesMaxCount() const
The max number of file images.
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const
A drawn ruler item for showing the distance between two points.
void SwitchUnits(EDA_UNITS aUnits)
Switch the ruler units.
Represent a very simple geometry manager for items that have a start and end point.
void SetOrigin(const VECTOR2I &aOrigin)
< Set the origin of the ruler (the fixed end)
void SetAngleSnap(bool aSnap)
void SetEnd(const VECTOR2I &aEnd)
Set the current end of the rectangle (the end that moves with the cursor.
An interface for classes handling user events controlling the view behavior such as zooming,...
virtual void CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
virtual const wxString & GetTextEditor(bool aCanShowFileChooser=true)
Return the path to the preferred text editor application.
EDA_UNITS GetUserUnits() const
int ExecuteFile(const wxString &aEditorName, const wxString &aFileName, wxProcess *aCallback, bool aFileForKicad)
Call the executable file aEditorName with the parameter aFileName.
@ GEOMETRY
Position or shape has changed.
PGM_BASE & Pgm()
The global program "get" accessor.