44 m_textWidth( aParent, m_SizeXLabel, m_SizeXCtrl, m_SizeXUnits ),
45 m_textHeight( aParent, m_SizeYLabel, m_SizeYCtrl, m_SizeYUnits ),
46 m_thickness( aParent, m_ThicknessLabel, m_ThicknessCtrl, m_ThicknessUnits ),
47 m_posX( aParent, m_PositionXLabel, m_PositionXCtrl, m_PositionXUnits ),
48 m_posY( aParent, m_PositionYLabel, m_PositionYCtrl, m_PositionYUnits ),
49 m_orientation( aParent, m_OrientLabel, m_OrientCtrl, nullptr )
76 [
this]( wxKeyEvent& aEvent )
78 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
81 [
this]( wxStyledTextEvent& aEvent )
84 [
this](
const wxString& crossRef, wxArrayString* tokens )
106 title =
_(
"Footprint Reference Properties" );
111 title =
_(
"Footprint Value Properties" );
120 title =
_(
"Footprint Field Properties" );
126 title =
_(
"Footprint Text Properties" );
154 title =
_(
"Text Properties" );
227 double rot_list[] = { 0.0, 90.0, -90.0, 180.0 };
229 for(
size_t ii = 0; ii <
m_OrientCtrl->GetCount() && ii < 4; ++ii )
230 m_OrientCtrl->SetString( ii, wxString::Format( wxT(
"%.1f" ), rot_list[ii] ) );
309 m_statusLine->SetLabel( wxString::Format(
_(
"Footprint %s (%s), %s, rotated %.1f deg"),
312 parentFP->
IsFlipped() ?
_(
"back side (mirrored)" )
361 return DIALOG_TEXT_PROPERTIES_BASE::TransferDataToWindow();
388 if( aEvent.IsChecked() )
401 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
411 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
429 if( !DIALOG_TEXT_PROPERTIES_BASE::TransferDataFromWindow() )
466 txt.Replace( wxT(
"\r" ), wxT(
"\n" ) );
467#elif defined( __WINDOWS__ )
470 txt.Replace( wxT(
"\r" ), wxT(
"" ) );
496 DisplayError(
this,
_(
"The text thickness is too large for the text size.\n"
497 "It will be clamped." ) );
528 commit.Push(
_(
"Change text properties" ) );
constexpr EDA_IU_SCALE pcbIUScale
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual void SetLocked(bool aLocked)
virtual bool IsKnockout() const
virtual void SetIsKnockout(bool aKnockout)
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
FOOTPRINT * GetParentFootprint() const
VECTOR2I GetFPRelativePosition() const
void SetFPRelativePosition(const VECTOR2I &aPos)
virtual bool IsLocked() const
Information pertinent to a Pcbnew printed circuit board.
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource) const
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
wxString ConvertKIIDsToCrossReferences(const wxString &aSource) const
std::vector< wxWindow * > m_tabOrder
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
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...
virtual void OnCharHook(wxKeyEvent &aEvt)
Class DIALOG_TEXT_PROPERTIES_BASE.
wxComboBox * m_OrientCtrl
wxTextCtrl * m_PositionXCtrl
wxStyledTextCtrl * m_MultiLineText
wxTextCtrl * m_PositionYCtrl
wxButton * m_sdbSizerCancel
BITMAP_BUTTON * m_alignRight
BITMAP_BUTTON * m_mirrored
wxStaticText * m_statusLine
wxTextCtrl * m_SingleLineText
wxCheckBox * m_KeepUpright
wxStaticText * m_PositionYLabel
wxBoxSizer * m_SingleLineSizer
BITMAP_BUTTON * m_valignCenter
wxBoxSizer * m_MultiLineSizer
wxTextCtrl * m_ThicknessCtrl
wxCheckBox * m_cbKnockout
BITMAP_BUTTON * m_valignTop
wxStaticText * m_TextLabel
BITMAP_BUTTON * m_alignLeft
BITMAP_BUTTON * m_alignCenter
BITMAP_BUTTON * m_separator1
PCB_LAYER_BOX_SELECTOR * m_LayerSelectionCtrl
BITMAP_BUTTON * m_separator2
BITMAP_BUTTON * m_separator3
wxStaticText * m_PositionXLabel
BITMAP_BUTTON * m_valignBottom
~DIALOG_TEXT_PROPERTIES()
virtual void OnSetFocusText(wxFocusEvent &event) override
Used to select the variant part of some text fields (for instance, the question mark or number in a r...
UNIT_BINDER m_orientation
bool TransferDataToWindow() override
DIALOG_TEXT_PROPERTIES(SCH_EDIT_FRAME *parent, SCH_ITEM *aTextItem)
void onMultiLineTCLostFocus(wxFocusEvent &event) override
SCINTILLA_TRICKS * m_scintillaTricks
void onFontSelected(wxCommandEvent &aEvent) override
void onBoldToggle(wxCommandEvent &aEvent) override
bool TransferDataFromWindow() override
void onThickness(wxCommandEvent &aEvent) override
void onValignButton(wxCommandEvent &aEvent) override
void onAlignButton(wxCommandEvent &aEvent) override
bool IsType(FRAME_T aType) const
EDA_ITEM_FLAGS GetEditFlags() const
void SetFlags(EDA_ITEM_FLAGS aMask)
KICAD_T Type() const
Returns the type of object.
void SetTextSize(VECTOR2I aNewSize)
const EDA_ANGLE & GetTextAngle() const
virtual const wxString & GetText() const
Return the string associated with the text object.
bool IsKeepUpright() const
virtual bool IsVisible() const
KIFONT::FONT * GetFont() const
void SetMirrored(bool isMirrored)
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
GR_TEXT_H_ALIGN_T GetHorizJustify() const
virtual void SetVisible(bool aVisible)
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
void SetKeepUpright(bool aKeepUpright)
GR_TEXT_V_ALIGN_T GetVertJustify() const
virtual void SetText(const wxString &aText)
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
int GetTextThickness() const
void SetItalic(bool aItalic)
void SetFont(KIFONT::FONT *aFont)
VECTOR2I GetTextSize() const
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
bool HaveFontSelection() const
void SetFontSelection(KIFONT::FONT *aFont)
KIFONT::FONT * GetFontSelection(bool aBold, bool aItalic) const
virtual bool IsStroke() const
int GetLayerSelection() const
int SetLayerSelection(int layer)
bool SetLayersHotkeys(bool value)
Common, abstract interface for edit frames.
void ShowTextPropertiesDialog(PCB_TEXT *aText)
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
void ShowNonActivatedLayers(bool aShow)
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
void DoTextVarAutocomplete(std::function< void(const wxString &crossRef, wxArrayString *tokens)> aTokenProvider)
void CancelAutocomplete()
virtual long long int GetValue()
Return the current value in Internal Units.
virtual void SetPrecision(int aLength)
Normally not needed, but can be used to set the precision when using internal units that are floats (...
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 void SetAngleValue(const EDA_ANGLE &aValue)
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Validate the control against the given range, informing the user of any errors found.
virtual void ChangeValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion WITHOUT trigger...
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void Show(bool aShow, bool aResize=false)
Show/hide the label, widget and units label.
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Set the current origin transform mode.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
This file is part of the common library.
const int minSize
Push and Shove router track width and via size dialog.
#define IN_EDIT
Item currently edited.
#define TEXT_MIN_SIZE_MILS
Minimum text size in mils.
#define TEXT_MAX_SIZE_MILS
Maximum text size in mils (10 inches)
int GetPenSizeForBold(int aTextSize)
int GetPenSizeForNormal(int aTextSize)
int Clamp_Text_PenSize(int aPenSize, int aSize, bool aStrict)
Pen width should not allow characters to become cluttered up in their own fatness.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
wxFont GetInfoFont(wxWindow *aWindow)
void SelectReferenceNumber(wxTextEntry *aTextEntry)
Select the number (or "?") in a reference for ease of editing.
wxString UnescapeString(const wxString &aSource)
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
constexpr int MilsToIU(int mils) const
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property