\hy-9{0}{
}



\hy-5{2}{\hy-8{3}{Manual for wxHelp 1.40:
A hypertext help system for wxWindows
}}

\hy-6{4}{Julian Smart
Knowledge Based Decision Support Group
Artificial Intelligence Applications Institute
80 South Bridge
University of Edinburgh
EH1 1HN

April 1993}

\hy-5{1}{

Contents

}
\hy-6{5}{Copyright notice}

\hy-6{7}{Introduction}

\hy-6{24}{Editing}

\hy-6{38}{Accessing wxHelp from other applications}


\hy-10{6}{Copyright notice}

Copyright (c) 1993 Artificial Intelligence Applications Institute,
The University of Edinburgh


Permission to use, copy, modify, and distribute this software and its
documentation for any purpose is hereby granted without fee, provided that the
above copyright notice, author statement and this permission notice appear in
all copies of this software and related documentation.

THE SOFTWARE IS PROVIDED ``AS-IS'' AND WITHOUT WARRANTY OF ANY KIND, EXPRESS,
IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

IN NO EVENT SHALL THE ARTIFICIAL INTELLIGENCE APPLICATIONS INSTITUTE OR THE
UNIVERSITY OF EDINBURGH BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF
DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.


\hy-10{8}{Introduction}

\hy-8{9}{What is wxHelp?}

\hy-8{12}{How to use wxHelp}

\hy-8{16}{Command buttons}


\hy-10{25}{Editing}

If you start wxHelp with the -edit switch you will get more
functionality and some extra menus.

You can now highlight blocks of text by dragging with the left mouse
button, and assigning new block types to them using the Blocks menu.
If you change your mind after selecting a block, deselect the block
before dragging again or you'll have two overlapping selected blocks!
Dragging is fiddly - the rectangle must be just within the block.

Select/deselect a marked block with shift left-click: it will be
marked in cyan (or inverted on a monochrome display) if selected.

Link block A to block B by selecting B, going back to A, right-clicking
on A and selecting the Link block to selection menu item. Use
this menu to unlink or clear the block.

Find out the block type and when the block is linked with CONTROL
left-click.

You can also link blocks to blocks which are in another file, after
loading a file, selecting a block, going back the previous section
(using the Back button) and linking as per usual.

The usual way to proceed is to take an ASCII file with section
headings, then mark it up.  Or you could generate the .xlp file
automatically (as with the wxWindows help file, reconstructed from the
Latex manual.)

\hy-8{26}{File format}

\hy-8{31}{Generation of wxHelp files}


\hy-10{39}{Accessing wxHelp from other applications}

There are two main ways in which wxHelp may be used by other
applications. The simplest is via the API (Application Programmer's
Interface) included with the wxWindows system, as documented in
the reference manual under \hy-8{40}{wxHelpInstance}. The other method is
to use the DDE (Dynamic Data Exchange) commands on which the API is
built. The only reason for doing this might be to access wxHelp from
non-wxWindows applications running under Windows 3.1 (such as Visual
Basic programs).

Under UNIX, the service name (the identifier for connecting to a DDE
server) is generated at random by the API and passed to wxHelp when
running it by specifying the \hy-14{41}{-server} switch. This is not fool-proof
but usually doesn't result in a socket clash.

Under Windows, the service name is always assumed to be ``4000'',
since there is only ever one instance of wxHelp running under Windows
(a restriction of large model programming).

Listed below are the commands that wxHelp implements by means of a string
sent to it using the \hy-8{42}{Execute} DDE command. Each string comprises an initial
command letter followed by a space, followed by an argument, for example
``f help.xlp''.


\hy-8{43}{o}  \hy-8{44}{b}

Display block command. The argument is interpreted as a long integer
indicating the block id at which the file is to be displayed.
\hy-8{45}{o}  \hy-8{46}{f}

Load file command. The argument is interpreted as a filename, and the
current directory, WXHELPFILES variable and finally PATH variable are
searched for the file. If the file is still loaded, it is not
reloaded, so this command may be used to ensure that a subsequent
display command refers to the correct file.
\hy-8{47}{o}  \hy-8{48}{k}

