::tycho::View -
Source File -
Contents:
itk_options
- destructor
- public methods
- public procs
- protected method
- protected variables
- protected commons
If the parent window is a Displayer object, then the menu bar of the
Displayer object is populated with three menus. The "File" menu
contains commands to open a file, insert a file, save data to a file,
save as some other file name, print, evaluate the data, reload the
last saved version, toggle read-only, version control, close the
window, and exit the application. The "Window" menu contains commands
to open new (blank) top-level windows of all types that have been
registered with the File class using one of the
register... procedures. It also contains commands to
bring to the foreground any currently open editor that has a file
name associated with it. Note that editors with the default name
"NoName" do not appear on this list. Finally, a "Help" menu contains
pointers to key Tycho documentation.
Here is an example:
::tycho::view File
Derived classes should normally redefine the methods
clear,
help,
insertData,
print, and
saveText.
seeFragment,
and currentPoint. These two should always be redefined
as a pair, since currentPoint is assumed to return a
syntax understood by seeFragment. Derived classes may wish
to redefine indicateReadOnly, for example to disable menu
entries. Finally, most derived classes will want to redefine
focusin to give the focus to a key widget.
-autosaveinterval
5
-data
-file
NoName
::tycho::expandPath for details about how this is done.
Note that the file is not actually loaded. Call reload
after configuring this option to accomplish that (the constructor does
this automatically).
-save
1
-tmpfile
0
destructor
altFile
autoSave
clear
evaluate
filename
help
hyperJump filename {point {}}
seeFragment,
passing it the second argument. If the filename is relative (does not
begin with "/", "~", or "$"), then prepend the directory of the file
currently being edited or viewed. Then, expand the filename using
::tycho::expandPath and open the resulting file with
::tycho::File::openContext, which will choose an editor
based on the filename extension. Finally, invoke
seeFragment to view the specified point within the file.
The format for the point argument depends on the type of file
being opened. For HTML files, it will normally be the name of an
anchor in the file. For text files, it will normally be either "{line
linenumber}" or "{range start end}", where
start and end have the form
linenumber.characternumber.
indicateReadOnly bool
insertData data
insertFile
insertData.
isModified
markModified
markUnmodified
openWinMethod
Edit class is used to open an
ordinary text editor.
print
reload
insertData.
revisionControl
save {name ""}
saveAs
saveAsFile filename
saveCrash
saveQuery useSaveAs
saveAs is used instead of save,
so that the user is prompted for a file name.
If the file is not modified, or if the -save option was given with value 0, return 2 and do nothing. If the file is modified and is saved, return 1. If the file is modified but not saved, return 0. If the user hits cancel, trigger a silentError, which unravels the calling stack all the way to the top-level. This has the effect of cancelling the entire operation.
toggleReadOnly
windowMenuAddAll label
windowMenuAppend obj label {type {}}
windowMenuRemoveAll filename
File objects. The specified filename must match
exactly the label given in the call to windowMenuAddAll
that created the entry in the first place, and the object referenced
by the menu must be this one.
callAutoSave obj
emergencySave
makeTychoDir
newEditor displayer viewer args
openWin
Edit class is used to open an
ordinary text editor.
openContext filename
::tycho::expandPath, making them absolute
and unique.
registerContents contents filecommand {description {}} {editorclass {}}
openContext procedure in this class)
will recognize a directory that contains the given contents and invoke
the specified command. The directory must contain all of the
specified contents items to be recognized.
The filecommand argument is a string with a "%s" embedded.
The "%s" is replaced with the file name before invoking the command,
using the Tcl formatcommand. For example, if the command is
"::tycho::viewFile {%s} EditItcl", then the Tycho viewFile
procedure will be used to open the file using an
EditItcl view object. The braces around the "%s" allow
the file name to have spaces.
If a description argument is a non-empty string, then the
command will be added to the "Window" menu of all File
objects opened in the future using the value of this description as
the menu label. This permits the user to open a new blank editor of
the given class.
If the editorclass argument is supplied and non-empty, then is selects the sub-menu of the Window menu into which the entry to open a blank editor will be placed. Legal values are "text", "graphics", and "tools".
registerExtensions extensions filecommand {description {}} {editorclass {}}
openContext or displayData procedures in
this class) will recognize a file name that has the given extension
and will use the specified command to open it. Note that the leading
period is considered part of the extension, as in ".itcl".
The filecommand argument is a string with a "%s" embedded.
The "%s" is replaced with the file name before invoking the command,
using the Tcl formatcommand. For example, if the command is
"::tycho::viewFile {%s} EditItcl", then the Tycho viewFile
procedure will be used to open the file using an
EditItcl view object. The braces around the "%s" allow
the file name to have spaces.
If a description argument is a non-empty string, then the
command will be added to the "Window" menu of all File
objects opened in the future using the value of this description as
the menu label. This permits the user to open a new blank editor of
the given class.
If the editorclass argument is supplied and non-empty, then is selects the sub-menu of the Window menu into which the entry to open a blank editor will be placed. Legal values are "text", "graphics", and "tools".
registerFilenames filename filecommand {description {}} {editorclass {}}
openContext
procedure in this class) will recognize a file that has one of the
given names and will use the specified command to open it.
The filecommand argument is a string with a "%s" embedded.
The "%s" is replaced with the file name before invoking the command,
using the Tcl formatcommand. For example, if the command is
"::tycho::viewFile {%s} EditItcl", then the Tycho viewFile
procedure will be used to open the file using an
EditItcl view object. The braces around the "%s" allow
the file name to have spaces.
If a description argument is a non-empty string, then the
command will be added to the "Window" menu of all File
objects opened in the future using the value of this description as
the menu label. This permits the user to open a new blank editor of
the given class.
If the editorclass argument is supplied and non-empty, then is selects the sub-menu of the Window menu into which the entry to open a blank editor will be placed. Legal values are "text", "graphics", and "tools".
registeredCommands name
isFileOpen filename
saveText
file NoName
::tycho::expandPath for details about how this is done.
Note that the file is not actually loaded. Call reload
after configuring this option to accomplish that (the constructor does
this automatically).
modified 0
previousfile
filesOpen
filesOpenTypes
printCmd lpr