48 m_currentItem( aTextItem ),
49 m_currentText( dynamic_cast<
EDA_TEXT*>( aTextItem ) ),
50 m_textSize( aParent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits ),
51 m_borderWidth( aParent, m_borderWidthLabel, m_borderWidthCtrl, m_borderWidthUnits ),
52 m_scintillaTricks( nullptr ),
53 m_helpWindow( nullptr )
60 SetTitle(
_(
"Text Box Properties" ) );
65 for(
const std::pair<const PLOT_DASH_TYPE, lineTypeStruct>& typeEntry :
lineTypeNames )
84 wxSizer* parentSizer =
m_vAlignTop->GetContainingSizer();
90 parentSizer->Layout();
109 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
112 [
this]( wxStyledTextEvent& aEvent )
115 [
this](
const wxString& crossRef, wxArrayString* tokens )
166 wxString sheetPageNum = sheet.GetPageNumber();
167 wxString sheetName = sheet.size() == 1 ?
_(
"<root sheet>" ) : sheet.Last()->GetName();
170 wxString::Format(
_(
"Page %s (%s)" ), sheetPageNum, sheetName ) );
206 wxArrayString* aTokens )
208 if( !aCrossRef.IsEmpty() )
216 for(
int jj = 0; jj < (int) refs.
GetCount(); jj++ )
238 aTokens->push_back( entry.first );
245 if( !wxDialog::TransferDataToWindow() )
303 wxFAIL_MSG(
"Line type not found in the type lookup map" );
393 if( aEvent.GetSelection() >= 0 )
405 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
415 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
425 if( btn->IsChecked() && btn != aEvent.GetEventObject() )
433 if( !wxDialog::TransferDataFromWindow() )
456 text.Replace(
"\r",
"\n" );
457#elif defined( __WINDOWS__ )
460 text.Replace(
"\r",
"" );
468 else if( !
text.IsEmpty() )
483 DisplayError(
this,
_(
"Invalid hyperlink destination. Please enter either a valid URL "
484 "(e.g. file:// or http(s)://) or \"#<page number>\" to create "
485 "a hyperlink to a page in this schematic." ) );
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Color settings are a bit different than most of the settings objects in that there can be more than o...
bool GetOverrideSchItemColors() const
COLOR4D GetColor(int aLayer) const
void SetSwatchColor(const KIGFX::COLOR4D &aColor, bool aSendEvent)
Set the current swatch color directly.
KIGFX::COLOR4D GetSwatchColor() const
void SetDefaultColor(const KIGFX::COLOR4D &aColor)
Sets the color that will be chosen with the "Reset to Default" button in the chooser.
void SetSwatchBackground(const KIGFX::COLOR4D &aBackground)
Set the swatch background color.
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...
Class DIALOG_TEXT_PROPERTIES_BASE.
wxBitmapComboBox * m_borderStyleCombo
wxCheckBox * m_borderCheckbox
COLOR_SWATCH * m_borderColorSwatch
wxStyledTextCtrl * m_textCtrl
BITMAP_BUTTON * m_separator5
BITMAP_BUTTON * m_hAlignCenter
BITMAP_BUTTON * m_vAlignTop
BITMAP_BUTTON * m_vAlignBottom
WX_COMBOBOX * m_hyperlinkCombo
BITMAP_BUTTON * m_hAlignLeft
BITMAP_BUTTON * m_vAlignCenter
wxCheckBox * m_filledCtrl
COLOR_SWATCH * m_textColorSwatch
wxPanel * m_panelFillColor
wxCheckBox * m_hyperlinkCb
wxPanel * m_panelBorderColor
wxStaticText * m_borderStyleLabel
wxStaticText * m_fillColorLabel
BITMAP_BUTTON * m_separator1
wxGridBagSizer * m_textEntrySizer
wxCheckBox * m_excludeFromSim
BITMAP_BUTTON * m_separator4
BITMAP_BUTTON * m_vertical
BITMAP_BUTTON * m_hAlignRight
BITMAP_BUTTON * m_separator2
BITMAP_BUTTON * m_separator3
wxStaticText * m_borderColorLabel
COLOR_SWATCH * m_fillColorSwatch
BITMAP_BUTTON * m_horizontal
~DIALOG_TEXT_PROPERTIES()
void onHyperlinkText(wxCommandEvent &aEvent) override
std::vector< wxString > m_pageNumbers
UNIT_BINDER m_borderWidth
bool TransferDataToWindow() override
DIALOG_TEXT_PROPERTIES(SCH_EDIT_FRAME *parent, SCH_ITEM *aTextItem)
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)
void onHyperlinkCombo(wxCommandEvent &aEvent) override
void getContextualTextVars(const wxString &aCrossRef, wxArrayString *aTokens)
bool TransferDataFromWindow() override
void onTextAngleButton(wxCommandEvent &aEvent)
void onHyperlinkChecked(wxCommandEvent &aEvent) override
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
EDA_ITEM_FLAGS GetEditFlags() const
KICAD_T Type() const
Returns the type of object.
void SetFillColor(const COLOR4D &aColor)
COLOR4D GetFillColor() const
void SetFillMode(FILL_T aFill)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
void SetTextColor(const COLOR4D &aColor)
COLOR4D GetTextColor() const
const EDA_ANGLE & GetTextAngle() const
virtual const wxString & GetText() const
Return the string associated with the text object.
KIFONT::FONT * GetFont() const
virtual bool HasHyperlink() const
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
wxString GetHyperlink() const
GR_TEXT_H_ALIGN_T GetHorizJustify() const
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
static bool ValidateHyperlink(const wxString &aURL)
Check if aURL is a valid hyperlink.
void SetHyperlink(wxString aLink)
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)
void SetItalic(bool aItalic)
void SetFont(KIFONT::FONT *aFont)
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
bool HaveFontSelection() const
void SetFontSelection(KIFONT::FONT *aFont)
KIFONT::FONT * GetFontSelection(bool aBold, bool aItalic) const
A color representation with 4 components: red, green, blue, alpha.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
virtual std::map< wxString, wxString > & GetTextVars() const
Holds all the data relating to one schematic.
SCH_SHEET_PATH & CurrentSheet() const override
wxString ConvertKIIDsToRefs(const wxString &aSource) const
SCH_SHEET_LIST GetSheets() const override
Builds and returns an updated schematic hierarchy TODO: can this be cached?
wxString ConvertRefsToKIIDs(const wxString &aSource) const
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
EESCHEMA_SETTINGS * eeconfig() const
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Returns a pointer to the active color theme settings.
Schematic editor (Eeschema) main window.
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag and update other data struc...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend, bool aDirtyConnectivity=true)
Create a copy of the current schematic item, and put it in the undo list.
SCHEMATIC & Schematic() const
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false, bool aUpdateRtree=false) override
Mark an item for refresh.
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual bool GetExcludeFromSim() const
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
virtual void SetExcludeFromSim(bool aExclude)
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
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void SortByPageNumbers(bool aUpdateVirtualPageNums=true)
Sort the list of sheets by page number.
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.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
Return the reference for the given sheet path.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this symbol.
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
virtual void SetTextSpinStyle(TEXT_SPIN_STYLE aSpinStyle)
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
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)
void SetColor(const KIGFX::COLOR4D &aColor)
KIGFX::COLOR4D GetColor() const
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 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 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 Append(const wxString &aText, const wxString &aMenuText=wxEmptyString)
void ShowMessage(const wxString &aMessage, int aFlags=wxICON_INFORMATION) override
Show the info bar with the provided message and icon.
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.
static constexpr EDA_ANGLE & ANGLE_HORIZONTAL
static constexpr EDA_ANGLE & ANGLE_VERTICAL
int GetPenSizeForBold(int aTextSize)
@ LAYER_SCHEMATIC_BACKGROUND
const std::map< PLOT_DASH_TYPE, struct lineTypeStruct > lineTypeNames
int default_line_thickness