80 wxArrayString menuItems;
110 const double r =
m_moveX.GetDoubleValue();
119 val.x =
m_moveX.GetDoubleValue();
120 val.y =
m_moveY.GetDoubleValue();
131 double moveX =
m_moveX.GetDoubleValue();
132 double moveY =
m_moveY.GetDoubleValue();
181 m_moveX.SetLabel(
_(
"Distance:" ) );
198 wxObject* obj =
event.GetEventObject();
234 wxRealPoint translation;
247 wxTextCtrl* obj =
static_cast<wxTextCtrl*
>(
event.GetEventObject() );
249 if( obj->GetValue().IsEmpty() )
250 obj->SetValue(
"0" );
258 double delta_x =
m_moveX.GetDoubleValue();
259 double delta_y =
m_moveY.GetDoubleValue();
260 double max_border = std::numeric_limits<int>::max() * M_SQRT1_2;
262 if(
m_bbox.GetLeft() + delta_x < -max_border ||
263 m_bbox.GetRight() + delta_x > max_border ||
264 m_bbox.GetTop() + delta_y < -max_border ||
265 m_bbox.GetBottom() + delta_y > max_border )
267 const wxString invalid_length =
_(
"Invalid movement values. Movement would place selection "
268 "outside of the maximum board area." );
270 m_xEntry->SetToolTip( invalid_length );
271 m_xEntry->SetForegroundColour( *wxRED );
272 m_yEntry->SetToolTip( invalid_length );
273 m_yEntry->SetForegroundColour( *wxRED );
279 m_xEntry->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ) );
281 m_yEntry->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ) );
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
DIALOG_MOVE_EXACT_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Move Item"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxChoice * m_anchorOptions
wxButton * m_stdButtonsCancel
wxStaticText * m_rotLabel
wxStdDialogButtonSizer * m_stdButtons
wxButton * m_stdButtonsOK
wxCheckBox * m_polarCoords
void buildRotationAnchorMenu()
bool TransferDataToWindow() override
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.
@ ROTATE_AROUND_USER_ORIGIN
@ ROTATE_AROUND_SEL_CENTER
@ ROTATE_AROUND_AUX_ORIGIN
@ ROTATE_AROUND_ITEM_ANCHOR
static constexpr EDA_ANGLE ANGLE_0
Functions for manipulating tab traversal in forms and dialogs.
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D