48 m_textSize( aParent, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits, false ),
49 m_netNameValidator( true ),
50 m_scintillaTricks( nullptr ),
51 m_helpWindow( nullptr )
62 default:
SetTitle(
_(
"Text Properties" ) );
break;
114 wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
115 infoFont.SetSymbolicSize( wxFONTSIZE_X_SMALL );
130 int size = wxNORMAL_FONT->GetPointSize();
131 wxFont fixedFont( size, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL );
133 for(
size_t i = 0; i < wxSTC_STYLE_MAX; ++i )
160 if( !wxDialog::TransferDataToWindow() )
179 std::set<wxString> existingLabels;
182 for(
SCH_SCREEN* screen = allScreens.GetFirst(); screen; screen = allScreens.GetNext() )
186 auto textItem = static_cast<const SCH_TEXT*>( item );
191 wxArrayString existingLabelArray;
193 for(
const wxString& label : existingLabels )
194 existingLabelArray.push_back( label );
226 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
233 wxArrayString autocompleteTokens;
234 int text_pos = te->GetCurrentPos();
235 int start = te->WordStartPosition( text_pos,
true );
241 return pos >= 2 && te->GetCharAt( pos-2 ) ==
'$' && te->GetCharAt( pos-1 ) ==
'{';
245 if( start > 1 && te->GetCharAt( start-1 ) ==
':' )
247 int refStart = te->WordStartPosition( start-1,
true );
249 if( textVarRef( refStart ) )
251 partial = te->GetRange( start+1, text_pos );
253 wxString ref = te->GetRange( refStart, start-1 );
260 for(
size_t jj = 0; jj < refs.
GetCount(); jj++ )
262 if( refs[ jj ].GetSymbol()->GetRef( &refs[ jj ].GetSheetPath(),
true ) == ref )
264 refSymbol = refs[ jj ].GetSymbol();
273 else if( textVarRef( start ) )
275 partial = te->GetTextRange( start, text_pos );
284 for( std::pair<wxString, wxString> entry :
Prj().GetTextVars() )
285 autocompleteTokens.push_back( entry.first );
295 if( !wxDialog::TransferDataFromWindow() )
321 if( !text.IsEmpty() )
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void SetTitle(const wxString &aTitle) override
void SetShape(PINSHEETLABEL_SHAPE aShape)
wxComboBox * m_valueCombo
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanComponents=false) const
Add a SCH_REFERENCE object to aReferences for each component in the list of sheets.
wxTextEntry * m_activeTextEntry
int GetPenSizeForBold(int aTextSize)
Function GetPensizeForBold.
Holds all the data relating to one schematic A schematic may consist of one or more sheets (and one r...
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
Implementation of conversion functions that require both schematic and board internal units.
This file is part of the common library.
void onScintillaCharAdded(wxStyledTextEvent &aEvent)
Add cut/copy/paste, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
void DoAutocomplete(const wxString &aPartial, const wxArrayString &aTokens)
void SetItalic(bool isItalic)
void OnEnterKey(wxCommandEvent &aEvent) override
bool TransferDataToWindow() override
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
Schematic editor (Eeschema) main window.
void SetTextSize(const wxSize &aNewSize)
Class DIALOG_LABEL_EDITOR_BASE.
SCH_EDIT_FRAME * m_Parent
wxFlexGridSizer * m_textEntrySizer
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
wxRadioBox * m_TextOrient
DIALOG_LABEL_EDITOR(SCH_EDIT_FRAME *parent, SCH_TEXT *aTextItem)
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
void GetContextualTextVars(wxArrayString *aVars) const
Returns the set of contextual text variable tokens for this text item.
void OnFormattingHelp(wxHyperlinkEvent &aEvent) override
virtual void SetText(const wxString &aText)
wxString ConvertRefsToKIIDs(const wxString &aSource) const
wxStaticText * m_labelMultiLine
STATUS_FLAGS GetEditFlags() const
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
SCH_NETNAME_VALIDATOR m_netNameValidator
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
Definitions of control validators for schematic dialogs.
SCHEMATIC & Schematic() const
LABEL_SPIN_STYLE GetLabelSpinStyle() const
SCINTILLA_TRICKS * m_scintillaTricks
void UpdateIntersheetRefProps()
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this symbol.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
bool IsMultilineAllowed() const
bool TransferDataFromWindow() override
unsigned GetCount() const
wxString ConvertKIIDsToRefs(const wxString &aSource) const
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
SCH_SHEET_LIST GetSheets() const override
Builds and returns an updated schematic hierarchy TODO: can this be cached?
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
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.
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend)
Create a copy of the current schematic item, and put it in the undo list.
wxString UnescapeString(const wxString &aSource)
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
These Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which ar...
wxStaticText * m_labelSingleLine
virtual void SetValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
HTML_MESSAGE_BOX * m_helpWindow
virtual long long int GetValue()
Return the current value in Internal Units.
wxStyledTextCtrl * m_valueMultiLine
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
wxTextCtrl * m_valueSingleLine
virtual void SetLabelSpinStyle(LABEL_SPIN_STYLE aSpinStyle)
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
SCH_SHEET_PATH & CurrentSheet() const override
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual const wxString & GetText() const
Return the string associated with the text object.
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
wxWindow * m_activeTextCtrl
PINSHEETLABEL_SHAPE GetShape() const
wxStaticText * m_labelCombo
KICAD_T Type() const
Returns the type of object.