CUTE User-friendly Text Editor | ||
---|---|---|
Prev |
The most important feature of CUTE is the built-in python interpreter. It is responsible for configuring and extending CUTE. Ther are some tasks which the user wants to automate in a text editor. One alternative is to record a macro once and execute it several times.
The other alternative is to wrtie a python script using CUTE functions.
General functions are defined in the cute python module.
Load a file into the editor.
Print text on output view.
Clear output view.
Get an interger value from user via a dialog.
Get a string from user via a dialog.
Show a message dialog.
Show a message dialog asking a question with yes and no button.
Show an open file dialog and returns file name: getOpenFileName(filter).
Show an open dir dialog and returns dir name.
Load session from given file.
Retrieve list containing all views.
The given view will become the current one.
These functions are defined in the config module.
Add an item to recent file menu.
Add an item to bookmark menu.
Add an item to tools menu.
Add an item to tools menu, where command is created with createCommand()
Set working directory.
Set main window geometry, set width, height and position.
Map an action to a shortcut.
creates a new command implemented in function with given name, it can be bound to a shortcut and inserted in a menu
Construct new color object.
Scintilla functions are defined in the cute module.
These functions can be called with or without view object, for example it is possible to call my_view.clear() in order to clear a certain view or just clear() in order to clear the current view.
Deletes all the text in the text edit.
Copies selected text to the clipboard.
Copies selected text to the clipboard and then deletes the text.
If any lines are currently folded then they are all unfolded. Otherwise all lines are folded. This has the same effect as clicking in the fold margin with the shift and control keys pressed.
Pastes text from the clipboard into the text edit at the current cursor position.
Undo the last change or sequence of changes.
Redo the last change or sequence of changes.
If the cursor is either side of a brace character then move it to the position of the corresponding brace and select the text between the braces.
Zooms in on the text by by making the base font size one point larger and recalculating all font sizes.
Zooms out on the text by by making the base font size range points smaller and recalculating all font sizes.
Mark the beginning of a sequence of actions that can be undone by a single call to undo().
Mark the end of a sequence of actions that can be undone by a single call to undo().
Returns 1 if auto-indentation is enabled.
Returns 1 if the backspace key unindents a line instead of deleting a character.
Returns the brace matching mode.
Returns the end-of-line mode.
Returns the visibility of end-of-lines.
Find the next occurence of the string found using findFirst().
Returns the current folding style.
Returns 1 if some text is selected.
Returns 1 if the display of indentation guides is enabled.
Returns 1 if indentations are created using tabs and spaces, rather than just spaces.
Returns the indentation width in characters. The default is 0 which means that the value returned by tabWidth() is actually used.
Returns 1 if the text has been modified.
Returns 1 if the text edit is read-only.
Returns 1 if there is something that can be redone.
Returns 1 if there is something that can be undone.
Returns 1 if text is interpreted as being UTF8 encoded. The default is to interpret the text as Latin1 encoded.
Returns the number of lines of text.
Returns the length of the text edit's text.
Returns 1 if the tab key indents a line instead of inserting a tab character.
Returns the tab width in characters.
Returns the visibility of whitespace.
Ensures that the line number line is visible.
If autoindent is 1 then auto-indentation is enabled.
If deindent is 1 then the backspace key will unindent a line rather then delete a character.
Sets the end-of-line mode to mode.
If visible is 1 then end-of-lines are made visible.
Sets the folding style for margin 2 to fold.
Set the background color of indentation guides.
Set the foreground color of indentation guides.
Set the foreground color of all margins.
Set the background color of all margins.
Set the background color of given marker mnr. If mnr is -1 then the color of all markers is set.
Set the foreground color of given marker mnr. If mnr is -1 then the color of all markers is set.
Set the background color used to display matched braces.
Set the foreground color used to display matched braces.
Set the background color used to display unmatched braces.
Set the foreground color used to display unmatched braces.
Enables or disables this display of indentation guides.
If tabs is 1 then indentations are created using tabs and spaces, rather than just spaces.
Sets the indentation width. If width is 0 then the value returned by tabWidth() is used.
Sets the modified state of the text edit. Note that it is only possible to clear the modified state. Attempts to set the modified state are ignored.
Sets the read-only state of the text edit.
If indent is 1 then the tab key will indent a line rather then insert a tab character.
Sets the tab width.
Sets the current text encoding. If cp is 1 then UTF8 is used, otherwise Latin1 is used.
Sets the visibility of whitespace.
Decreases the indentation of line line_number.
Zooms the text by making the base font size given points and recalculating all font sizes.
All the lines of the text have their end-of-lines converted to given mode.
Delete the the marker instance with the marker given handle.
Returns the number of characters that given line is indented by.
Returns the length of given line or -1 if there is no such line.
Returns 1 if line numbers are enabled for given margin.
Returns 1 if given margin is sensitive to mouse clicks.
Returns the width in pixels of given margin.
Define a marker using the given symbol with the given marker number. If mnr is -1 then the marker number is automatically allocated.
Return the line number that contains the marker instance with the given marker handle.
Sets the cursor to the given line at the given position index.
Sets the indentation of line to given characters.
Enables or disables, according to second arg, the display of line numbers in given margin.
Enables or disables, according to second arg, the sensitivity of given margin to mouse clicks.
Sets the width of given margin to given pixels. If the width of a margin is 0 then it is not displayed.
Inserts text at current position. The function must be given at least 1 argument.
Finds a string in current view. The function must be given at least 1 argument.
Returns current line.
Returns current index.
Returns current selection.
Returns line at given line number.
Sets margin margin_number width with given string.
Sets selection.
Inserts output of a shell command.
Filters selection with a shell command.
Retrieves file name of view.