38 const BOX2I& aBbox ) :
40 m_translation( aTranslate ),
41 m_rotation( aRotate ),
42 m_rotationAnchor( aAnchor ),
44 m_moveX( aParent, m_xLabel, m_xEntry, m_xUnit ),
45 m_moveY( aParent, m_yLabel, m_yEntry, m_yUnit ),
46 m_rotate( aParent, m_rotLabel, m_rotEntry, m_rotUnit ),
98 wxArrayString menuItems;
105 menuItems.push_back(
_(
"Rotate around item anchor" ) );
108 menuItems.push_back(
_(
"Rotate around selection center" ) );
111 menuItems.push_back(
_(
"Rotate around local coordinates origin" ) );
114 menuItems.push_back(
_(
"Rotate around drill/place origin" ) );
224 wxObject* obj =
event.GetEventObject();
247 wxRealPoint translation;
267 wxTextCtrl* obj =
static_cast<wxTextCtrl*
>(
event.GetEventObject() );
269 if( obj->GetValue().IsEmpty() )
270 obj->SetValue(
"0" );
280 double max_border = std::numeric_limits<int>::max() * M_SQRT1_2;
287 const wxString invalid_length =
_(
"Invalid movement values. Movement would place selection "
288 "outside of the maximum board area." );
290 m_xEntry->SetToolTip( invalid_length );
291 m_xEntry->SetForegroundColour( *wxRED );
292 m_yEntry->SetToolTip( invalid_length );
293 m_yEntry->SetForegroundColour( *wxRED );
299 m_xEntry->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ) );
301 m_yEntry->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ) );
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
constexpr coord_type GetLeft() const
constexpr coord_type GetRight() const
constexpr coord_type GetTop() const
constexpr coord_type GetBottom() const
Class DIALOG_MOVE_EXACT_BASE.
wxChoice * m_anchorOptions
wxButton * m_stdButtonsCancel
wxStdDialogButtonSizer * m_stdButtons
wxButton * m_stdButtonsOK
wxCheckBox * m_polarCoords
void buildRotationAnchorMenu()
static MOVE_EXACT_OPTIONS m_options
bool TransferDataFromWindow() override
ROTATION_ANCHOR & m_rotationAnchor
void ToPolarDeg(double x, double y, double &r, EDA_ANGLE &q)
Convert a given Cartesian point into a polar representation.
void updateDialogControls(bool aPolar)
void OnClear(wxCommandEvent &event) override
DIALOG_MOVE_EXACT(PCB_BASE_FRAME *aParent, VECTOR2I &aTranslate, EDA_ANGLE &aRotate, ROTATION_ANCHOR &aAnchor, const BOX2I &aBbox)
void OnTextFocusLost(wxFocusEvent &event) override
Reset a text field to be 0 if it was exited while blank.
void OnPolarChanged(wxCommandEvent &event) override
void OnTextChanged(wxCommandEvent &event) override
bool GetTranslationInIU(wxRealPoint &val, bool polar)
Get the (Cartesian) translation described by the text entries.
std::vector< ROTATION_ANCHOR > m_menuIDs
std::vector< wxWindow * > m_tabOrder
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_UNITS GetUserUnits() const
bool IsType(FRAME_T aType) const
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
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.
void RequireEval()
Force the binder to evaluate the text.
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.
@ ROTATE_AROUND_USER_ORIGIN
@ ROTATE_AROUND_SEL_CENTER
@ ROTATE_AROUND_AUX_ORIGIN
@ ROTATE_AROUND_ITEM_ANCHOR
static constexpr EDA_ANGLE ANGLE_0
Persistent dialog options.
size_t entryAnchorSelection
Functions for manipulating tab traversal in forms and dialogs.
VECTOR2< double > VECTOR2D