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()> onAcceptHandler=[]() { }, std::function< void(wxStyledTextEvent &)> onCharAddedHandler=[](wxStyledTextEvent &) { }) | |
wxStyledTextCtrl * | Scintilla () const |
void | DoTextVarAutocomplete (std::function< void(const wxString &crossRef, wxArrayString *tokens)> aTokenProvider) |
void | DoAutocomplete (const wxString &aPartial, const wxArrayString &aTokens) |
void | CancelAutocomplete () |
Protected Member Functions | |
void | setupStyles () |
int | firstNonWhitespace (int aLine, int *aWhitespaceCount=nullptr) |
void | onCharHook (wxKeyEvent &aEvent) |
void | onChar (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()> | m_onAcceptHandler |
std::function< void(wxStyledTextEvent &aEvent)> | m_onCharAddedHandler |
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()> | onAcceptHandler = []() { } , |
||
std::function< void(wxStyledTextEvent &)> | onCharAddedHandler = []( wxStyledTextEvent& ) { } |
||
) |
Definition at line 35 of file scintilla_tricks.cpp.
References m_braces, m_te, onChar(), onCharHook(), onScintillaUpdateUI(), onThemeChanged(), and setupStyles().
void SCINTILLA_TRICKS::CancelAutocomplete | ( | ) |
Definition at line 478 of file scintilla_tricks.cpp.
References m_te.
Referenced by DIALOG_LIB_TEXT_PROPERTIES::onMultiLineTCLostFocus(), DIALOG_LIB_TEXTBOX_PROPERTIES::onMultiLineTCLostFocus(), DIALOG_TEXT_PROPERTIES::onMultiLineTCLostFocus(), and DIALOG_TEXTBOX_PROPERTIES::onMultiLineTCLostFocus().
void SCINTILLA_TRICKS::DoAutocomplete | ( | const wxString & | aPartial, |
const wxArrayString & | aTokens | ||
) |
Definition at line 449 of file scintilla_tricks.cpp.
References filter, m_suppressAutocomplete, and m_te.
Referenced by DoTextVarAutocomplete(), DIALOG_SCH_FIELD_PROPERTIES::onScintillaCharAdded(), PROPERTIES_FRAME::onScintillaCharAdded(), PANEL_SETUP_RULES::onScintillaCharAdded(), and DIALOG_USER_DEFINED_SIGNALS::onScintillaCharAdded().
void SCINTILLA_TRICKS::DoTextVarAutocomplete | ( | std::function< void(const wxString &crossRef, wxArrayString *tokens)> | aTokenProvider | ) |
Definition at line 413 of file scintilla_tricks.cpp.
References DoAutocomplete(), and m_te.
Referenced by DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), and DIALOG_TEXTBOX_PROPERTIES::DIALOG_TEXTBOX_PROPERTIES().
|
protected |
|
protected |
Definition at line 166 of file scintilla_tricks.cpp.
References m_onCharAddedHandler.
Referenced by SCINTILLA_TRICKS().
|
protected |
Definition at line 172 of file scintilla_tricks.cpp.
References ConvertSmartQuotesAndDashes(), firstNonWhitespace(), isCtrlSlash(), m_onAcceptHandler, m_singleLine, m_suppressAutocomplete, m_te, and setupStyles().
Referenced by SCINTILLA_TRICKS().
|
protected |
Definition at line 361 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 80 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 DIALOG_USER_DEFINED_SIGNALS::onScintillaCharAdded().
|
protected |
Definition at line 88 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 68 of file scintilla_tricks.h.
Referenced by onScintillaUpdateUI(), and SCINTILLA_TRICKS().
|
protected |
Definition at line 69 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 70 of file scintilla_tricks.h.
Referenced by onScintillaUpdateUI().
|
protected |
Definition at line 76 of file scintilla_tricks.h.
Referenced by onCharHook().
|
protected |
Definition at line 79 of file scintilla_tricks.h.
Referenced by onChar().
|
protected |
Definition at line 73 of file scintilla_tricks.h.
Referenced by onCharHook(), and setupStyles().
|
protected |
Definition at line 72 of file scintilla_tricks.h.
Referenced by DoAutocomplete(), and onCharHook().
|
protected |
Definition at line 67 of file scintilla_tricks.h.
Referenced by CancelAutocomplete(), DoAutocomplete(), DoTextVarAutocomplete(), firstNonWhitespace(), onCharHook(), onScintillaUpdateUI(), Scintilla(), SCINTILLA_TRICKS(), and setupStyles().