60 SetTitle( _(
"Text Box Properties" ) );
62 m_borderColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
63 m_borderColorSwatch->SetSwatchBackground( schematicBackground );
65 for( const auto& [ lineStyle, lineStyleDesc ] : lineTypeNames )
66 m_borderStyleCombo->Append( lineStyleDesc.name, KiBitmapBundle( lineStyleDesc.bitmap ) );
68 m_fillColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
69 m_fillColorSwatch->SetSwatchBackground( schematicBackground );
71 if( m_frame->GetColorSettings()->GetOverrideSchItemColors() )
72 m_infoBar->ShowMessage( _(
"Note: individual item colors overridden in "
77 m_borderCheckbox->Show( false );
78 m_borderWidth.Show( false );
79 m_borderColorLabel->Show( false );
80 m_panelBorderColor->Show( false );
81 m_borderStyleLabel->Show( false );
82 m_borderStyleCombo->Show( false );
83 m_fillColorLabel->Show( false );
84 m_panelFillColor->Show( false );
85 m_filledCtrl->Show( false );
99 m_textCtrl->SetTechnology( wxSTC_TECHNOLOGY_DIRECTWRITE );
104 [
this]( wxKeyEvent& aEvent )
106 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
110 [
this]( wxStyledTextEvent& aEvent )
114 [
this](
const wxString& xRef, wxArrayString* tokens )
134 m_bold->SetIsCheckButton();
170 const SCHEMATIC& schematic = schematicEditor->Schematic();
174 wxString sheetPageNum = sheet.GetPageNumber();
175 wxString sheetName = sheet.size() == 1 ?
_(
"<root sheet>" )
176 : sheet.Last()->GetName();
179 wxString::Format(
_(
"Page %s (%s)" ),
225 wxArrayString* aTokens )
229 if( !aCrossRef.IsEmpty() )
238 for(
int jj = 0; jj < (int) refs.
GetCount(); jj++ )
261 for( std::pair<wxString, wxString> entry :
Prj().GetTextVars() )
262 aTokens->push_back( entry.first );
270 if( !wxDialog::TransferDataToWindow() )
280 text = schematic->ConvertKIIDsToRefs(
text );
327 int style =
static_cast<int>( textBox->
GetStroke().GetLineStyle() );
411 if( aEvent.GetSelection() >= 0 )
423 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
433 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
443 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
451 if( !wxDialog::TransferDataFromWindow() )
464 m_frame->GetCanvas()->Refresh();
470 text = schematic->ConvertRefsToKIIDs(
text );
474 text.Replace(
"\r",
"\n" );
475#elif defined( __WINDOWS__ )
478 text.Replace(
"\r",
"" );
486 else if( !
text.IsEmpty() )
516 DisplayError(
this,
_(
"Invalid hyperlink destination. Please enter either a valid URL "
517 "(e.g. file:// or http(s)://) or \"#<page number>\" to create "
518 "a hyperlink to a page in this schematic." ) );
589 if( !commit.
Empty() )
590 commit.
Push(
_(
"Edit Text Properties" ) );
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetColor(int aLayer) 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...
wxBitmapComboBox * m_borderStyleCombo
wxCheckBox * m_borderCheckbox
wxStaticText * m_borderWidthUnits
COLOR_SWATCH * m_borderColorSwatch
wxCheckBox * m_privateCheckbox
wxStyledTextCtrl * m_textCtrl
DIALOG_TEXT_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Text Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
BITMAP_BUTTON * m_separator5
BITMAP_BUTTON * m_hAlignCenter
BITMAP_BUTTON * m_vAlignTop
BITMAP_BUTTON * m_vAlignBottom
WX_COMBOBOX * m_hyperlinkCombo
wxFlexGridSizer * m_fgSymbolEditor
BITMAP_BUTTON * m_hAlignLeft
BITMAP_BUTTON * m_vAlignCenter
wxCheckBox * m_filledCtrl
COLOR_SWATCH * m_textColorSwatch
wxStaticText * m_textSizeUnits
wxTextCtrl * m_textSizeCtrl
wxCheckBox * m_hyperlinkCb
wxStaticText * m_borderStyleLabel
wxStaticText * m_fillColorLabel
wxStaticText * m_textSizeLabel
wxTextCtrl * m_borderWidthCtrl
wxStaticText * m_borderWidthLabel
BITMAP_BUTTON * m_separator1
wxGridBagSizer * m_textEntrySizer
wxCheckBox * m_excludeFromSim
BITMAP_BUTTON * m_separator4
BITMAP_BUTTON * m_vertical
BITMAP_BUTTON * m_hAlignRight
wxCheckBox * m_commonToAllBodyStyles
wxHyperlinkCtrl * m_syntaxHelp
BITMAP_BUTTON * m_separator2
BITMAP_BUTTON * m_separator3
wxStaticText * m_borderColorLabel
COLOR_SWATCH * m_fillColorSwatch
wxCheckBox * m_commonToAllUnits
BITMAP_BUTTON * m_horizontal
void onHyperlinkText(wxCommandEvent &aEvent) override
std::vector< wxString > m_pageNumbers
UNIT_BINDER m_borderWidth
bool TransferDataToWindow() override
~DIALOG_TEXT_PROPERTIES() override
HTML_MESSAGE_BOX * m_helpWindow
void onFillChecked(wxCommandEvent &aEvent) override
void onMultiLineTCLostFocus(wxFocusEvent &event) override
void onBorderChecked(wxCommandEvent &aEvent) override
SCINTILLA_TRICKS * m_scintillaTricks
void OnFormattingHelp(wxHyperlinkEvent &aEvent) override
void onVAlignButton(wxCommandEvent &aEvent)
void onHAlignButton(wxCommandEvent &aEvent)
DIALOG_TEXT_PROPERTIES(SCH_BASE_FRAME *parent, SCH_ITEM *aTextItem)
void onHyperlinkCombo(wxCommandEvent &aEvent) override
void getContextualTextVars(const wxString &aCrossRef, wxArrayString *aTokens)
bool TransferDataFromWindow() override
void onTextAngleButton(wxCommandEvent &aEvent)
void onHyperlinkChecked(wxCommandEvent &aEvent) override
KICAD_T Type() const
Returns the type of object.
void SetFillColor(const COLOR4D &aColor)
COLOR4D GetFillColor() const
virtual int GetWidth() const
void SetFillMode(FILL_T aFill)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
static bool ValidateHyperlink(const wxString &aURL)
Check if aURL is a valid hyperlink.
A color representation with 4 components: red, green, blue, alpha.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
Holds all the data relating to one schematic.
SCH_SHEET_LIST Hierarchy() const
Return the full schematic flattened hierarchical sheet list.
SCH_SHEET_PATH & CurrentSheet() const
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Execute the changes.
Schematic editor (Eeschema) main window.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
A helper to define a symbol's reference designator in a schematic.
const SCH_SHEET_PATH & GetSheetPath() const
SCH_SYMBOL * GetSymbol() const
void SetStroke(const STROKE_PARAMS &aStroke) override
STROKE_PARAMS GetStroke() const override
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanSymbols=false) const
Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this symbol.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
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)
void SetColor(const KIGFX::COLOR4D &aColor)
KIGFX::COLOR4D GetColor() const
The symbol library editor main window.
A base class for LIB_SYMBOL and SCH_SYMBOL.
virtual bool IsMultiUnit() const =0
virtual bool IsMultiBodyStyle() const =0
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
This file is part of the common library.
static constexpr EDA_ANGLE ANGLE_VERTICAL
static constexpr EDA_ANGLE ANGLE_HORIZONTAL
@ LAYER_SCHEMATIC_BACKGROUND
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
const std::map< LINE_STYLE, struct LINE_STYLE_DESC > lineTypeNames
Conversion map between LINE_STYLE values and style names displayed.
@ GR_TEXT_H_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_INDETERMINATE
VECTOR2< int32_t > VECTOR2I