27 #include <wx/msgdlg.h> 37 m_cbLayerActual( m_cbLayer ),
38 m_txtValueActual( m_txtValue ),
39 m_textWidth( aParent, m_lblTextWidth, m_txtTextWidth, m_lblTextWidthUnits ),
40 m_textHeight( aParent, m_lblTextHeight, m_txtTextHeight, m_lblTextHeightUnits ),
41 m_textThickness( aParent, m_lblTextThickness, m_txtTextThickness, m_lblTextThicknessUnits ),
42 m_textPosX( aParent, m_lblTextPosX, m_txtTextPosX, m_lblTextPosXUnits ),
43 m_textPosY( aParent, m_lblTextPosY, m_txtTextPosY, m_lblTextPosYUnits ),
44 m_orientValidator( 1, &m_orientValue ),
45 m_lineThickness( aParent, m_lblLineThickness, m_txtLineThickness, m_lblLineThicknessUnits ),
46 m_arrowLength( aParent, m_lblArrowLength, m_txtArrowLength, m_lblArrowLengthUnits ),
47 m_extensionOffset( aParent, m_lblExtensionOffset, m_txtExtensionOffset, m_lblExtensionOffsetUnits )
50 m_dimension = static_cast<PCB_DIMENSION_BASE*>( aItem );
116 item.Replace(
'.', localeconv()->decimal_point[0] );
123 [&]( wxCommandEvent& evt )
131 auto updateEventHandler =
132 [&]( wxCommandEvent& evt )
141 m_txtValue->Bind( wxEVT_TEXT, updateEventHandler );
142 m_txtPrefix->Bind( wxEVT_TEXT, updateEventHandler );
143 m_txtSuffix->Bind( wxEVT_TEXT, updateEventHandler );
145 m_cbUnits->Bind( wxEVT_CHOICE, updateEventHandler );
151 [&]( wxCommandEvent& aEvt )
161 [&]( wxCommandEvent& aEvt )
199 wxMessageBox(
_(
"This item was on a non-existing or forbidden layer.\n" 200 "It has been moved to the first allowed layer." ) );
254 return DIALOG_DIMENSION_PROPERTIES_BASE::TransferDataToWindow();
260 if( !DIALOG_DIMENSION_PROPERTIES_BASE::TransferDataFromWindow() )
280 commit.
Push(
_(
"Change dimension properties" ) );
336 text.SetPosition( pos );
348 text.SetHorizJustify( static_cast<EDA_TEXT_HJUSTIFY_T>( justification ) );
bool GetKeepTextAligned() const
DIM_UNITS_FORMAT GetUnitsFormat() const
void SetUnits(EDA_UNITS aUnits)
DIM_TEXT_POSITION
Where to place the text on a dimension.
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
wxChoice * m_cbTextPositionMode
Class DIALOG_DIMENSION_PROPERTIES_BASE.
class PCB_DIM_LEADER, a leader dimension (graphic item)
wxTextCtrl * m_txtTextPosY
wxString GetValueText() const
wxStaticText * m_lblArrowLength
void SetUnitsFormat(const DIM_UNITS_FORMAT aFormat)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
void SetOverrideText(const wxString &aValue)
void SetKeepTextAligned(bool aKeepAligned)
int GetExtensionOffset() const
constexpr KICAD_T BaseType(const KICAD_T aType)
Return the underlying type of the given type.
class PCB_DIM_CENTER, a center point marking (graphic item)
wxCheckBox * m_cbSuppressZeroes
wxCheckBox * m_cbKeepAligned
void SetFlags(EDA_ITEM_FLAGS aMask)
wxTextCtrl * m_txtExtensionOffset
bool GetOverrideTextEnabled() const
wxTextCtrl * m_txtValueActual
wxStaticBoxSizer * m_sizerCenter
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
wxFloatingPointValidator< double > m_orientValidator
wxStaticBoxSizer * m_sizerText
PCB_LAYER_BOX_SELECTOR * m_cbLayerActual
void SetSuppressZeroes(bool aSuppress)
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
void SetExtensionOffset(int aOffset)
PCB_DIMENSION_BASE * m_dimension
wxStaticText * m_staticTextPreview
UNIT_BINDER m_extensionOffset
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
void SetLineThickness(int aWidth)
DIM_UNITS_MODE GetUnitsMode() const
wxTextCtrl * m_txtLeaderValue
wxStaticBoxSizer * m_sizerFormat
wxString GetPrefix() const
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
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
DIM_TEXT_FRAME GetTextFrame() const
wxStaticBoxSizer * m_sizerLeader
void SetOverrideTextEnabled(bool aOverride)
wxStaticText * m_lblTextPositionMode
wxChoice * m_cbJustification
int GetArrowLength() const
wxString GetSuffix() const
wxComboBox * m_cbTextOrientation
~DIALOG_DIMENSION_PROPERTIES()
void ShowNonActivatedLayers(bool aShow)
bool GetSuppressZeroes() const
void SetParent(EDA_ITEM *aParent) override
void SetPrefix(const wxString &aPrefix)
PCB_DIMENSION_BASE * m_previewDimension
UNIT_BINDER m_textThickness
void SetArrowLength(int aLength)
int SetLayerSelection(LAYER_NUM layer)
bool TransferDataFromWindow() override
void SetSuffix(const wxString &aSuffix)
PCB_LAYER_BOX_SELECTOR * m_cbCenterLayer
EDA_ITEM_FLAGS GetEditFlags() const
void SetPrecision(int aPrecision)
bool SetLayersHotkeys(bool value)
wxCheckBox * m_cbMirrored
class PCB_DIMENSION_BASE: abstract dimension meta-type
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.
Information pertinent to a Pcbnew printed circuit board.
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.
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource) const
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
wxCheckBox * m_cbOverrideValue
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.
void SetTextFrame(DIM_TEXT_FRAME aFrame)
wxString ConvertKIIDsToCrossReferences(const wxString &aSource) const
A leader is a dimension-like object pointing to a specific point.
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Set the current origin transform mode.
#define IN_EDIT
Item currently edited.
UNIT_BINDER m_arrowLength
Text placement is manually set by the user.
void SetUnitsMode(DIM_UNITS_MODE aMode)
DIM_TEXT_POSITION GetTextPositionMode() const
wxStaticText * m_lblArrowLengthUnits
PCB_LAYER_BOX_SELECTOR * m_cbLeaderLayer
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
int GetLineThickness() const
wxChoice * m_cbUnitsFormat
void updateDimensionFromDialog(PCB_DIMENSION_BASE *aTarget)
wxString GetOverrideText() const
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
wxStaticText * m_lblExtensionOffset
void SetTextPositionMode(DIM_TEXT_POSITION aMode)
bool TransferDataToWindow() override
KICAD_T Type() const
Returns the type of object.
wxTextCtrl * m_txtTextPosX
void Update()
Update the dimension's cached text and geometry.