45 m_textWidth( aParent, m_SizeXLabel, m_SizeXCtrl, m_SizeXUnits ),
46 m_textHeight( aParent, m_SizeYLabel, m_SizeYCtrl, m_SizeYUnits ),
47 m_thickness( aParent, m_ThicknessLabel, m_ThicknessCtrl, m_ThicknessUnits ),
48 m_posX( aParent, m_PositionXLabel, m_PositionXCtrl, m_PositionXUnits ),
49 m_posY( aParent, m_PositionYLabel, m_PositionYCtrl, m_PositionYUnits ),
50 m_orientation( aParent, m_OrientLabel, m_OrientCtrl, nullptr )
64 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
67 [
this]( wxStyledTextEvent& aEvent )
70 [
this](
const wxString& crossRef, wxArrayString* tokens )
105 title =
_(
"Text Properties" );
163 double rot_list[] = { 0.0, 90.0, -90.0, 180.0 };
165 for(
size_t ii = 0; ii <
m_OrientCtrl->GetCount() && ii < 4; ++ii )
166 m_OrientCtrl->SetString( ii, wxString::Format( wxT(
"%.1f" ), rot_list[ii] ) );
245 m_statusLine->SetLabel( wxString::Format(
_(
"Footprint %s (%s), %s, rotated %.1f deg"),
248 parentFP->
IsFlipped() ?
_(
"back side (mirrored)" )
297 return DIALOG_TEXT_PROPERTIES_BASE::TransferDataToWindow();
324 if( aEvent.IsChecked() )
337 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
347 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
365 if( !DIALOG_TEXT_PROPERTIES_BASE::TransferDataFromWindow() )
402 txt.Replace( wxT(
"\r" ), wxT(
"\n" ) );
403#elif defined( __WINDOWS__ )
406 txt.Replace( wxT(
"\r" ), wxT(
"" ) );
432 DisplayError(
this,
_(
"The text thickness is too large for the text size.\n"
433 "It will be clamped." ) );
464 commit.Push(
_(
"Change text properties" ) );
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
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
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
wxStyledTextCtrl * m_MultiLineText
BITMAP_BUTTON * m_alignRight
BITMAP_BUTTON * m_mirrored
wxStaticText * m_statusLine
wxTextCtrl * m_SingleLineText
wxCheckBox * m_KeepUpright
wxBoxSizer * m_SingleLineSizer
BITMAP_BUTTON * m_valignCenter
wxBoxSizer * m_MultiLineSizer
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
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
EDA_ITEM_FLAGS GetEditFlags() const
void SetFlags(EDA_ITEM_FLAGS aMask)
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
void SetTextSize(const VECTOR2I &aNewSize)
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)
TEXT_TYPE GetType() const
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.
#define IN_EDIT
Item currently edited.
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.
#define TEXTS_MAX_SIZE
Maximum text size in internal units (10 inches)
#define TEXTS_MIN_SIZE
Minimum text size in internal units (1 mil)
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:...