38 m_toolMgr( aParent->GetToolManager() ),
39 m_xOffset( aParent, m_xLabel, m_xEntry, m_xUnit ),
40 m_yOffset( aParent, m_yLabel, m_yEntry, m_yUnit ),
162 m_clearX->SetToolTip(
_(
"Reset to the current distance from the reference position." ) );
163 m_clearY->SetToolTip(
_(
"Reset to the current angle from the reference position." ) );
170 m_clearX->SetToolTip(
_(
"Reset to the current X offset from the reference position." ) );
171 m_clearY->SetToolTip(
_(
"Reset to the current Y offset from the reference position." ) );
178 wxObject* obj =
event.GetEventObject();
180 wxASSERT( posrelTool );
217 wxASSERT( posrelTool );
229 wxASSERT( posrelTool );
245 m_referenceInfo->SetLabel(
_(
"Reference location: local coordinates origin" ) );
251 wxString msg =
_(
"<none selected>" );
256 m_referenceInfo->SetLabel( wxString::Format(
_(
"Reference item: %s" ), msg ) );
262 _(
"Reference location: selected point (%s, %s)" ),
357 wxTextCtrl* obj =
static_cast<wxTextCtrl*
>(
event.GetEventObject() );
359 if( obj->GetValue().IsEmpty() )
360 obj->SetValue(
"0" );
constexpr EDA_IU_SCALE pcbIUScale
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Information pertinent to a Pcbnew printed circuit board.
Class DIALOG_POSITION_RELATIVE_BASE.
wxStaticText * m_referenceInfo
wxButton * m_stdButtonsOK
wxCheckBox * m_polarCoords
wxButton * m_stdButtonsCancel
bool getTranslationInIU(VECTOR2I &val, bool polar)
Get the (Cartesian) translation described by the text entries.
void OnUseGridOriginClick(wxCommandEvent &event) override
void OnPolarChanged(wxCommandEvent &event) override
void OnOkClick(wxCommandEvent &event) override
void updateDialogControls(bool aPolar)
void updateAnchorInfo(BOARD_ITEM *aItem)
void OnClear(wxCommandEvent &event) override
static POSITION_RELATIVE_OPTIONS m_options
void OnSelectItemClick(wxCommandEvent &event) override
void OnSelectPointClick(wxCommandEvent &event) override
void UpdateAnchor(EDA_ITEM *aItem)
VECTOR2I m_anchorItemPosition
void OnTextFocusLost(wxFocusEvent &event) override
Reset a text field to be 0 if it was exited while blank.
void OnUseUserOriginClick(wxCommandEvent &event) override
void ToPolarDeg(double x, double y, double &r, EDA_ANGLE &q)
Convert a given Cartesian point into a polar representation.
DIALOG_POSITION_RELATIVE(PCB_BASE_FRAME *aParent)
std::vector< wxWindow * > m_tabOrder
bool Show(bool show) override
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
EDA_BASE_FRAME * m_parentFrame
EDA_UNITS GetUserUnits() const
A base class for most all the KiCad significant classes used in schematics and boards.
virtual VECTOR2I GetPosition() const
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const
Return a user-visible description string of this item.
bool IsBOARD_ITEM() const
static TOOL_ACTION selectPositionRelativePoint
static TOOL_ACTION selectPositionRelativeItem
Selection of anchor item for position relative tool.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
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...
virtual EDA_ANGLE GetAngleValue()
virtual double GetDoubleValue()
Return the current value in Internal Units.
virtual void SetAngleValue(const EDA_ANGLE &aValue)
void SetLabel(const wxString &aLabel)
virtual void SetDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Set the current origin transform mode.
static constexpr EDA_ANGLE ANGLE_0
Functions for manipulating tab traversal in forms and dialogs.
constexpr ret_type KiROUND(fp_type v, bool aQuiet=false)
Round a floating point number to an integer using "round halfway cases away from zero".
VECTOR2< double > VECTOR2D