37 const BOX2I& aBbox ) :
39 m_translation( aTranslate ),
40 m_rotation( aRotate ),
41 m_rotationAnchor( aAnchor ),
43 m_moveX( aParent, m_xLabel, m_xEntry, m_xUnit ),
44 m_moveY( aParent, m_yLabel, m_yEntry, m_yUnit ),
45 m_rotate( aParent, m_rotLabel, m_rotEntry, m_rotUnit ),
97 wxArrayString menuItems;
104 menuItems.push_back(
_(
"Rotate around item anchor" ) );
107 menuItems.push_back(
_(
"Rotate around selection center" ) );
110 menuItems.push_back(
_(
"Rotate around local coordinates origin" ) );
113 menuItems.push_back(
_(
"Rotate around drill/place origin" ) );
223 wxObject* obj =
event.GetEventObject();
246 wxRealPoint translation;
266 wxTextCtrl* obj =
static_cast<wxTextCtrl*
>(
event.GetEventObject() );
268 if( obj->GetValue().IsEmpty() )
269 obj->SetValue(
"0" );
279 double max_border = std::numeric_limits<int>::max() * M_SQRT1_2;
286 const wxString invalid_length =
_(
"Invalid movement values. Movement would place selection "
287 "outside of the maximum board area." );
289 m_xEntry->SetToolTip( invalid_length );
290 m_xEntry->SetForegroundColour( *wxRED );
291 m_yEntry->SetToolTip( invalid_length );
292 m_yEntry->SetForegroundColour( *wxRED );
298 m_xEntry->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ) );
300 m_yEntry->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ) );
coord_type GetTop() const
coord_type GetRight() const
coord_type GetLeft() const
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.
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
VECTOR2< double > VECTOR2D