Table of Contents

Class: Editor ./QScintilla/Editor.py

Class implementing the editor component of the eric3 IDE.

Signals

modificationStatusChanged(boolean, editor)
emitted when the modification status has changed
cursorChanged(string, int, int)
emitted when the cursor position was changed
editorSaved(string)
emitted after the editor has been saved
Base Classes   
QextScintilla
Methods   
__init__
bindLexer
close
closeIt
commentLine
commentLineOrSelection
commentSelection
contextMenuEvent
ensureVisible
getExtension
getFileName
getHighlightPosition
gotoLine
handleBreakpoint
handleContextClose
handleContextSave
handleContextSaveAs
handleCursorPositionChanged
handleDeselectAll
handleMarginClicked
handleModificationChanged
handleSelectAll
handleShowContextMenu
handleToggleBreakpoint
handleToggleCBreakpoint
highlight
highlightVisible
indentLine
indentLineOrSelection
indentSelection
printFile
printSelection
readSettings
saveFile
saveFileAs
sendAllBreakpoints
setLineMarkerColours
setMargin0and2
setTextDisplay
uncommentLine
uncommentLineOrSelection
uncommentSelection
unindentLineOrSelection
writeFile
  __init__ 
__init__ (
        self,
        dbs,
        fn=None,
        parent=None,
        name=None,
        flags=0,
        )

Constructor

Arguments

dbs
reference to the debug server object
fn
name of the file to be opened (string). If it is None, a new (empty) editor is opened
parent
parent widget of this editor (QWidget)
name
name of this editor (string or QString)
flags
window flags
  bindLexer 
bindLexer ( self,  language )

Private slot to set the correct lexer depending on language.

Arguments

language
language (extension) of the desired lexer (string)
  close 
close ( self,  alsoDelete=0 )

Public method called when the window gets closed.

This overwritten method redirects the action to our ViewManager.closeEditor, which in turn calls our closeIt method.

Arguments

alsoDelete
ignored

Overwritten methods

  closeIt 
closeIt ( self )

Public method called by the viewmanager to finally get rid of us.

  commentLine 
commentLine ( self )

Public slot to comment the current line.

  commentLineOrSelection 
commentLineOrSelection ( self )

Public slot to comment the current line or current selection.

  commentSelection 
commentSelection ( self )

Public slot to comment the current selection.

  contextMenuEvent 
contextMenuEvent ( self,  evt )

Private method implementing the context menu event.

Arguments

evt
the context menu event (QContextMenuEvent)
  ensureVisible 
ensureVisible ( self,  line )

Public slot to ensure, that the specified line is visible.

Arguments

line
line number to make visible
  getExtension 
getExtension ( self,  fname )

Private method to get the fileextension without a leading ..

Arguments

fname
filename (string)

Returns

extension of the filename (string)

  getFileName 
getFileName ( self )

Public method to return the name of the file being displayed.

Returns

filename of the displayed file (string)

  getHighlightPosition 
getHighlightPosition ( self )

Public method to return the position of the highlight bar.

Returns

line number of the highlight bar

  gotoLine 
gotoLine ( self,  line )

Public slot to jump to the beginning of a line.

Arguments

line
line number to go to
  handleBreakpoint 
handleBreakpoint (
        self,
        line,
        state,
        newcond=None,
        )

Public method to set, delete and change a breakpoint.

Arguments

line
line number of the breakpoint
state
mouse button state (only Qt.LeftButton and Qt.ShiftButton is accepted)
newcond
new breakpoint condition
  handleContextClose 
handleContextClose ( self )

Private slot handling the close context menu entry.

  handleContextSave 
handleContextSave ( self )

Private slot handling the save context menu entry.

  handleContextSaveAs 
handleContextSaveAs ( self )

Private slot handling the save as context menu entry.

  handleCursorPositionChanged 
handleCursorPositionChanged (
        self,
        line,
        pos,
        )

Private slot to handle the cursorPositionChanged signal.

It emits the signal cursorChanged with parameters fileName, line and pos.

