pycrossword  0.4
Pure-Python implementation of a crossword puzzle generator and editor
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | List of all members
pycross.utils.synteditor.SynEditor Class Reference

Scintilla-based Python editor Adapted from this example and this addition More...

Inheritance diagram for pycross.utils.synteditor.SynEditor:

Public Member Functions

def __init__ (self, parent=None, lexer=Qsci.QsciLexerPython(), source=None, autocomplete_source=None)
 
def keyPressEvent (self, event)
 Handle key presses to show autocomplete options when pressed SPACE. More...
 
def reset_autocomplete_source (self)
 Refreshes the source words in SynEditor::autocomplete. More...
 
def on_margin_clicked (self, nmargin, nline, modifiers)
 Toggle marker for the line the margin was clicked on. More...
 

Public Attributes

 lexer
 Python lexer. More...
 
 autocomplete_source
 list|None autocompletion source More...
 
 autocomplete
 Qsci.QsciAPIs internal autocomplete object More...
 

Static Public Attributes

int ARROW_MARKER_NUM = 8
 arrow marker type to place on the left margin More...
 

Private Member Functions

def _config_autocomplete (self)
 Configures various autocompletion settings. More...
 

Detailed Description

Scintilla-based Python editor Adapted from this example and this addition

See also
QScintilla docs, API reference

Constructor & Destructor Documentation

◆ __init__()

def pycross.utils.synteditor.SynEditor.__init__ (   self,
  parent = None,
  lexer = Qsci.QsciLexerPython(),
  source = None,
  autocomplete_source = None 
)
Parameters
parentQtWidgets.QWidget parent widget for the editor
lexerQsci.QsciLexer lexer object responsible for parsing / highlighting
sourcestr|None source code to place in the editor upon creation
autocomplete_sourcelist|None list of variables & functions serving as the autocompletion source (see utils::utils::get_script_members())

Member Function Documentation

◆ _config_autocomplete()

def pycross.utils.synteditor.SynEditor._config_autocomplete (   self)
private

Configures various autocompletion settings.

◆ keyPressEvent()

def pycross.utils.synteditor.SynEditor.keyPressEvent (   self,
  event 
)

Handle key presses to show autocomplete options when pressed SPACE.

◆ on_margin_clicked()

def pycross.utils.synteditor.SynEditor.on_margin_clicked (   self,
  nmargin,
  nline,
  modifiers 
)

Toggle marker for the line the margin was clicked on.

◆ reset_autocomplete_source()

def pycross.utils.synteditor.SynEditor.reset_autocomplete_source (   self)

Refreshes the source words in SynEditor::autocomplete.

Member Data Documentation

◆ ARROW_MARKER_NUM

int pycross.utils.synteditor.SynEditor.ARROW_MARKER_NUM = 8
static

arrow marker type to place on the left margin

◆ autocomplete

pycross.utils.synteditor.SynEditor.autocomplete

Qsci.QsciAPIs internal autocomplete object

◆ autocomplete_source

pycross.utils.synteditor.SynEditor.autocomplete_source

list|None autocompletion source

◆ lexer

pycross.utils.synteditor.SynEditor.lexer

Python lexer.


The documentation for this class was generated from the following file: