42 m_textBox( aTextBox ),
43 m_textWidth( aParent, m_SizeXLabel, m_SizeXCtrl, m_SizeXUnits ),
44 m_textHeight( aParent, m_SizeYLabel, m_SizeYCtrl, m_SizeYUnits ),
45 m_thickness( aParent, m_ThicknessLabel, m_ThicknessCtrl, m_ThicknessUnits ),
46 m_orientation( aParent, m_OrientLabel, m_OrientCtrl, nullptr ),
47 m_borderWidth( aParent, m_borderWidthLabel, m_borderWidthCtrl, m_borderWidthUnits )
55 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
58 [
this]( wxStyledTextEvent& aEvent )
61 [
this](
const wxString& crossRef, wxArrayString* tokens )
117 double rot_list[] = { 0.0, 90.0, -90.0, 180.0 };
119 for(
size_t ii = 0; ii <
m_OrientCtrl->GetCount() && ii < 4; ++ii )
120 m_OrientCtrl->SetString( ii, wxString::Format(
"%.1f", rot_list[ii] ) );
122 for(
const std::pair<const PLOT_DASH_TYPE, lineTypeStruct>& typeEntry :
lineTypeNames )
199 if( style == PLOT_DASH_TYPE::DEFAULT )
200 style = PLOT_DASH_TYPE::SOLID;
209 return DIALOG_TEXTBOX_PROPERTIES_BASE::TransferDataToWindow();
236 if( aEvent.IsChecked() )
249 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
283 if( !DIALOG_TEXTBOX_PROPERTIES_BASE::TransferDataFromWindow() )
310 txt.Replace(
"\r",
"\n" );
311#elif defined( __WINDOWS__ )
314 txt.Replace(
"\r",
"" );
335 DisplayError(
this,
_(
"The text thickness is too large for the text size.\n"
336 "It will be clamped." ) );
379 commit.
Push(
_(
"Change text box properties" ) );
constexpr EDA_IU_SCALE pcbIUScale
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 void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
Container for design settings for a BOARD object.
int GetLineThickness(PCB_LAYER_ID aLayer) const
Return the default graphic segment thickness from the layer class for the given layer.
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual void SetLocked(bool aLocked)
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
FOOTPRINT * GetParentFootprint() const
virtual bool IsLocked() const
Information pertinent to a Pcbnew printed circuit board.
bool IsLayerEnabled(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
wxString ConvertCrossReferencesToKIIDs(const wxString &aSource) const
Convert cross-references back and forth between ${refDes:field} and ${kiid:field}.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
wxString ConvertKIIDsToCrossReferences(const wxString &aSource) const
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
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_TEXTBOX_PROPERTIES_BASE.
BITMAP_BUTTON * m_separator3
wxStaticText * m_borderStyleLabel
BITMAP_BUTTON * m_mirrored
BITMAP_BUTTON * m_alignCenter
BITMAP_BUTTON * m_separator1
wxBitmapComboBox * m_borderStyleCombo
BITMAP_BUTTON * m_alignRight
wxCheckBox * m_borderCheckbox
BITMAP_BUTTON * m_alignLeft
wxComboBox * m_OrientCtrl
BITMAP_BUTTON * m_separator0
wxStyledTextCtrl * m_MultiLineText
PCB_LAYER_BOX_SELECTOR * m_LayerSelectionCtrl
BITMAP_BUTTON * m_separator2
~DIALOG_TEXTBOX_PROPERTIES()
void onAlignButton(wxCommandEvent &aEvent) override
void onThickness(wxCommandEvent &aEvent) override
UNIT_BINDER m_borderWidth
bool TransferDataToWindow() override
void onBoldToggle(wxCommandEvent &aEvent) override
DIALOG_TEXTBOX_PROPERTIES(PCB_BASE_EDIT_FRAME *aParent, PCB_TEXTBOX *aTextBox)
bool TransferDataFromWindow() override
void onMultiLineTCLostFocus(wxFocusEvent &event) override
void onFontSelected(wxCommandEvent &aEvent) override
void onBorderChecked(wxCommandEvent &event) override
SCINTILLA_TRICKS * m_scintillaTricks
UNIT_BINDER m_orientation
PCB_BASE_EDIT_FRAME * m_frame
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.
KIFONT::FONT * GetFont() const
void SetMirrored(bool isMirrored)
GR_TEXT_H_ALIGN_T GetHorizJustify() const
virtual void ClearBoundingBoxCache()
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
virtual void ClearRenderCache()
void SetTextSize(const VECTOR2I &aNewSize)
virtual void SetText(const wxString &aText)
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.
int ShowTextBoxPropertiesDialog(PCB_TEXTBOX *aTextBox)
void GetContextualTextVars(BOARD_ITEM *aSourceItem, const wxString &aCrossRef, wxArrayString *aTokens)
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
void ShowNonActivatedLayers(bool aShow)
STROKE_PARAMS GetStroke() const override
void SetStroke(const STROKE_PARAMS &aStroke) override
void SetTextAngle(const EDA_ANGLE &aAngle) override
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()
Simple container to manage line stroke parameters.
void SetWidth(int aWidth)
PLOT_DASH_TYPE GetPlotStyle() const
void SetPlotStyle(PLOT_DASH_TYPE aPlotStyle)
virtual long long int GetValue()
Return the current value in Internal Units.
void Enable(bool aEnable)
Enable/disable the label, widget and units label.
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()
bool IsIndeterminate() const
Return true if the control holds the indeterminate value (for instance, if it represents a multiple s...
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 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)
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:...
PLOT_DASH_TYPE
Dashed line types.
const std::map< PLOT_DASH_TYPE, struct lineTypeStruct > lineTypeNames
constexpr int MilsToIU(int mils) const