TCLTextFormatter

Class for formatting a TextBlock onto a TCL text control.

Base Classes

Methods

__init__(self, textctl)

   def __init__(self, textctl):

_addState(self, attr, range)

   def _addState(self, attr, range):

Adds a pair of text positions to the state. Range is a tuple containing two row/column tuples for the beginning and end of a range.

_commit(self, data)

   def _commit(self, data):

Provides the necessary override of spug.nml.StdFormatter.StdFormatter._commit(). Counts the number of newlines (to maintain the current line number)

_makeLine(self, line)

   def _makeLine(self, line):

Overrides spug.nml.StdFormatter.StdFormatter._commit() to implement indentation.

_popState(self)

   def _popState(self):

Restores the previous state.

_pos(self)

   def _pos(self):

Returns the current text position as a row/column tuple.

_pushState(self, attr)

   def _pushState(self, attr):

Pushes the current state and creates a new current state consisting of the current state merged with attr.

configTag(self, state)

   def configTag(self, state):

format(self, text)

   def format(self, text):

Formats the given text block into the text control.

formatAll(self, text)

   def formatAll(self, text):

formatDI(self, text)

   def formatDI(self, text):

Formats a definition item.

formatDL(self, text)

   def formatDL(self, text):

Formats a definition list.

formatDoc(self, text)

   def formatDoc(self, text):

Formats an entire document.

formatText(self, text)

   def formatText(self, text):

Formats plain old text.

formatTextAttr(self, text, attr)

   def formatTextAttr(self, text, attr):

Formats text with a special attribute attr.

formatUL(self, text)

   def formatUL(self, text):

Formats an unordered list.