| 
    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 38 of file scintilla_tricks.cpp.
References m_braces, m_lastCaretPos, m_lastSelEnd, m_lastSelStart, m_onAcceptFn, m_onCharAddedFn, m_singleLine, m_suppressAutocomplete, m_te, move, onChar(), onCharHook(), onModified(), onScintillaUpdateUI(), onThemeChanged(), and setupStyles().
| void SCINTILLA_TRICKS::CancelAutocomplete | ( | ) | 
Definition at line 678 of file scintilla_tricks.cpp.
References m_te.
| void SCINTILLA_TRICKS::DoAutocomplete | ( | const wxString & | aPartial, | 
| const wxArrayString & | aTokens ) | 
Definition at line 648 of file scintilla_tricks.cpp.
References filter, m_suppressAutocomplete, and m_te.
Referenced by DoTextVarAutocomplete(), SCH_FIELD::OnScintillaCharAdded(), and DIALOG_USER_DEFINED_SIGNALS::onScintillaCharAdded().
| void SCINTILLA_TRICKS::DoTextVarAutocomplete | ( | const std::function< void(const wxString &xRef, wxArrayString *tokens)> & | getTokensFn | ) | 
Definition at line 611 of file scintilla_tricks.cpp.
References DoAutocomplete(), and m_te.
Referenced by DIALOG_TABLE_PROPERTIES::DIALOG_TABLE_PROPERTIES(), and DIALOG_TABLE_PROPERTIES::DIALOG_TABLE_PROPERTIES().
      
  | 
  protected | 
      
  | 
  protected | 
Definition at line 177 of file scintilla_tricks.cpp.
References m_onCharAddedFn.
Referenced by SCINTILLA_TRICKS().
      
  | 
  protectedvirtual | 
Definition at line 218 of file scintilla_tricks.cpp.
References ConvertSmartQuotesAndDashes(), firstNonWhitespace(), grid, isCtrlSlash(), m_onAcceptFn, m_onCharAddedFn, m_singleLine, m_suppressAutocomplete, m_te, GRID_TRICKS::onKeyDown(), and setupStyles().
Referenced by SCINTILLA_TRICKS().
      
  | 
  protected | 
Definition at line 183 of file scintilla_tricks.cpp.
References m_singleLine, m_te, and text.
Referenced by SCINTILLA_TRICKS().
      
  | 
  protected | 
Definition at line 558 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 91 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 99 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(), and SCINTILLA_TRICKS().
      
  | 
  protected | 
Definition at line 72 of file scintilla_tricks.h.
Referenced by onScintillaUpdateUI(), and SCINTILLA_TRICKS().
      
  | 
  protected | 
Definition at line 71 of file scintilla_tricks.h.
Referenced by onScintillaUpdateUI(), and SCINTILLA_TRICKS().
      
  | 
  protected | 
Definition at line 78 of file scintilla_tricks.h.
Referenced by onCharHook(), and SCINTILLA_TRICKS().
      
  | 
  protected | 
Definition at line 79 of file scintilla_tricks.h.
Referenced by onChar(), onCharHook(), and SCINTILLA_TRICKS().
      
  | 
  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(), onCharHook(), and SCINTILLA_TRICKS().
      
  | 
  protected | 
Definition at line 68 of file scintilla_tricks.h.
Referenced by CancelAutocomplete(), DoAutocomplete(), DoTextVarAutocomplete(), firstNonWhitespace(), onCharHook(), onModified(), onScintillaUpdateUI(), Scintilla(), SCINTILLA_TRICKS(), and setupStyles().