41#include <wx/textdlg.h>
42#include <wx/choicdlg.h>
65 m_frame = getEditFrame<GERBVIEW_FRAME>();
81 case EDA_UNITS::MILLIMETRES:
86 case EDA_UNITS::INCHES:
97 wxASSERT_MSG(
false, wxT(
"Invalid units" ) );
110 if( curr_layer ==
static_cast<int>( layer ) )
111 Line.Printf( wxT(
"*** Active layer (%2.2d) ***" ), layer + 1 );
113 Line.Printf( wxT(
"*** layer %2.2d ***" ), layer + 1 );
121 if( pt_D_code ==
nullptr )
127 Line.Printf( wxT(
"tool %2.2d: D%2.2d V %.4f %s H %.4f %s %s attribute '%s'" ),
137 Line += wxT(
" (not defined)" );
140 Line += wxT(
" (in use)" );
147 wxSingleChoiceDialog dlg(
m_frame, wxEmptyString,
_(
"D Codes" ), list, (
void**)
nullptr,
148 wxCHOICEDLG_STYLE & ~wxCANCEL );
165 if( !editorname.IsEmpty() )
172 if( !fn.FileExists() )
175 msg.Printf(
_(
"Source file '%s' not found." ), fn.GetFullPath() );
185 wxMessageBox(
_(
"No text editor selected in KiCad. Please choose one." ) );
191 msg.Printf(
_(
"No file loaded on the active layer %d." ), layer + 1 );
205 bool originSet =
false;
241 if( evt->IsCancelInteractive() )
253 else if( evt->IsActivate() )
258 if( evt->IsMoveTool() )
269 else if( !originSet && ( evt->IsDrag(
BUT_LEFT ) || evt->IsClick(
BUT_LEFT ) ) )
273 twoPtMgr.
SetEnd( cursorPos );
280 else if( originSet && ( evt->IsClick(
BUT_LEFT ) || evt->IsMouseUp(
BUT_LEFT ) ) )
288 else if( originSet && ( evt->IsMotion() || evt->IsDrag(
BUT_LEFT ) ) )
292 twoPtMgr.
SetEnd( cursorPos );
constexpr EDA_IU_SCALE gerbIUScale
static TOOL_ACTION updateUnits
static TOOL_ACTION measureTool
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
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.
D_CODE * GetDCODE(int aDCODE) const
Return a pointer to the D_CODE within this GERBER for the given aDCODE.
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.