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. There are tasks which a user will wish to automate in a text editor. One way to do this is to record a macro once and execute it several times. The alternative is to write a python script using CUTE functions.
General functions are defined in the cute python module.
Load a file into the editor.
Get an integer value from the user via a dialog.
Get a string from the 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. You can also use a filter. For example: getOpenFileName(“*.cpp”).
Show an open dir dialog and returns dir name.
Load a previously-saved session called filename.
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 the recent file menu.
Add an item to the bookmark menu.
Add an item to the tools menu.
Add an item to the tools menu, after the command has been created with createCommand()
Set working directory.
Set main window geometry: width, height and position.
Map an action to a shortcut.
creates a new command implemented in function with the given name; it can be bound to a shortcut and inserted into a menu
Construct new color object.
Scintilla functions are defined in the cute module.
These functions can be called with or without a 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 previously-Undone changes or sequences 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 making the base font size one point larger and recalculating all font sizes.
Zooms out on the text 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 occurrence 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 bool is 1, the backspace key will unindent a line rather then delete a character.
Sets the end-of-line mode to eolMode.
If eolVisibility is 1 then ends-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 the marker mnr. If mnr is -1 then the color of all markers is set.
Set the foreground color of the 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 the display of indentation guides.
If bool 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 bool 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 bool 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 marker instance with the given marker handle.
Returns the number of characters by which the given line is indented.
Returns the length of the given line, or -1 if there is no such line.
Returns 1 if line numbers are enabled for the given margin.
Returns 1 if the given margin is sensitive to mouse clicks.
Returns the width in pixels of the 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 line_number to match the given string.
Enables or disables, according to second arg, the display of line numbers in the given margin.
Enables or disables, according to second arg, the sensitivity of the given margin to mouse clicks.
Sets the width of the given margin to the given pixels. If the width of a margin is 0 then it is not displayed.
Inserts text at the given position, or at the current position if none is supplied. The function must be given at least 1 argument.
Finds a string in the current view. The function must be given at least 1 argument.
Returns current line.
Returns current index.
Returns current selection as Selection object. A selection object has four attributes: lineFrom, lineTo, columnFrom and columnTo.
Returns selected text.
Moves cursor, negative values can also be used.
Returns line at the given line number.
Sets the margin margin_number's width with the given string.
Sets selection.
Inserts output of a shell command.
Filters selection with a shell command.
Retrieves the file name of the view.