Model Railroad System
2.2.2
|
A widget that implements a help dialog that renders HTML coded help pages (generally generated from LaTeX using tex4ht's htlatex script). More...
Public Member Functions | |
HTMLHelp (name,...) | |
HTMLHelp constuctor method. More... | |
helpTopic (topic="Help") | |
Public method to display help on a specific topic. More... | |
Static Public Member Functions | |
static | GetInstance (widget) |
Returns the parent object given the specificed child widget. More... | |
static | setDefaults (helpdir, toc) |
A public typemethod to set the default values for the -helpdirectory and -tableofcontents options. More... | |
static | help (topic) |
A public typemethod to create and launch a default help dialog. More... | |
Private Member Functions | |
_Close () | |
back () | |
forward () | |
nextlink (w) | |
prevlink (w) | |
searchforward (w) | |
_SForward (w) | |
searchbackward (w) | |
_SBackward (w) | |
Static Private Member Functions | |
static | findtopicintoc (selfns, topic) |
static | pushcurrenttopic (selfns, url) |
static | backcurrenttopic (selfns) |
static | forwardcurrenttopic (selfns) |
static | render (selfns, win, url, push="yes") |
static | HMinit_win (selfns, win) |
static | HMset_indent (win, cm) |
set the indent spacing (in cm) for lists TK uses a "weird" tabbing model that causes \t to insert a single space if the current line position is past the tab setting More... | |
static | HMreset_win (win) |
reset the state of window - get ready for the next page remove all but the font tags, and remove all form state More... | |
static | HMinit_state (win) |
initialize the window's state array Parameters beginning with S_ are NOT reset adjust_size: global font size adjuster unknown: character to use for unknown entities tab: tab stop (in cm) stop: enabled to stop processing update: how many tags between update calls tags: number of tags processed so far symbols: Symbols to use on un-ordered lists More... | |
static | HMset_state (win,...) |
static | HMrender (selfns, win, tag, not, param, text) |
HMrender gets called for every html tag win: The name of the text widget to render into tag: The html tag (in arbitrary case) not: a "/" or the empty string param: The un-interpreted parameter list text: The plain text until the next html tag. More... | |
static | HMtag_hmstart (selfns, win, param, text) |
A pair of pseudo tags are added automatically as the 1st and last html tags in the document. More... | |
static HMtag_ | hmstart (selfns, win, param, text) |
static | HMtag_title (selfns, win, param, text) |
put the document title in the window banner, and remove the title text from the document More... | |
static | HMtag_hr (selfns, win, param, text) |
static | HMtag_ol (selfns, win, param, text) |
static | HMtag_ul (selfns, win, param, text) |
static | HMtag_menu (selfns, win, param, text) |
static HMtag_ | menu (selfns, win, param, text) |
static | HMtag_dt (selfns, win, param, text) |
static | HMtag_li (selfns, win, param, text) |
static | HMtag_a (selfns, win, param, text) |
Manage hypertext "anchor" links. More... | |
static | HMgoto (selfns, win, where, callback="HMwent_to") |
The application should call here with the fragment name to cause the display to go to this spot. More... | |
static | HMwent_to (selfns, win, where, count=0, color="orange") |
We actually got to the spot, so highlight it! This should/could be replaced by the application We'll flash it orange a couple of times. More... | |
static HMtag_ | a (selfns, win, param, text) |
static | HMtag_img (selfns, win, param, text) |
Inline Images This interface is subject to change Most of the work is getting around a limitation of TK that prevents setting the size of a label to a widthxheight in pixels. More... | |
static | HMgot_image (win, image_error) |
When the image is available, the application should call back here. More... | |
static | HMlink_setup (win, href) |
We need to escape any 's in the href tag name so the bind command doesn't try to substitute them. More... | |
static | HMlink_hit (selfns, win, x, y) |
generic link-hit callback This gets called upon button hits on hypertext links Applications are expected to supply ther own HMlink_callback routine win: The name of the text widget to render into x,y: The cursor position at the "click" More... | |
static | HMcheck_tocRelative (link, tocfile) |
static | HMextract_param (param, key, val="") |
extract a value from parameter list (this needs a re-do) returns "1" if the keyword is found, "0" otherwise param: A parameter list. More... | |
static | HMstack (win, push, list) |
Push or pop tags to/from stack. More... | |
static | HMcurrent_tags (selfns, win) |
extract set of current text tags tags starting with T map directly to text tags, all others are handled specially. More... | |
static | HMx_font (family, size, weight, style, adjust_size=0) |
generate an X font name More... | |
static | HMoptimize () |
Optimize HMrender (hee hee) This is experimental. More... | |
static | HMparse_html (html, cmd="HMtest_parse", start="hmstart") |
Turn HTML into TCL commands html A string containing an html document cmd A command to run for each html tag found start The name of the dummy html start/stop tags. More... | |
static | HMtest_parse (command, tag, slash, text_after_tag) |
static | HMzap_white (data) |
Convert multiple white space into a single space. More... | |
static | HMmap_esc (text) |
find HTML escape characters of the form More... | |
static | HMdo_map (text, unknown="?") |
convert an HTML escape sequence into character More... | |
static | HMtag_isindex (selfns, win, param, text) |
html isindex tag. More... | |
static | HMsubmit_index (selfns, win, param, text) |
This is called when the isindex form is submitted. More... | |
static | HMtag_form (selfns, win, param, text) |
initialize form state. More... | |
static HMtag_ | form (selfns, win, param, text) |
Where we're done try to get all of the state into the widgets so we can free up the form structure here. More... | |
static | HMtag_input (selfns, win, param, text) |
handle form input items each item type is handled in a separate procedure Each "type" procedure needs to: More... | |
static | HMinput_text (win, param, show="") |
input type=text parameters NAME (reqd), MAXLENGTH, SIZE, VALUE More... | |
static | HMinput_password (win, param) |
password fields - same as text, only don't show data parameters NAME (reqd), MAXLENGTH, SIZE, VALUE More... | |
static | HMinput_checkbox (win, param) |
checkbuttons are missing a "get" option, so we must use a global variable to store the value. More... | |
static | HMinput_radio (win, param) |
radio buttons. More... | |
static | HMinput_hidden (win, param) |
hidden fields, just append to the "submit" data params: NAME, VALUE (reqd) More... | |
static | HMinput_image (win, param) |
handle input images. More... | |
static | HMinput_reset (win, param) |
Set up the reset button. More... | |
static | HMinput_submit (win, param) |
Set up the submit button. More... | |
static | HMtag_select (selfns, win, param, text) |
selection items They all go into a list box. More... | |
static | HMtag_option (selfns, win, param, text) |
select options The values returned in the query may be different from those displayed in the listbox, so we need to keep a separate list of query values. More... | |
static HMtag_ | select (selfns, win, param, text) |
do most of the work here! if SIZE>1, make the listbox. More... | |
static | HMtag_textarea (selfns, win, param, text) |
do a text area (multi-line text) params: COLS, NAME, ROWS (all reqd, but default rows and cols anyway) More... | |
static | HMwin_install (win, item) |
procedure to install windows into the text widget More... | |
static | HMsubmit_button (win, form_id, param, stuff) |
Assemble and submit the query each list element in "stuff" is a name/value pair. More... | |
static | HMsubmit_form (win, param, query) |
sample user callback for form submission should be replaced by the application Sample version generates a string suitable for http More... | |
static | HMmap_reply (string) |
1 leave alphanumerics characters alone 2 Convert every other character to an array lookup 3 Escape constructs that are "special" to the tcl parser 4 "subst" the result, doing all the array substitutions More... | |
static | HMcgiDecode (data) |
convert a x-www-urlencoded string int a a list of name/value pairs 1 convert a=b&c=d... More... | |
static | HMcgiMap (data) |
static | get_html (file) |
given a file name, return its html, or invent some html if the file can't be opened. More... | |
static | HMlink_callback (selfns, win, href) |
Override the library link-callback routine for the sample app. More... | |
static | HMset_image (selfns, win, handle, src) |
Supply an image callback function Read in an image if we don't already have one callback to library for display. More... | |
static | HMset_font (selfns, win, tag, font) |
downloading fonts can take a long time. More... | |
static | HMtag_color (selfns, win, param, text) |
Lets invent a new HTML tag, just for fun. More... | |
static HMtag_ | color (selfns, win, param, text) |
static | HMtag_font (selfns, win, param, text) |
Add a font size manipulation primitive, so we can use this sample program for on-line presentations. More... | |
static | HMtag_font (selfns, win, param, text) |
This version is closer to what Netscape does. More... | |
static HMtag_ | font (selfns, win, param, text) |
static | HMtag_link (selfns, win, param, text) |
static | HMload_css (selfns, win, href) |
static | HMappend_css (varName, cssBlock) |
Private Attributes | |
panes | |
PaneWindow component. More... | |
tocscroll | |
ScrolledWindow for the Table Of Contents component. More... | |
toc | |
The Table Of Contents component. More... | |
toc_css | |
The Table Of Contents stylesheet. More... | |
textscroll | |
The text area ScrolledWindow component. More... | |
helptext | |
The text area component. More... | |
helptext_css | |
The text area stylesheet. More... | |
status | |
The Help status component. More... | |
command | |
The Help command component. More... | |
Url | |
The current URL. More... | |
topicstack | |
curtopicindex | |
lastsearch | |
initialize the window and stack state More... | |
Fonts | |
Static Private Attributes | |
static | _WidgetMap |
Widget map. More... | |
static | defaultHelpDirectory |
The default help directory. More... | |
static | defaultTableOfContents |
The default Table Of Contents file. More... | |
static | defaultHelpWindow |
The default Help file. More... | |
static | HMtag_map |
static | HMinsert_map |
static | HMlist_elements |
static | HMparam_map |
static | HMevents |
static | HMform_map |
static | HMesc_map |
static | HMalphanumeric |
A widget that implements a help dialog that renders HTML coded help pages (generally generated from LaTeX using tex4ht's htlatex script).
This widget contains two panes, a narrow contents (a link menu) pane on the left and a wider help text pane on the right. Below these panes is a status label and a search text labeled entry, with a set of four buttons along the bottom.
path | Pathname of the widget. |
... | Options:
|
HTMLHelp::HTMLHelp::HTMLHelp | ( | name | , |
... | |||
) |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
Where we're done try to get all of the state into the widgets so we can free up the form structure here.
Unfortunately, we can't!
|
private |
|
staticprivate |
|
staticprivate |
given a file name, return its html, or invent some html if the file can't be opened.
|
static |
Returns the parent object given the specificed child widget.
|
static |
A public typemethod to create and launch a default help dialog.
The setDefaults typemethod must be called before this typemethod!
topic | The help topic text to display help for. |
HTMLHelp::HTMLHelp::helpTopic | ( | topic | = "Help" | ) |
Public method to display help on a specific topic.
topic | The topic text to display help for. |
|
staticprivate |
|
staticprivate |
convert a x-www-urlencoded string int a a list of name/value pairs 1 convert a=b&c=d...
to {a} {b} {c} {d}... 2, convert + to " " 3, convert xx to char equiv
|
staticprivate |
|
staticprivate |
|
staticprivate |
extract set of current text tags tags starting with T map directly to text tags, all others are handled specially.
There is an application callback, HMset_font to allow the application to do font error handling
|
staticprivate |
convert an HTML escape sequence into character
|
staticprivate |
extract a value from parameter list (this needs a re-do) returns "1" if the keyword is found, "0" otherwise param: A parameter list.
It should alredy have been processed to remove any entity references key: The parameter name val: The variable to put the value into (use key as default)
|
staticprivate |
When the image is available, the application should call back here.
If we have the image, put it in the label, otherwise display the error message. If we don't get a callback, the "alt" text remains. if we have a clickable image, arrange for a callback
|
staticprivate |
The application should call here with the fragment name to cause the display to go to this spot.
If the target exists, go there (and do the callback), otherwise schedule the goto to happen when we see the reference.
|
staticprivate |
initialize the window's state array Parameters beginning with S_ are NOT reset adjust_size: global font size adjuster unknown: character to use for unknown entities tab: tab stop (in cm) stop: enabled to stop processing update: how many tags between update calls tags: number of tags processed so far symbols: Symbols to use on un-ordered lists
|
staticprivate |
|
staticprivate |
checkbuttons are missing a "get" option, so we must use a global variable to store the value.
Parameters NAME, VALUE, (reqd), CHECKED
|
staticprivate |
hidden fields, just append to the "submit" data params: NAME, VALUE (reqd)
|
staticprivate |
handle input images.
The spec isn't very clear on these, so I'm not sure its quite right Use std image tag, only set up our own callbacks (e.g. make sure ismap isn't set) params: NAME, SRC (reqd) ALIGN
|
staticprivate |
password fields - same as text, only don't show data parameters NAME (reqd), MAXLENGTH, SIZE, VALUE
|
staticprivate |
radio buttons.
These are like check buttons, but only one can be selected
|
staticprivate |
Set up the reset button.
Wait for the /form to attach the -command option. There could be more that 1 reset button params VALUE
|
staticprivate |
Set up the submit button.
Wait for the /form to attach the -command option. There could be more that 1 submit button params: NAME, VALUE
|
staticprivate |
input type=text parameters NAME (reqd), MAXLENGTH, SIZE, VALUE
|
staticprivate |
Override the library link-callback routine for the sample app.
It only handles the simple cases.
|
staticprivate |
generic link-hit callback This gets called upon button hits on hypertext links Applications are expected to supply ther own HMlink_callback routine win: The name of the text widget to render into x,y: The cursor position at the "click"
|
staticprivate |
We need to escape any 's in the href tag name so the bind command doesn't try to substitute them.
|
staticprivate |
|
staticprivate |
find HTML escape characters of the form
|
staticprivate |
1 leave alphanumerics characters alone 2 Convert every other character to an array lookup 3 Escape constructs that are "special" to the tcl parser 4 "subst" the result, doing all the array substitutions
|
staticprivate |
Optimize HMrender (hee hee) This is experimental.
|
staticprivate |
Turn HTML into TCL commands html A string containing an html document cmd A command to run for each html tag found start The name of the dummy html start/stop tags.
|
staticprivate |
HMrender gets called for every html tag win: The name of the text widget to render into tag: The html tag (in arbitrary case) not: a "/" or the empty string param: The un-interpreted parameter list text: The plain text until the next html tag.
|
staticprivate |
reset the state of window - get ready for the next page remove all but the font tags, and remove all form state
|
staticprivate |
downloading fonts can take a long time.
We'll override the default font-setting routine to permit better user feedback on fonts. We'll keep our own list of installed fonts on the side, to guess when delays are likely
|
staticprivate |
Supply an image callback function Read in an image if we don't already have one callback to library for display.
|
staticprivate |
set the indent spacing (in cm) for lists TK uses a "weird" tabbing model that causes \t to insert a single space if the current line position is past the tab setting
|
staticprivate |
|
staticprivate |
Push or pop tags to/from stack.
Each orthogonal text property has its own stack, stored as a list. The current (most recent) tag is the last item on the list. Push is {} for pushing and {/} for popping
|
staticprivate |
|
staticprivate |
Assemble and submit the query each list element in "stuff" is a name/value pair.
|
staticprivate |
sample user callback for form submission should be replaced by the application Sample version generates a string suitable for http
|
staticprivate |
This is called when the isindex form is submitted.
The default version calls HMlink_callback. Isindex tags should either be deprecated, or fully supported (e.g. they need an href parameter)
|
staticprivate |
Manage hypertext "anchor" links.
A link can be either a source (href) a destination (name) or both. If its a source, register it via a callback, and set its default behavior. If its a destination, check to see if we need to go there now, as a result of a previous HMgoto request. If so, schedule it to happen with the closing </a> tag, so we can highlight the text up to the </a>.
|
staticprivate |
Lets invent a new HTML tag, just for fun.
Change the color of the text. Use html tags of the form: <color value=blue>> ... </color> We can invent a new tag for the display stack. If it starts with "T" it will automatically get mapped directly to a text widget tag.
|
staticprivate |
|
staticprivate |
Add a font size manipulation primitive, so we can use this sample program for on-line presentations.
sizes prefixed with + or - are relative. <font size=[+-]3> ..... </font>. Note that this is not the same as Netscape's <font> tag.
|
staticprivate |
This version is closer to what Netscape does.
|
staticprivate |
initialize form state.
All of the state for this form is kept in a global array whose name is stored in the form_id field of the main window array. Parameters: ACTION, METHOD, ENCTYPE
|
staticprivate |
A pair of pseudo tags are added automatically as the 1st and last html tags in the document.
The default is <HMstart> and </HMstart>. Append enough blank space at the end of the text widget while rendering so HMgoto can place the target near the top of the page, then remove the extra space when done rendering.
|
staticprivate |
|
staticprivate |
Inline Images This interface is subject to change Most of the work is getting around a limitation of TK that prevents setting the size of a label to a widthxheight in pixels.
Images have the following parameters: align: top,middle,bottom alt: alternate text ismap: A clickable image map src: The URL link Netscape supports (and so do we) width: A width hint (in pixels) height: A height hint (in pixels) border: The size of the window border
|
staticprivate |
handle form input items each item type is handled in a separate procedure Each "type" procedure needs to:
|
staticprivate |
html isindex tag.
Although not strictly forms, they're close enough to be in this file is-index forms make a frame with a label, entry, and submit button
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
select options The values returned in the query may be different from those displayed in the listbox, so we need to keep a separate list of query values.
form(select_default) - contains the default query value form(select_frame) - name of the listbox's containing frame form(select_values) - list of query values params: VALUE, SELECTED
|
staticprivate |
selection items They all go into a list box.
We don't what to do with the listbox until we know how many items end up in it. Gather up the data for the "options" and finish up in the /select tag params: NAME (reqd), MULTIPLE, SIZE
|
staticprivate |
do a text area (multi-line text) params: COLS, NAME, ROWS (all reqd, but default rows and cols anyway)
|
staticprivate |
put the document title in the window banner, and remove the title text from the document
|
staticprivate |
|
staticprivate |
|
staticprivate |
We actually got to the spot, so highlight it! This should/could be replaced by the application We'll flash it orange a couple of times.
|
staticprivate |
procedure to install windows into the text widget
|
staticprivate |
generate an X font name
|
staticprivate |
Convert multiple white space into a single space.
|
staticprivate |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
staticprivate |
do most of the work here! if SIZE>1, make the listbox.
Otherwise make a "drop-down" listbox with a label in it If the # of items > size, add a scroll bar This should probably be broken up into callbacks to make it easier to override the "look".
|
static |
A public typemethod to set the default values for the -helpdirectory and -tableofcontents options.
helpdir | The default value for -helpdirectory. |
toc | The default value for -tableofcontents. |
|
staticprivate |
Widget map.
|
private |
The Help command component.
|
private |
|
staticprivate |
The default help directory.
|
staticprivate |
The default Help file.
|
staticprivate |
The default Table Of Contents file.
|
private |
|
private |
The text area component.
|
private |
The text area stylesheet.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
initialize the window and stack state
html forms management commands
manage the display of html
|
private |
PaneWindow component.
|
private |
The Help status component.
|
private |
The text area ScrolledWindow component.
|
private |
The Table Of Contents component.
|
private |
The Table Of Contents stylesheet.
|
private |
ScrolledWindow for the Table Of Contents component.
|
private |
|
private |
The current URL.