Arguments

line
line number of the cursor
pos
position in line of the cursor
  handleDeselectAll 
handleDeselectAll ( self )

Private slot handling the deselect all context menu action.

  handleMarginClicked 
handleMarginClicked (
        self,
        margin,
        line,
        state,
        )

Private slot to handle the marginClicked signal.

Arguments

margin
id of the clicked margin
line
line number pf the click
state
mouse button state
  handleModificationChanged 
handleModificationChanged ( self,  m )

Private slot to handle the modificationChanged signal.

It emits the signal modificationStatusChanged with parameters m and self.

Arguments

m
modification status
  handleSelectAll 
handleSelectAll ( self )

Private slot handling the select all context menu action.

  handleShowContextMenu 
handleShowContextMenu ( self )

Private slot handling the aboutToShow signal of the context menu.

  handleToggleBreakpoint 
handleToggleBreakpoint ( self )

Private slot to handle the Set/Reset breakpoint context menu action.

  handleToggleCBreakpoint 
handleToggleCBreakpoint ( self )

Private slot to handle the SetChange conditional breakpoint context menu action.

  highlight 
highlight (
        self,
        line=None,
        error=0,
        )

Public method to highlight (or de-highlight) a particular line.

Arguments

line
line number to highlight
error
flag indicating whether the error highlight should be used
  highlightVisible 
highlightVisible ( self )

Public method to make sure that the highlight is visible.

  indentLine 
indentLine ( self,  indent=1 )

Private method to indent or unindent the current line.

Arguments

indent
flag indicating an indent operation If the flag is true, an indent operation is performed. Otherwise the current line is unindented.
  indentLineOrSelection 
indentLineOrSelection ( self )

Public slot to indent the current line or current selection

  indentSelection 
indentSelection ( self,  indent=1 )

Private method to indent or unindent the current selection.

Arguments

indent
flag indicating an indent operation If the flag is true, an indent operation is performed. Otherwise the current line is unindented.
  printFile 
printFile ( self )

Public slot to print the text.

  printSelection 
printSelection ( self )

Public slot to print the selected text.

  readSettings 
readSettings ( self )

Public slot to read the settings into our lexer.

  saveFile 
saveFile (
        self,
        saveas=0,
        path=None,
        )

Public slot to save the text to a file.

Arguments

saveas
flag indicating a save as action
path
directory to save the file in (string or QString)

Returns

tuple of two values (boolean, string) giving a success indicator and the name of the saved file

  saveFileAs 
saveFileAs ( self,  path=None )

Public slot to save a file with a new name.

saveas
flag indicating a save as action
path
directory to save the file in (string or QString)

Returns

tuple of two values (boolean, string) giving a success indicator and the name of the saved file

  sendAllBreakpoints 
sendAllBreakpoints ( self )

Private slot to send all breakpoints to the debug server.

  setLineMarkerColours 
setLineMarkerColours ( self )

Private method to set the line marker colours.

  setMargin0and2 
setMargin0and2 ( self )

Private method to configure margins 0 and 2.

  setTextDisplay 
setTextDisplay ( self )

Private method to configure the text display.

  uncommentLine 
uncommentLine ( self )

Public slot to uncomment the current line.

This happens only, if it was commented by using the commentLine() or commentSelection() slots

  uncommentLineOrSelection 
uncommentLineOrSelection ( self )

Public slot to uncomment the current line or current selection.

This happens only, if it was commented by using the commentLine() or commentSelection() slots

  uncommentSelection 
uncommentSelection ( self )

Public slot to uncomment the current selection.

This happens only, if it was commented by using the commentLine() or commentSelection() slots

  unindentLineOrSelection 
unindentLineOrSelection ( self )

Public slot to unindent the current line or current selection.

  writeFile 
writeFile ( self,  fn )

Public slot to write the text to a file.

Arguments

fn
filename to write to (string or QString)

Returns

flag indicating success


Table of Contents

This document was automatically generated on Fri Mar 14 19:54:53 2003 by HappyDoc version 2.1