38 m_toolMgr( aParent->GetToolManager() ),
39 m_translation( translation ),
40 m_anchor_position( anchor ),
41 m_xOffset( aParent, m_xLabel, m_xEntry, m_xUnit ),
42 m_yOffset( aParent, m_yLabel, m_yEntry, m_yUnit ),
81 q = ( r != 0) ?
RAD2DEG( atan2( y, x ) ) : 0;
92 val.x = r * cos(
DEG2RAD( q / 10.0 ) );
93 val.y = r * sin(
DEG2RAD( q / 10.0 ) );
164 m_clearX->SetToolTip(
_(
"Reset to the current distance from the reference position." ) );
165 m_clearY->SetToolTip(
_(
"Reset to the current angle from the reference position." ) );
172 m_clearX->SetToolTip(
_(
"Reset to the current X offset from the reference position." ) );
173 m_clearY->SetToolTip(
_(
"Reset to the current Y offset from the reference position." ) );
180 wxObject* obj =
event.GetEventObject();
182 wxASSERT( posrelTool );
227 wxASSERT( posrelTool );
248 m_referenceInfo->SetLabel(
_(
"Reference location: local coordinates origin" ) );
254 wxString reference =
_(
"<none selected>" );
255 BOARD_ITEM* item = dynamic_cast<BOARD_ITEM*>( aItem );
272 wxRealPoint translation;
284 wxASSERT( posrelTool );
295 wxTextCtrl* obj = static_cast<wxTextCtrl*>( event.GetEventObject() );
297 if( obj->GetValue().IsEmpty() )
298 obj->SetValue(
"0" );
void UpdateAnchor(EDA_ITEM *aItem)
Functions for manipulating tab traversal in forms and dialogs.
void OnUseGridOriginClick(wxCommandEvent &event) override
wxPoint m_GridOrigin
origin for grid offsets
wxStaticText * m_referenceInfo
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
std::vector< wxWindow * > m_tabOrder
void OnOkClick(wxCommandEvent &event) override
Persistent dialog options.
double RAD2DEG(double rad)
DIALOG_POSITION_RELATIVE(PCB_BASE_FRAME *aParent, wxPoint &translation, wxPoint &anchor)
static TOOL_ACTION selectpositionRelativeItem
Selection of anchor item for position relative tool.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
virtual wxPoint GetPosition() const
void OnTextFocusLost(wxFocusEvent &event) override
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
void OnClear(wxCommandEvent &event) override
wxCheckBox * m_polarCoords
EDA_UNITS GetUserUnits() const
wxButton * m_stdButtonsCancel
void OnUseUserOriginClick(wxCommandEvent &event) override
void OnSelectItemClick(wxCommandEvent &event) override
bool Show(bool show) override
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
wxPoint & m_anchor_position
virtual void SetUnits(EDA_UNITS aUnits)
Normally not needed (as the UNIT_BINDER inherits from the parent frame), but can be used to set to DE...
void updateDialogControls(bool aPolar)
bool GetTranslationInIU(wxRealPoint &val, bool polar)
Get the (Cartesian) translation described by the text entries.
Class DIALOG_POSITION_RELATIVE_BASE.
void SetLabel(const wxString &aLabel)
double DEG2RAD(double deg)
Information pertinent to a Pcbnew printed circuit board.
void OnPolarChanged(wxCommandEvent &event) override
virtual wxString GetSelectMenuText(EDA_UNITS aUnits) const
Return the text to display to be used in the selection clarification context menu when multiple items...
virtual void SetValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
A base class for most all the KiCad significant classes used in schematics and boards.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
wxButton * m_stdButtonsOK
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Set the current origin transform mode.
virtual void SetDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual double GetDoubleValue()
Return the current value in Internal Units.
void ToPolarDeg(double x, double y, double &r, double &q)
Convert a given Cartesian point into a polar representation.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
VECTOR2D m_LocalOrigin
Relative Screen cursor coordinate (on grid) in user units.
static POSITION_RELATIVE_OPTIONS m_options