35#include <wx/notebook.h>
73 return static_cast<int>(
m_boundFields[aIndex].m_Binder->GetValue() );
91 void bindFields(
size_t aFrom,
size_t aTo, std::function<
void()> aCb )
93 for(
size_t i = aFrom; i <= aTo; ++i )
96 [aCb]( wxCommandEvent& )
151 SetTitle( wxString::Format( GetTitle(),
m_item->GetFriendlyName() ) );
184 [
this]( wxCommandEvent& )
399 if( !DIALOG_GRID_ITEM_PROPERTIES_BASE::TransferDataFromWindow() )
406 long tickInterval = 0;
421 bool pushCommit = (
m_item->GetEditFlags() == 0 );
432 commit.
Push(
_(
"Edit Grid Item Properties" ) );
440 wxCHECK_RET( aGridItem, wxT(
"ShowGridItemPropertiesDialog() error: NULL item" ) );
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
wxTextCtrl * m_spacingYCtrl
wxGridBagSizer * m_gbsRectangleByCenterSize
wxStaticText * m_orientationLabel
wxPanel * m_rectangleByCorners
wxTextCtrl * m_priorityCtrl
wxCheckBox * m_affectsCursor
wxTextCtrl * m_spacingXCtrl
wxCheckBox * m_affectsPlacement
DIALOG_GRID_ITEM_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("%s Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxGridBagSizer * m_gbsPolarCenterRadius
wxPanel * m_rectangleByCenterSize
wxStaticText * m_spacingXLabel
wxNotebook * m_notebookGridDefs
wxStaticText * m_orientationUnits
wxTextCtrl * m_tickIntervalCtrl
wxStaticText * m_spacingXUnits
wxPanel * m_polarCenterRadius
wxGridBagSizer * m_gbsRectangleByCornerSize
wxStaticText * m_spacingYUnits
wxStaticText * m_spacingYLabel
wxTextCtrl * m_orientationCtrl
wxPanel * m_rectangleByCornerSize
wxGridBagSizer * m_gbsRectangleByCorners
wxChoice * m_gridTypeCtrl
wxCheckBox * m_affectsRouting
PCB_GRID_ITEM m_workingCopy
std::vector< BOUND_CONTROL > m_boundFields
void changeAngle(size_t aIndex, const EDA_ANGLE &aValue)
UNIT_BINDER m_orientation
void onCenterSizeChange()
void bindFields(size_t aFrom, size_t aTo, std::function< void()> aCb)
bool TransferDataFromWindow() override
EDA_ANGLE getAngle(size_t aIndex) const
bool TransferDataToWindow() override
DIALOG_GRID_ITEM_PROPERTIES(PCB_BASE_EDIT_FRAME *aParent, PCB_GRID_ITEM *aItem)
VECTOR2I toLocal(VECTOR2I aWorld) const
VECTOR2I toWorld(VECTOR2I aLocal) const
void saveSpacingToItem(PCB_GRID_TYPE aType)
void onGridType(wxCommandEvent &aEvent)
void updatePagesForType()
void onCornerSizeChange()
PCB_BASE_EDIT_FRAME * m_parent
void changeValue(size_t aIndex, int aValue)
int getInt(size_t aIndex) const
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...
Common, abstract interface for edit frames.
void ShowGridItemPropertiesDialog(PCB_GRID_ITEM *aGridItem)
The main frame for Pcbnew.
#define IN_EDIT
Item currently edited.
void AddXYPointToSizer(EDA_DRAW_FRAME &aFrame, wxGridBagSizer &aSizer, int row, int col, const wxString &aName, bool aRelative, std::vector< BOUND_CONTROL > &aBoundCtrls)
void AddFieldToSizer(EDA_DRAW_FRAME &aFrame, wxGridBagSizer &aSizer, int row, int col, const wxString &aName, ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType, bool aIsAngle, std::vector< BOUND_CONTROL > &aBoundCtrls)
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
VECTOR2< int32_t > VECTOR2I