Class ::tycho::EditHTML


Inherits: ::tycho::Edit - Source File - Contents: itk_options - public methods - protected methods
This class defines a text widget with an emacs-like editor with some context-specific features for editing HTML files. It tags and colors HTML statements enclosed by angle brackets, and makes hyperlinks live. It also provides a command for checking hyperlinks.

Itk_options

-commandcolor black
The color of commands.
-pointercolor black
The color of pointer.
-destcolor black
The color of dests.

Public constructs

Public Methods

checkLinks
Check hyperlinks for validity.
evaluate
Evaluate the contents of the text window as HTML commands.
fileTemplate
Insert the blank html template into the file.
help
Open a window with help on the current widget.
jump
Jump to the link under the "current" mark, if any.
parseNow start stop
Tag and color HTML commands in the specified range.
seeFragment point
Find a point within the file, center in the visible part of the text window, and briefly highlight it. The point can have any of three forms:
   {line linenumber}
   {range startindex endindex}
   name
where in the latter form, name should be a named
anchor within the HTML file.
 
spellCheckTags
Returns a list of tags to use when checking the spelling.

Protected constructs

Protected Methods

fixLink link start end err
Fix the link between start and end, which has error indicated by err. The user is queried for a replacement. The first argument is the original text of the bad link. The second is the start position, the third is the end position, and the final argument is a message indicating what is wrong with the link. If the user does not cancel, the link will be replaced with an edited value. Return the replacement string if there is one, or the null string if the user cancels.
parseLink dest
Given an HTML anchor, return a two-element list with a fully expanded filename (which could be based on the location of the current file we are displaying) and a point within the file. It is possible for either the filename or the point within the file to be an empty string, meaning that they were not specified. If the parsing fails, an empty string is returned rather than a two-element list. FIXME: This will not work unless the parent widget is created at the global scope.
preference mode args
Access the preferences associated with this widget. This method overrides the default method in ::tycho::TWidget to access the "edithtml" preferences.

Index of classes



Author: Edward A. Lee
Version: @(#)EditHTML.itcl 1.29 12/14/96
Copyright: (c) 1995-1996 The Regents of the University of California.