35 m_cbLayerActual( m_cbLayer ),
36 m_txtValueActual( m_txtValue ),
37 m_textWidth( aParent, m_lblTextWidth, m_txtTextWidth, m_lblTextWidthUnits, true ),
38 m_textHeight( aParent, m_lblTextHeight, m_txtTextHeight, m_lblTextHeightUnits, true ),
39 m_textThickness( aParent, m_lblTextThickness, m_txtTextThickness,
40 m_lblTextThicknessUnits, true ),
41 m_textPosX( aParent, m_lblTextPosX, m_txtTextPosX, m_lblTextPosXUnits ),
42 m_textPosY( aParent, m_lblTextPosY, m_txtTextPosY, m_lblTextPosYUnits ),
43 m_orientValidator( 1, &m_orientValue ),
44 m_lineThickness( aParent, m_lblLineThickness, m_txtLineThickness,
45 m_lblLineThicknessUnits, true ),
46 m_arrowLength( aParent, m_lblArrowLength, m_txtArrowLength, m_lblArrowLengthUnits, true ),
47 m_extensionOffset( aParent, m_lblExtensionOffset, m_txtExtensionOffset,
48 m_lblExtensionOffsetUnits )
51 m_dimension = static_cast<DIMENSION_BASE*>( aItem );
117 item.Replace(
'.', localeconv()->decimal_point[0] );
124 [&]( wxCommandEvent& evt )
132 auto updateEventHandler =
133 [&]( wxCommandEvent& evt )
142 m_txtValue->Bind( wxEVT_TEXT, updateEventHandler );
143 m_txtPrefix->Bind( wxEVT_TEXT, updateEventHandler );
144 m_txtSuffix->Bind( wxEVT_TEXT, updateEventHandler );
146 m_cbUnits->Bind( wxEVT_CHOICE, updateEventHandler );
152 [&]( wxCommandEvent& aEvt )
162 [&]( wxCommandEvent& aEvt )
200 wxMessageBox(
_(
"This item was on a non-existing or forbidden layer.\n" 201 "It has been moved to the first allowed layer." ) );
255 return DIALOG_DIMENSION_PROPERTIES_BASE::TransferDataToWindow();
261 if( !DIALOG_DIMENSION_PROPERTIES_BASE::TransferDataFromWindow() )
281 commit.
Push(
_(
"Change dimension properties" ) );
349 text.
SetHorizJustify( static_cast<EDA_TEXT_HJUSTIFY_T>( justification ) );
357 LEADER* leader = static_cast<LEADER*>( aTarget );
void SetMirrored(bool isMirrored)
bool GetSuppressZeroes() const
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
bool GetOverrideTextEnabled() const
wxChoice * m_cbTextPositionMode
Class DIALOG_DIMENSION_PROPERTIES_BASE.
class LEADER, a leader dimension (graphic item)
wxTextCtrl * m_txtTextPosY
DIM_UNITS_FORMAT GetUnitsFormat() const
void SetParent(EDA_ITEM *aParent) override
wxStaticText * m_lblArrowLength
virtual void SetPosition(const wxPoint &aPos) override
void SetTextFrame(DIM_TEXT_FRAME aFrame)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
DIM_UNITS_MODE GetUnitsMode() const
DIM_TEXT_FRAME GetTextFrame() const
void SetTextAngle(double aAngle) override
constexpr KICAD_T BaseType(const KICAD_T aType)
Returns the underlying type of the given type.
class CENTER_DIMENSION, a center point marking (graphic item)
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
void SetItalic(bool isItalic)
wxCheckBox * m_cbSuppressZeroes
wxCheckBox * m_cbKeepAligned
void SetUnitsFormat(const DIM_UNITS_FORMAT aFormat)
void SetPrefix(const wxString &aPrefix)
DIM_TEXT_POSITION GetTextPositionMode() const
wxTextCtrl * m_txtExtensionOffset
wxTextCtrl * m_txtValueActual
void SetUnits(EDA_UNITS aUnits)
wxString GetOverrideText() const
wxStaticBoxSizer * m_sizerCenter
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
wxFloatingPointValidator< double > m_orientValidator
void Update()
Updates the dimension's cached text and geometry.
wxStaticBoxSizer * m_sizerText
PCB_LAYER_BOX_SELECTOR * m_cbLayerActual
int GetTextThickness() const
wxString ConvertKIIDsToCrossReferences(const wxString &aSource)
bool IsLayerEnabled(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
wxStaticText * m_lblExtensionOffsetUnits
wxStaticText * m_staticTextPreview
UNIT_BINDER m_extensionOffset
void SetOverrideText(const wxString &aValue)
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
int GetLineThickness() const
wxTextCtrl * m_txtLeaderValue
wxStaticBoxSizer * m_sizerFormat
void SetSuppressZeroes(bool aSuppress)
LAYER_NUM GetLayerSelection() const
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
wxTextCtrl * m_txtArrowLength
UNIT_BINDER m_lineThickness
DIMENSION_BASE * m_previewDimension
wxStaticBoxSizer * m_sizerLeader
DIMENSION_BASE * m_dimension
wxString GetSuffix() const
wxStaticText * m_lblTextPositionMode
wxChoice * m_cbJustification
void SetFlags(STATUS_FLAGS aMask)
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
wxString GetPrefix() const
A leader is a dimension-like object pointing to a specific point.
STATUS_FLAGS GetEditFlags() const
wxComboBox * m_cbTextOrientation
~DIALOG_DIMENSION_PROPERTIES()
void ShowNonActivatedLayers(bool aShow)
const wxSize & GetTextSize() const
#define IN_EDIT
Item currently edited.
UNIT_BINDER m_textThickness
Text placement is manually set by the user.
int SetLayerSelection(LAYER_NUM layer)
bool TransferDataFromWindow() override
PCB_LAYER_BOX_SELECTOR * m_cbCenterLayer
void SetExtensionOffset(int aOffset)
void SetSuffix(const wxString &aSuffix)
bool SetLayersHotkeys(bool value)
wxCheckBox * m_cbMirrored
class DIMENSION_BASE: abstract dimension meta-type
void updateDimensionFromDialog(DIMENSION_BASE *aTarget)
void SetTextWidth(int aWidth)
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
double GetTextAngleDegrees() const
Common, abstract interface for edit frames.
Information pertinent to a Pcbnew printed circuit board.
void SetHorizJustify(EDA_TEXT_HJUSTIFY_T aType)
void SetPrecision(int aPrecision)
PCB_BASE_EDIT_FRAME * m_frame
virtual void SetValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
wxCheckBox * m_cbOverrideValue
void SetArrowLength(int aLength)
void SetTextHeight(int aHeight)
DIALOG_DIMENSION_PROPERTIES(PCB_BASE_EDIT_FRAME *aParent, BOARD_ITEM *aItem)
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true) override
Revert the commit by restoring the modified items state.
virtual long long int GetValue()
Return the current value in Internal Units.
DIM_TEXT_POSITION
Where to place the text on a dimension.
const wxPoint & GetTextPos() const
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
void SetOverrideTextEnabled(bool aOverride)
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Set the current origin transform mode.
void SetLineThickness(int aWidth)
UNIT_BINDER m_arrowLength
wxStaticText * m_lblArrowLengthUnits
void SetTextPositionMode(DIM_TEXT_POSITION aMode)
PCB_LAYER_BOX_SELECTOR * m_cbLeaderLayer
bool GetKeepTextAligned() const
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
int GetArrowLength() const
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource)
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
wxChoice * m_cbUnitsFormat
int GetExtensionOffset() const
void SetUnitsMode(DIM_UNITS_MODE aMode)
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
wxStaticText * m_lblExtensionOffset
void SetKeepTextAligned(bool aKeepAligned)
wxString GetValueText() const
bool TransferDataToWindow() override
KICAD_T Type() const
Returns the type of object.
wxTextCtrl * m_txtTextPosX