26#include <wx/hyperlink.h>
66 [
this]( wxKeyEvent& aEvent )
68 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
71 [
this]( wxStyledTextEvent& aEvent )
75 [
this](
const wxString& xRef, wxArrayString* tokens )
87 m_syntaxHelp =
new wxHyperlinkCtrl(
this, wxID_ANY,
_(
"Syntax help" ), wxEmptyString, wxDefaultPosition,
88 wxDefaultSize, wxHL_DEFAULT_STYLE );
106 m_bold->SetIsCheckButton();
153 double rot_list[] = { 0.0, 90.0, -90.0, 180.0 };
155 for(
size_t ii = 0; ii <
m_OrientCtrl->GetCount() && ii < 4; ++ii )
156 m_OrientCtrl->SetString( ii, wxString::Format(
"%.1f", rot_list[ii] ) );
158 for(
const auto& [lineStyle, lineStyleDesc] :
lineTypeNames )
264 return DIALOG_TEXTBOX_PROPERTIES_BASE::TransferDataToWindow();
271 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
299 if( aEvent.IsChecked() )
312 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
348 if( aEvent.IsChecked() )
352 wxCommandEvent
dummy;
382 if( !DIALOG_TEXTBOX_PROPERTIES_BASE::TransferDataFromWindow() )
396 bool pushCommit = (
m_textBox->GetEditFlags() == 0 );
409 txt.Replace(
"\r",
"\n" );
410#elif defined( __WINDOWS__ )
413 txt.Replace(
"\r",
"" );
438 if(
m_textBox->GetTextThickness() > maxPenWidth )
440 DisplayError(
this,
_(
"The text thickness is too large for the text size.\n"
441 "It will be clamped." ) );
442 m_textBox->SetTextThickness( maxPenWidth );
486 commit.
Push(
_(
"Edit Text Box Properties" ) );
constexpr EDA_IU_SCALE pcbIUScale
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
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.
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
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
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)
BITMAP_BUTTON * m_hAlignRight
wxStaticText * m_SizeYLabel
wxStaticText * m_ThicknessLabel
BITMAP_BUTTON * m_separator3
wxStaticText * m_borderStyleLabel
wxStaticText * m_SizeXUnits
BITMAP_BUTTON * m_mirrored
wxBoxSizer * m_MultiLineSizer
wxTextCtrl * m_ThicknessCtrl
BITMAP_BUTTON * m_separator4
BITMAP_BUTTON * m_separator1
DIALOG_TEXTBOX_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Text Box Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU)
wxBitmapComboBox * m_borderStyleCombo
wxStaticText * m_SizeXLabel
wxStaticText * m_SizeYUnits
wxCheckBox * m_borderCheckbox
wxStaticText * m_borderWidthLabel
BITMAP_BUTTON * m_vAlignTop
BITMAP_BUTTON * m_hAlignLeft
wxStaticText * m_ThicknessUnits
wxStaticText * m_OrientLabel
wxStaticText * m_borderWidthUnits
BITMAP_BUTTON * m_autoTextThickness
wxComboBox * m_OrientCtrl
BITMAP_BUTTON * m_vAlignBottom
BITMAP_BUTTON * m_separator0
wxTextCtrl * m_borderWidthCtrl
wxStyledTextCtrl * m_MultiLineText
PCB_LAYER_BOX_SELECTOR * m_LayerSelectionCtrl
BITMAP_BUTTON * m_vAlignCenter
BITMAP_BUTTON * m_hAlignCenter
BITMAP_BUTTON * m_separator2
HTML_MESSAGE_BOX * m_helpWindow
~DIALOG_TEXTBOX_PROPERTIES()
void onHalignButton(wxCommandEvent &aEvent) override
void onTextSize(wxCommandEvent &aEvent) override
void onThickness(wxCommandEvent &aEvent) override
UNIT_BINDER m_borderWidth
bool TransferDataToWindow() override
void onBoldToggle(wxCommandEvent &aEvent) override
void onAutoTextThickness(wxCommandEvent &aEvent) override
DIALOG_TEXTBOX_PROPERTIES(PCB_BASE_EDIT_FRAME *aParent, PCB_TEXTBOX *aTextBox)
bool TransferDataFromWindow() override
void onMultiLineTCLostFocus(wxFocusEvent &event) override
wxHyperlinkCtrl * m_syntaxHelp
void onSyntaxHelp(wxHyperlinkEvent &aEvent)
void onFontSelected(wxCommandEvent &aEvent) override
void onValignButton(wxCommandEvent &aEvent) override
void onBorderChecked(wxCommandEvent &event) override
SCINTILLA_TRICKS * m_scintillaTricks
UNIT_BINDER m_orientation
PCB_BASE_EDIT_FRAME * m_frame
virtual bool IsStroke() const
Common, abstract interface for edit frames.
int ShowTextBoxPropertiesDialog(PCB_TEXTBOX *aTextBox)
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
Display a syntax help window for text variables and expressions.
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
Simple container to manage line stroke parameters.
void SetLineStyle(LINE_STYLE aLineStyle)
void SetWidth(int aWidth)
LINE_STYLE GetLineStyle() const
void DisplayError(wxWindow *aParent, const wxString &aText)
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_MM
Minimum text size (1 micron).
#define TEXT_MAX_SIZE_MM
Maximum text size in mm (~10 inches)
int GetPenSizeForBold(int aTextSize)
int GetPenSizeForNormal(int aTextSize)
int ClampTextPenSize(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)
std::vector< FAB_LAYER_COLOR > dummy
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:...
const std::map< LINE_STYLE, struct LINE_STYLE_DESC > lineTypeNames
Conversion map between LINE_STYLE values and style names displayed.
LINE_STYLE
Dashed line types.
@ GR_TEXT_H_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_INDETERMINATE
VECTOR2< int32_t > VECTOR2I