Keyword search command. The argument is interpreted as a string for matching
against section headings. If only one matching section is found, it is displayed,
otherwise the search dialog is shown for the user to make a selection.
\hy-8{49}{o}  \hy-8{50}{s}

Display section command. The argument is interpreted as an integer
starting from 1 indicating the section number to be displayed. -1
means display from the top (by convention, the contents page).




\hy-10{10}{What is wxHelp?}

wxHelp is a help system for wxWindows programs running under X and Windows 3.
It allows the programmer to develop hypertext, browsable help which may be
invoked using the API supplied with wxWindows (see the wxWindows user manual
and \hy-8{11}{wxHelpInstance} class).  Like Windows 3 help, it allows the user to
click on words and phrases to see more detail, and search for topics matching
a keyword. Unlike Windows 3 help, ASCII files may be marked up interactively
using edit mode, and the system runs under both X and Windows 3.1


\hy-10{13}{How to use wxHelp}

When installing wxHelp, set the environment variable WXHELPFILES to
be the list of directories you wish wxHelp to search when loading a
file. wxHelp also searches the directories in the PATH variable.

To invoke wxHelp, start it on the command line with an optional
filename, e.g.

\hy-14{14}{  % wxhelp -f help.txt
}
If you specify the -edit switch, wxHelp will start up in Edit mode.

There is also a \hy-14{15}{-server} switch for specifying the numeric identifier
used by programs connecting to wxHelp (see later).

A contents page should appear, with highlighted blocks of text, some
of which are mouseable (click with the left mouse button).  Clicking
on these takes you to other parts of the help file.

Above the main text area is a panel with buttons for commonly-used
operations, and a menu bar.


\hy-10{17}{Command buttons}


\hy-8{18}{o}  Contents -- displays the first section, normally a contents page.
\hy-8{19}{o}  Search -- pops up a dialog box. The user may type a string (or an asterisk)
into the text item, press \hy-8{20}{Do Search}, and click one of the
matching section headings displayed in the listbox.
\hy-8{21}{o}  Back -- goes to the previously-visited section or block. This works across
different files, since the recorded history includes file names.
\hy-8{22}{o}  << -- goes to the previous sequential section.
\hy-8{23}{o}  >> -- goes to the next sequential section.



\hy-10{27}{File format}

A help file consists of plain ASCII text, with blocks marked with
codes as in the following:

\hy-14{28}{  \hy-X{Y}{Text}
}
where X is the block type and Y is the block identifier (unique within
a file).  The block type indicates the style of the block (font,
colour, section), where the mapping between type and style is defined
in a table in wxhelp.cc.  See the file \hy-14{29}{wxhlpblk.h} for a list
of block type constants; you may include this file into programs which
generate help files (for example).

Note that blocks may be nested, in which case any styles in an inner
block which have been the assigned `default' characteristic will
inherit the style from the outer block.

At the end of a file there is an optional index section, for example:

\hy-14{30}{\hyindex{
"wxWindows Help"
101 102 "wx.xlp"
114 115
117 118
120 121
123 124
}
}
The first line indicates the start of the index, the second line is
a title for the help file, subsequent lines (until a closing curly bracket)
indicate the link between two block identifiers, with an optional filename
after each pair of (long) integers.


\hy-10{32}{Generation of wxHelp files}

The program \hy-8{33}{tex2help} generates \hy-14{34}{.xlp} files from LaTeX
documents; in particular, it is used on \hy-14{35}{classes.tex} from the
wxWindows user manual and hyText user manual. The utility makes use of
the library \hy-8{36}{tex2any} which handles parsing and traversal of LaTeX
file structure, allowing the conversion utility to simply output
appropriate block information and text to files. Unfortunately I do
not have time to document these programs, but examination of the
source should give an idea of what's going on.

The file \hy-14{37}{wxhlpblk.h} contains block type definitions used by
wxHelp and may be included by generators to ensure blocks of the
appropriate type are generated.


\hyindex{
"WXHELPCONTENTS"
5 6
7 8
9 10
12 13
16 17
24 25
26 27
31 32
38 39
}
