Extended syntax editor dialog based on SynEditorWidget.
More...
|
def | __init__ (self, methods, lexer=Qsci.QsciLexerPython(), source=None, minsize=(800, 500), icon='file.png', title=_('::Code Editor ::')) |
|
def | showEvent (self, event) |
| On show event handler: updates the left panel from the current source code. More...
|
|
def | add_central (self, lexer, source, autocomplete_source) |
| Constructs the central widget (syntax editor). More...
|
|
def | reset_methods (self) |
| Fills the list of available API methods in the left panel from PluginSynEditorWidget::methods . More...
|
|
def | on_actn_filter_regex_toggled (self, checked) |
| On Toggle slot for the filter button (action): re-applies the filter with / without regex. More...
|
|
def | on_filter_changed (self, text) |
| On Changed slot for the filter edit: re-applies the filter with the new expression. More...
|
|
def | on_editor_text_changed (self) |
| On Changed slot for the syntax editor: update the checked state of source methods, update autocomplete source. More...
|
|
def | on_lw_methods_select (self, current, previous) |
| On Selection Changed slot for the source methods: scrolls to the selected method in the syntaxt editor. More...
|
|
def | on_lw_methods_changed (self, item) |
| On Changed slot for the source methods: adds or removes source method templates in the editor when checked/unchecked. More...
|
|
def | on_lw_methods_dblclicked (self, item) |
| On Double Clicked slot for the source methods: toggles the checked state of the dbl-clicked item. More...
|
|
def | add_elements (self, lexer, source, autocomplete_source) |
| Constructs main layout blocks. More...
|
|
def | add_bottom (self) |
| Constructs the bottom layout with the OK and Cancel buttons. More...
|
|
def | currenttext (self) |
| Returns the current text in the syntax editor. More...
|
|
|
| RESRCH = re.compile(r'\n[ ]{4}[\w"#@]') |
| regex pattern pattern for a method start More...
|
|
Extended syntax editor dialog based on SynEditorWidget.
Adds a left panel with available API methods exposed to custom plugins.
◆ __init__()
def pycross.utils.synteditor.PluginSynEditorWidget.__init__ |
( |
|
self, |
|
|
|
methods, |
|
|
|
lexer = Qsci.QsciLexerPython() , |
|
|
|
source = None , |
|
|
|
minsize = (800, 500) , |
|
|
|
icon = 'file.png' , |
|
|
|
title = _(':: Code Editor ::') |
|
) |
| |
◆ _apply_filter()
def pycross.utils.synteditor.PluginSynEditorWidget._apply_filter |
( |
|
self, |
|
|
|
text |
|
) |
| |
|
private |
Filters the source methods in the left panel by a search expression.
The filter can be simple or regex-based, depending on the Checked state of PluginSynEditorWidget::actn_filter_regex
.
- Parameters
-
text | str the search expression used as the filter |
◆ _config_editor()
def pycross.utils.synteditor.PluginSynEditorWidget._config_editor |
( |
|
self | ) |
|
|
private |
Connects the syntax editor's textChanged
signal to an internal handler.
◆ _get_autocomplete_source()
def pycross.utils.synteditor.PluginSynEditorWidget._get_autocomplete_source |
( |
|
self, |
|
|
|
source |
|
) |
| |
|
private |
Retrieves a list of variables referenced / created in the given source.
- Parameters
-
source | str source text to extract variables from |
- Returns
list
list of variables – see utils::utils::get_script_members()
◆ _update_checked_methods()
def pycross.utils.synteditor.PluginSynEditorWidget._update_checked_methods |
( |
|
self | ) |
|
|
private |
Checks or unchecks the source methods in the left panel based on the current editor text.
The method searches the function signatures of the source methods in the current editor and if found, checks the corresponding method to mark it as used.
◆ add_central()
def pycross.utils.synteditor.PluginSynEditorWidget.add_central |
( |
|
self, |
|
|
|
lexer, |
|
|
|
source, |
|
|
|
autocomplete_source |
|
) |
| |
Constructs the central widget (syntax editor).
- Parameters
-
lexer | Qsci.QsciLexer lexer object responsible for parsing / highlighting |
source | str |None source code to place in the editor upon creation |
autocomplete_source | list |None list of variables & functions serving as the autocompletion source (see utils::utils::get_script_members()) |
Reimplemented from pycross.utils.synteditor.SynEditorWidget.
◆ on_actn_filter_regex_toggled()
def pycross.utils.synteditor.PluginSynEditorWidget.on_actn_filter_regex_toggled |
( |
|
self, |
|
|
|
checked |
|
) |
| |
On Toggle slot for the filter button (action): re-applies the filter with / without regex.
◆ on_editor_text_changed()
def pycross.utils.synteditor.PluginSynEditorWidget.on_editor_text_changed |
( |
|
self | ) |
|
On Changed slot for the syntax editor: update the checked state of source methods, update autocomplete source.
◆ on_filter_changed()
def pycross.utils.synteditor.PluginSynEditorWidget.on_filter_changed |
( |
|
self, |
|
|
|
text |
|
) |
| |
On Changed slot for the filter edit: re-applies the filter with the new expression.
◆ on_lw_methods_changed()
def pycross.utils.synteditor.PluginSynEditorWidget.on_lw_methods_changed |
( |
|
self, |
|
|
|
item |
|
) |
| |
On Changed slot for the source methods: adds or removes source method templates in the editor when checked/unchecked.
◆ on_lw_methods_dblclicked()
def pycross.utils.synteditor.PluginSynEditorWidget.on_lw_methods_dblclicked |
( |
|
self, |
|
|
|
item |
|
) |
| |
On Double Clicked slot for the source methods: toggles the checked state of the dbl-clicked item.
◆ on_lw_methods_select()
def pycross.utils.synteditor.PluginSynEditorWidget.on_lw_methods_select |
( |
|
self, |
|
|
|
current, |
|
|
|
previous |
|
) |
| |
On Selection Changed slot for the source methods: scrolls to the selected method in the syntaxt editor.
◆ reset_methods()
def pycross.utils.synteditor.PluginSynEditorWidget.reset_methods |
( |
|
self | ) |
|
◆ showEvent()
def pycross.utils.synteditor.PluginSynEditorWidget.showEvent |
( |
|
self, |
|
|
|
event |
|
) |
| |
On show event handler: updates the left panel from the current source code.
◆ actn_clear_filter
pycross.utils.synteditor.PluginSynEditorWidget.actn_clear_filter |
QtWidgets.QAction
clear filter action
◆ actn_filter_regex
pycross.utils.synteditor.PluginSynEditorWidget.actn_filter_regex |
QtWidgets.QAction
toggle regex filter action
◆ editor
pycross.utils.synteditor.PluginSynEditorWidget.editor |
◆ le_filter
pycross.utils.synteditor.PluginSynEditorWidget.le_filter |
QtWidgets.QLineEdit
filter field for the source methods
◆ lo_methods
pycross.utils.synteditor.PluginSynEditorWidget.lo_methods |
◆ lw_methods
pycross.utils.synteditor.PluginSynEditorWidget.lw_methods |
QtWidgets.QListWidget
list of source methods (exposed to plugins)
◆ methods
pycross.utils.synteditor.PluginSynEditorWidget.methods |
list
list of methods exposed to plugins
◆ methods_widget
pycross.utils.synteditor.PluginSynEditorWidget.methods_widget |
◆ RESRCH
pycross.utils.synteditor.PluginSynEditorWidget.RESRCH = re.compile(r'\n[ ]{4}[\w"#@]') |
|
static |
regex pattern
pattern for a method start
◆ splitter1
pycross.utils.synteditor.PluginSynEditorWidget.splitter1 |
QtWidgets.QSplitter
horizontal splitter
The documentation for this class was generated from the following file: