KiCad PCB EDA Suite
|
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance. More...
#include <scintilla_tricks.h>
Public Member Functions | |
SCINTILLA_TRICKS (wxStyledTextCtrl *aScintilla, const wxString &aBraces, bool aSingleLine, std::function< void(wxKeyEvent &)> onAcceptHandler=[](wxKeyEvent &aEvent) { }, std::function< void(wxStyledTextEvent &)> onCharAddedHandler=[](wxStyledTextEvent &) { }) | |
wxStyledTextCtrl * | Scintilla () const |
void | DoTextVarAutocomplete (const std::function< void(const wxString &xRef, wxArrayString *tokens)> &getTokensFn) |
void | DoAutocomplete (const wxString &aPartial, const wxArrayString &aTokens) |
void | CancelAutocomplete () |
Protected Member Functions | |
void | setupStyles () |
int | firstNonWhitespace (int aLine, int *aWhitespaceCount=nullptr) |
virtual void | onCharHook (wxKeyEvent &aEvent) |
void | onChar (wxStyledTextEvent &aEvent) |
void | onModified (wxStyledTextEvent &aEvent) |
void | onScintillaUpdateUI (wxStyledTextEvent &aEvent) |
void | onThemeChanged (wxSysColourChangedEvent &aEvent) |
Protected Attributes | |
wxStyledTextCtrl * | m_te |
wxString | m_braces |
int | m_lastCaretPos |
int | m_lastSelStart |
int | m_lastSelEnd |
bool | m_suppressAutocomplete |
bool | m_singleLine |
std::function< void(wxKeyEvent &aEvent)> | m_onAcceptFn |
std::function< void(wxStyledTextEvent &aEvent)> | m_onCharAddedFn |
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
Definition at line 35 of file scintilla_tricks.h.
SCINTILLA_TRICKS::SCINTILLA_TRICKS | ( | wxStyledTextCtrl * | aScintilla, |
const wxString & | aBraces, | ||
bool | aSingleLine, | ||
std::function< void(wxKeyEvent &)> | onAcceptHandler = []( wxKeyEvent& aEvent ) { } , |
||
std::function< void(wxStyledTextEvent &)> | onCharAddedHandler = []( wxStyledTextEvent& ) { } |
||
) |
Definition at line 37 of file scintilla_tricks.cpp.
References m_braces, m_singleLine, m_te, onChar(), onCharHook(), onModified(), onScintillaUpdateUI(), onThemeChanged(), and setupStyles().
void SCINTILLA_TRICKS::CancelAutocomplete | ( | ) |
Definition at line 634 of file scintilla_tricks.cpp.
References m_te.
Referenced by DIALOG_TEXT_PROPERTIES::onMultiLineTCLostFocus(), and DIALOG_TEXTBOX_PROPERTIES::onMultiLineTCLostFocus().
void SCINTILLA_TRICKS::DoAutocomplete | ( | const wxString & | aPartial, |
const wxArrayString & | aTokens | ||
) |
Definition at line 604 of file scintilla_tricks.cpp.
References filter, m_suppressAutocomplete, and m_te.
Referenced by DoTextVarAutocomplete(), SCH_FIELD::OnScintillaCharAdded(), PROPERTIES_FRAME::onScintillaCharAdded(), PANEL_SETUP_RULES::onScintillaCharAdded(), and DIALOG_USER_DEFINED_SIGNALS::onScintillaCharAdded().
void SCINTILLA_TRICKS::DoTextVarAutocomplete | ( | const std::function< void(const wxString &xRef, wxArrayString *tokens)> & | getTokensFn | ) |
Definition at line 568 of file scintilla_tricks.cpp.
References DoAutocomplete(), and m_te.
Referenced by DIALOG_TABLE_PROPERTIES::DIALOG_TABLE_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), and DIALOG_TEXTBOX_PROPERTIES::DIALOG_TEXTBOX_PROPERTIES().
|
protected |
|
protected |
Definition at line 176 of file scintilla_tricks.cpp.
References m_onCharAddedFn.
Referenced by SCINTILLA_TRICKS().
|
protectedvirtual |
Definition at line 207 of file scintilla_tricks.cpp.
References ConvertSmartQuotesAndDashes(), firstNonWhitespace(), grid, isCtrlSlash(), m_onAcceptFn, m_onCharAddedFn, m_singleLine, m_suppressAutocomplete, m_te, and setupStyles().
Referenced by SCINTILLA_TRICKS().
|
protected |
Definition at line 182 of file scintilla_tricks.cpp.
References m_singleLine, m_te, and text.
Referenced by SCINTILLA_TRICKS().
|
protected |
Definition at line 516 of file scintilla_tricks.cpp.
References m_braces, m_lastCaretPos, m_lastSelEnd, m_lastSelStart, and m_te.
Referenced by SCINTILLA_TRICKS().
|
protected |
Definition at line 90 of file scintilla_tricks.cpp.
References setupStyles().
Referenced by SCINTILLA_TRICKS().
|
inline |
Definition at line 47 of file scintilla_tricks.h.
References m_te.
Referenced by SCH_FIELD::OnScintillaCharAdded(), and DIALOG_USER_DEFINED_SIGNALS::onScintillaCharAdded().
|
protected |
Definition at line 98 of file scintilla_tricks.cpp.
References KIGFX::COLOR4D::a, dummy, KIUI::GetMonospacedUIFont(), m_singleLine, m_te, KIGFX::COLOR4D::Mix(), KIGFX::COLOR4D::ToColour(), and KIGFX::COLOR4D::WithAlpha().
Referenced by onCharHook(), onThemeChanged(), and SCINTILLA_TRICKS().
|
protected |
Definition at line 69 of file scintilla_tricks.h.
Referenced by onScintillaUpdateUI(), and SCINTILLA_TRICKS().
|
protected |
Definition at line 70 of file scintilla_tricks.h.
Referenced by onScintillaUpdateUI().
|
protected |
Definition at line 72 of file scintilla_tricks.h.
Referenced by onScintillaUpdateUI().
|
protected |
Definition at line 71 of file scintilla_tricks.h.
Referenced by onScintillaUpdateUI().
|
protected |
Definition at line 78 of file scintilla_tricks.h.
Referenced by onCharHook().
|
protected |
Definition at line 79 of file scintilla_tricks.h.
Referenced by onChar(), and onCharHook().
|
protected |
Definition at line 74 of file scintilla_tricks.h.
Referenced by onCharHook(), onModified(), SCINTILLA_TRICKS(), and setupStyles().
|
protected |
Definition at line 73 of file scintilla_tricks.h.
Referenced by DoAutocomplete(), and onCharHook().
|
protected |
Definition at line 68 of file scintilla_tricks.h.
Referenced by CancelAutocomplete(), DoAutocomplete(), DoTextVarAutocomplete(), firstNonWhitespace(), onCharHook(), onModified(), onScintillaUpdateUI(), Scintilla(), SCINTILLA_TRICKS(), and setupStyles().