\hy-9{0}{
}




\hy-5{2}{Manual for hyText 1.0: a hypertext library for wxWindows}

\hy-6{3}{Julian Smart
Artificial Intelligence Applications Institute

University of Edinburgh
EH1 1HN}

April 1993






\hy-5{1}{

Contents

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

\hy-6{6}{Introduction}

\hy-6{22}{hyText Class Reference}


\hy-10{5}{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{7}{Introduction}


\hy-8{8}{What is hyText?}

\hy-8{12}{Description}

\hy-8{16}{File format}


\hy-10{23}{hyText Class Reference}


The member functions are given in alphabetical order except for the
constructors and destructors which appear first.

\hy-8{24}{wxHTMappingStructure: wxObject}

\hy-8{47}{wxHyperTextMapping: wxList}

\hy-8{91}{wxHyperTextWindow: wxCanvas}

\hy-8{420}{wxTextChunk: wxObject}


\hy-10{9}{What is hyText?}

This manual describes in detail the operation of the hyText library.
hyText is a general-purpose hypertext library capable of displaying
text with arbitrary blocks highlighted using different fonts and
colours; an example of a hyText application is wxHelp.

This document is incomplete at present, but will be expanded when time
permits. Most information is contained in the class reference section.
The best way to use this library is to play with wxHelp, browse
through the class reference (also available on-line as hytext.xlp) and
then examine the wxHelp source (\hy-14{10}{wxhelp.h} and \hy-14{11}{wxhelp.cc}).


\hy-10{13}{Description}

The hyText class library is intended for wxWindows programmers who
need hypertext functionality, that is, the ability to display text
with highlighted words and phrases, with the ability to associate
functionality with these blocks (such as viewing further information).
A high-level API (Application Programming Interface) is provided
to make these kinds of application easy to write.

wxHelp is one such application. Other possible applications include
transcript editors and text output facilities within larger programs.

The main class in this library is \hy-8{14}{wxHyperTextWindow}, which is a
type of canvas handles repainting, stores text, and supplies most of
the API for manipulating hypertext files.

Before files may be displayed, the programmer must define a mapping
between the integer block types and the font and colour styles which
characterise text blocks. See the class reference for details, and \hy-14{15}{wxhelp.cc} for
examples.


\hy-10{17}{File format}

An hyText file (usual extension \hy-14{18}{.xlp}) consists of plain ASCII
text, with blocks marked with codes as in the following:

\hy-14{19}{  \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 (an instance of \hy-8{20}{wxHyperTextMapping}).

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{21}{\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.

This index is only stored and read by hyText, and must be accessed by
the application in order to allow the user to actually traverse links.


\hy-10{25}{wxHTMappingStructure: wxObject}

This class is used for storing mapping information for a block type.

\hy-8{26}{wxHTMappingStructure::wxHTMappingStructure}

\hy-8{38}{wxHTMappingStructure::~wxHTMappingStructure}

\hy-8{41}{wxHTMappingStructure::Copy}

\hy-8{44}{wxHTMappingStructure::GetFont}


\hy-10{48}{wxHyperTextMapping: wxList}

An object of this class stores a list of block mapping structures. The
programmer needs to call \hy-8{49}{wxHyperTextWindow::SetMapping} with an
object of this class, to specify how blocks are interpreted; several
instances of \hy-8{50}{wxHyperTextWindow} could make use of the same \hy-8{51}{
wxHyperTextMapping}.

\hy-8{52}{wxHyperTextMapping::wxHyperTextMapping}

\hy-8{55}{wxHyperTextMapping::~wxHyperTextMapping}

\hy-8{58}{wxHyperTextMapping::AddMapping}

\hy-8{72}{wxHyperTextMapping::ClearMapping}

\hy-8{75}{wxHyperTextMapping::FindByName}

\hy-8{79}{wxHyperTextMapping::GetMapping}


\hy-10{92}{wxHyperTextWindow: wxCanvas}

Objects of this class represent a canvas on which hypertext files are
drawn.  Most of the functionality of the library is accessed through
this class.

Note that the class defines behaviour for \hy-8{93}{OnEvent} and \hy-8{94}{OnPaint}.

\hy-8{95}{wxHyperTextWindow::wxHyperTextWindow}

\hy-8{105}{wxHyperTextWindow::~wxHyperTextWindow}

\hy-8{108}{wxHyperTextWindow::AddBlock}

\hy-8{119}{wxHyperTextWindow::ClearBlock}

\hy-8{125}{wxHyperTextWindow::ClearFile}

\hy-8{128}{wxHyperTextWindow::Compile}

\hy-8{136}{wxHyperTextWindow::DiscardEdits}

\hy-8{140}{wxHyperTextWindow::DisplayFile}

\hy-8{144}{wxHyperTextWindow::DisplayFileAt}

\hy-8{151}{wxHyperTextWindow::DisplayFileAtTop}

\hy-8{154}{wxHyperTextWindow::DisplayNextSection}

\hy-8{157}{wxHyperTextWindow::DisplayPreviousSection}

\hy-8{160}{wxHyperTextWindow::DrawOutline}

\hy-8{167}{wxHyperTextWindow::FindBlock}

\hy-8{171}{wxHyperTextWindow::FindBlockForSection}

\hy-8{178}{wxHyperTextWindow::FindChunkAtBlock}

\hy-8{184}{wxHyperTextWindow::FindChunkAtLine}

\hy-8{190}{wxHyperTextWindow::FindPosition}

\hy-8{198}{wxHyperTextWindow::GenerateId}

\hy-8{201}{wxHyperTextWindow::GetBlockText}

\hy-8{213}{wxHyperTextWindow::GetBlockType}

\hy-8{217}{wxHyperTextWindow::GetCurrentSectionNumber}

\hy-8{220}{wxHyperTextWindow::GetEditMode}

\hy-8{223}{wxHyperTextWindow::GetFirstSelection}

\hy-8{227}{wxHyperTextWindow::GetLinkTable}

\hy-8{232}{wxHyperTextWindow::GetNextSelection}

\hy-8{236}{wxHyperTextWindow::GetOffsetPosition}

\hy-8{247}{wxHyperTextWindow::GetTitle}

\hy-8{250}{wxHyperTextWindow::GetSpanText}

\hy-8{260}{wxHyperTextWindow::LineLength}

\hy-8{264}{wxHyperTextWindow::LoadFile}

\hy-8{268}{wxHyperTextWindow::Modified}

\hy-8{271}{wxHyperTextWindow::NoLines}

\hy-8{274}{wxHyperTextWindow::OnBeginDragLeft}

\hy-8{281}{wxHyperTextWindow::OnBeginDragRight}

\hy-8{288}{wxHyperTextWindow::OnDragLeft}

\hy-8{302}{wxHyperTextWindow::OnDragRight}

\hy-8{316}{wxHyperTextWindow::OnEndDragLeft}

\hy-8{323}{wxHyperTextWindow::OnEndDragRight}

\hy-8{330}{wxHyperTextWindow::OnLeftClick}

\hy-8{339}{wxHyperTextWindow::OnRightClick}

\hy-8{348}{wxHyperTextWindow::OnSelectBlock}

\hy-8{353}{wxHyperTextWindow::RestoreSection}

\hy-8{361}{wxHyperTextWindow::SaveFile}

\hy-8{365}{wxHyperTextWindow::SaveSection}

\hy-8{372}{wxHyperTextWindow::SelectBlock}

\hy-8{383}{wxHyperTextWindow::SetBlockType}

\hy-8{388}{wxHyperTextWindow::SetEditMode}

\hy-8{392}{wxHyperTextWindow::SetIndexWriting}

\hy-8{397}{wxHyperTextWindow::SetMapping}

\hy-8{401}{wxHyperTextWindow::SetMargins}

\hy-8{406}{wxHyperTextWindow::SetTitle}

\hy-8{410}{wxHyperTextWindow::StringSearch}


\hy-10{421}{wxTextChunk: wxObject}

This class is used for storing a text string which has all the
same font and colour attributes. The entire hypertext file is broken
up into a list of these fragments, and the \hy-8{422}{Compile} function
assigns actual font and colour attributes to each chunk.
A text chunk may also mark the start of a line (each line has
a special start line text chunk).

If a chunk represents the start of a block, the \hy-8{423}{block_id} is
this block. For chunks within a block, the \hy-8{424}{block_id} is always
the id of the block currently in scope. A text chunk which marks the
end of a block has \hy-8{425}{block_id} set to the \hy-7{426}{next} block's id,
but \hy-8{427}{end_block} set to the ending block's id. This is because a
text chunk contains the \hy-7{428}{next} fragment of text, and an end block
chunk has two purposes: to end one block, and continue another.

\hy-8{429}{wxTextChunk::wxTextChunk}

\hy-8{441}{wxTextChunk::~wxTextChunk}

\hy-8{444}{wxTextChunk::background_colour}

\hy-8{448}{wxTextChunk::block_id}

\hy-8{451}{wxTextChunk::block_type}

\hy-8{455}{wxTextChunk::chunk_type}

\hy-8{463}{wxTextChunk::colour}

\hy-8{467}{wxTextChunk::end_id}

\hy-8{471}{wxTextChunk::font}

\hy-8{475}{wxTextChunk::line_no}

\hy-8{478}{wxTextChunk::logical_op}

\hy-8{481}{wxTextChunk::selected}

\hy-8{484}{wxTextChunk::special_attribute}

\hy-8{487}{wxTextChunk::text}

\hy-8{490}{wxTextChunk::visibility}


\hy-10{27}{wxHTMappingStructure::wxHTMappingStructure}

\hy-8{28}{void wxHTMappingStructure(int \hy-8{29}{ blockType}, int \hy-8{30}{ textSize}, int \hy-8{31}{ textFamily}, int \hy-8{32}{ textStyle},

int \hy-8{33}{ textWeight}, char * \hy-8{34}{textColour}, char * \hy-8{35}{name}, int \hy-8{36}{ attribute = wxHYPER_NONE},

int \hy-8{37}{ visibility = TRUE})}

Constructor.


\hy-10{39}{wxHTMappingStructure::~wxHTMappingStructure}

\hy-8{40}{void ~wxHTMappingStructure(void)}

Destructor.


\hy-10{42}{wxHTMappingStructure::Copy}

\hy-8{43}{wxHTMappingStructure * Copy(void)}

Copies the structure.


\hy-10{45}{wxHTMappingStructure::GetFont}

\hy-8{46}{wxFont * GetFont(void)}

Finds or creates a font matching the characteristics stored in this
structure.


\hy-10{53}{wxHyperTextMapping::wxHyperTextMapping}

\hy-8{54}{void wxHyperTextMapping(void)}

Constructor.


\hy-10{56}{wxHyperTextMapping::~wxHyperTextMapping}

\hy-8{57}{void ~wxHyperTextMapping(void)}

Destructor.


\hy-10{59}{wxHyperTextMapping::AddMapping}

\hy-8{60}{void AddMapping(int \hy-8{61}{ blockType}, int \hy-8{62}{ textSize}, int \hy-8{63}{ textFamily}, int \hy-8{64}{ textStyle},

int \hy-8{65}{ textWeight}, char * \hy-8{66}{ textColour}, char * \hy-8{67}{name}, int \hy-8{68}{ attribute = -1},

int \hy-8{69}{ visibility = TRUE})}

Adds a mapping for a block type. \hy-7{70}{blockType} must be unique, and
any parameters which have the default value (-1 for integers, NULL for
strings) will be instantiated according to the context of the block.
That is, if a block is nested with another block, the outer block's
characteristics are used to fill in the default values.

See \hy-14{71}{wxhelp.cc} for examples.


\hy-10{73}{wxHyperTextMapping::ClearMapping}

\hy-8{74}{void ClearMapping(void)}

Deletes all members of the mapping list.


\hy-10{76}{wxHyperTextMapping::FindByName}

\hy-8{77}{void FindByName(char * \hy-8{78}{name})}

Finds a mapping structure by name.


\hy-10{80}{wxHyperTextMapping::GetMapping}

\hy-8{81}{Bool GetMapping(int  \hy-8{82}{blockType}, int * \hy-8{83}{ textSize}, int * \hy-8{84}{textFamily}, int * \hy-8{85}{textStyle},

int * \hy-8{86}{textWeight}, char ** \hy-8{87}{textColour}, char ** \hy-8{88}{name}, int * \hy-8{89}{attribute},

int * \hy-8{90}{visibility})}

Gets mapping values for a given block, returning FALSE if not found.


\hy-10{96}{wxHyperTextWindow::wxHyperTextWindow}

\hy-8{97}{void wxHyperTextWindow(wxFrame * \hy-8{98}{parent}, int \hy-8{99}{ x}, int \hy-8{100}{ y},
int \hy-8{101}{ w}, int \hy-8{102}{ h}, int \hy-8{103}{ style})}

Constructor; for details see \hy-8{104}{wxCanvas} in the wxWindows class reference.


\hy-10{106}{wxHyperTextWindow::~wxHyperTextWindow}

\hy-8{107}{void ~wxHyperTextWindow(void)}

Destructor.


\hy-10{109}{wxHyperTextWindow::AddBlock}

\hy-8{110}{Bool AddBlock(int \hy-8{111}{ xStart}, int \hy-8{112}{ yStart}, int \hy-8{113}{ xEnd}, int \hy-8{114}{ yEnd}, int \hy-8{115}{ blockType}, int \hy-8{116}{ blockId})}

Adds a block from the first row/column to the second row/column, with
given type and unique identifier. The display will not change until
the functions \hy-8{117}{Compile} and \hy-8{118}{DisplayFileAt} are called.


\hy-10{120}{wxHyperTextWindow::ClearBlock}

\hy-8{121}{Bool ClearBlock(int \hy-8{122}{ blockId})}

Clears the given block. The display will not change until the
functions \hy-8{123}{Compile} and \hy-8{124}{DisplayFileAt} are called.


\hy-10{126}{wxHyperTextWindow::ClearFile}

\hy-8{127}{void ClearFile(void)}

Clears the current hypertext file.


\hy-10{129}{wxHyperTextWindow::Compile}

\hy-8{130}{void Compile(void)}

Compiles the current hypertext file, that is, traverses the block
structure of the file associating actual fonts and other attributes to
text chunks. This must be done before a file may be displayed, and may
also require the functions \hy-8{131}{SaveSection} and \hy-8{132}{RestoreSection}
to be called in order to save and restore the current position in the
file, since compilation destroys section pointers.

After a \hy-8{133}{Compile} (which is necessary after marking up or any
operation which affects the display) the file must be displayed with
\hy-8{134}{DisplayFileAt} or \hy-8{135}{RestoreSection}.


\hy-10{137}{wxHyperTextWindow::DiscardEdits}

\hy-8{138}{void DiscardEdits(void)}

Discards any edits (just sets the internal \hy-7{139}{modified} flag to FALSE).


\hy-10{141}{wxHyperTextWindow::DisplayFile}

\hy-8{142}{void DisplayFile(void)}

Draw the text at the point found by \hy-8{143}{DisplayFileAt}.


\hy-10{145}{wxHyperTextWindow::DisplayFileAt}

\hy-8{146}{void DisplayFileAt(long \hy-8{147}{ blockId}, Bool  \hy-8{148}{refresh = TRUE})}

Positions the file at the given block, drawing the text only if \hy-7{149}{refresh} is TRUE.
If \hy-7{150}{blockId} is -1, the file is displayed at the top.


\hy-10{152}{wxHyperTextWindow::DisplayFileAtTop}

\hy-8{153}{void DisplayFileAtTop(void)}

Displays the file at the top (first section).


\hy-10{155}{wxHyperTextWindow::DisplayNextSection}

\hy-8{156}{void DisplayNextSection(void)}

Finds and displays the next section.


\hy-10{158}{wxHyperTextWindow::DisplayPreviousSection}

\hy-8{159}{void DisplayPreviousSection(void)}

Finds and displays the previous section.


\hy-10{161}{wxHyperTextWindow::DrawOutline}

\hy-8{162}{void DrawOutline(float \hy-8{163}{ x1}, float \hy-8{164}{ y1}, float \hy-8{165}{ x2}, float \hy-8{166}{ y2})}

Draws a rectangular outline for rubber-banding using the given
top-left and bottom-right coordinates


\hy-10{168}{wxHyperTextWindow::FindBlock}

\hy-8{169}{wxTextChunk * FindBlock(long \hy-8{170}{ blockId})}

For a given block id, returns the text chunk at the start of the
block.


\hy-10{172}{wxHyperTextWindow::FindBlockForSection}

\hy-8{173}{long FindBlockForSection(wxNode * \hy-8{174}{sectionNode})}

Pointers to blocks which mark sections are stored in the data member
\hy-8{175}{sections}. This function takes a node which is known to point
to a text chunk marking a block, and returns the block id.
This is a fairly trivial function since it just gets the \hy-8{176}{wxTextChunk}
from the node and returns its \hy-8{177}{block_id}.


\hy-10{179}{wxHyperTextWindow::FindChunkAtBlock}

\hy-8{180}{wxNode * FindChunkAtBlock(long \hy-8{181}{ blockId})}

For a given block id, returns the position in the text chunks list of
the first CHUNK_START_LINE chunk before the block.  A \hy-8{182}{wxNode}
pointer is returned to allow the programmer to efficiently traverse
the text chunks list from this point. The data stored in this node is
a \hy-8{183}{wxTextChunk} object.

This function may not be very useful for programmers; it is mainly for
internal use. Normally functions returning and taking block ids
are used for manipulating blocks.


\hy-10{185}{wxHyperTextWindow::FindChunkAtLine}

\hy-8{186}{wxNode * FindChunkAtLine(long \hy-8{187}{ blockId})}

For a given block id, returns the position in the text chunks list of
the first chunk on the given line.  A \hy-8{188}{wxNode} pointer is returned
to allow the programmer to efficiently traverse the text chunks list
from this point. The data stored in this node is a \hy-8{189}{wxTextChunk}
object.

This function may not be very useful for programmers; it is mainly for
internal use. Normally functions returning and taking block ids
are used for manipulating blocks.


\hy-10{191}{wxHyperTextWindow::FindPosition}

\hy-8{192}{Bool FindPosition(float \hy-8{193}{ mouseX}, float \hy-8{194}{ mouseY}, int * \hy-8{195}{charPos}, int * \hy-8{196}{linePos}, long * \hy-8{197}{blockId})}

Finds the character and line position of the given point, plus the id of the block found.
Returns FALSE if no character was found at this position.


\hy-10{199}{wxHyperTextWindow::GenerateId}

\hy-8{200}{long GenerateId(void)}

Generates a unique identifier for a block; may be overridden to supply
a different generator.


\hy-10{202}{wxHyperTextWindow::GetBlockText}

\hy-8{203}{void GetBlockText(char * \hy-8{204}{buffer}, int \hy-8{205}{ maxSize}, long \hy-8{206}{ blockId})}

\hy-8{207}{void GetBlockText(char * \hy-8{208}{buffer}, int \hy-8{209}{ maxSize}, wxNode * \hy-8{210}{node}, long \hy-8{211}{ blockId})}

Gets the plain text bounded by the given block, stripping out any
block codes.  The second form is more efficient since it takes a node
containing a pointer to the \hy-8{212}{wxTextChunk}, and doesn't have to
search for the block.


\hy-10{214}{wxHyperTextWindow::GetBlockType}

\hy-8{215}{int GetBlockType(long \hy-8{216}{ blockId})}

Gets the type of the given block.


\hy-10{218}{wxHyperTextWindow::GetCurrentSectionNumber}

\hy-8{219}{int GetCurrentSectionNumber(void)}

Gets the number of the currently-displayed section, starting from 1. Zero is returned
if there are no section markers.


\hy-10{221}{wxHyperTextWindow::GetEditMode}

\hy-8{222}{Bool GetEditMode(void)}

Returns TRUE if the hypertext window is editable.


\hy-10{224}{wxHyperTextWindow::GetFirstSelection}

\hy-8{225}{long GetFirstSelection(void)}

Gets the first block selected. Use \hy-8{226}{GetNextSelection} for subsequent
blocks. Returns -1 if no more selections.


\hy-10{228}{wxHyperTextWindow::GetLinkTable}

\hy-8{229}{wxHashTable * GetLinkTable(void)}

Returns the hypertext window's hash table used for storing links
between blocks. Objects of type \hy-8{230}{HypertextItem} are stored in the
table, containing a destination filename and destination block id;
these objects must be indexed by the source block id, to store a link
between a source block and destination block.

This is only relevant if using the built-in index facility, rather than
implementing your own index. You need to put and get explicitly, and writing
to a file will use this table for saving the index. For example:

\hy-14{231}{  if (GetLinkTable()->Get(block_id))
    MainFrame->SetStatusText("This block already linked!");
  else if (hySelection->block_id > -1)
  {
    GetLinkTable()->Put(block_id,
      new HypertextItem(hySelection->filename, hySelection->block_id));
    modified = TRUE;
    SelectBlock(hySelection->block_id, FALSE);
    Compile();
    DisplayFile();
  }
}


\hy-10{233}{wxHyperTextWindow::GetNextSelection}

\hy-8{234}{long GetNextSelection(void)}

Gets the next  block selected (use \hy-8{235}{GetFirstSelection} to start.
Returns -1 if no more selections.


\hy-10{237}{wxHyperTextWindow::GetOffsetPosition}

\hy-8{238}{Bool GetOffsetPosition(int  \hy-8{239}{line1}, int  \hy-8{240}{char1},

  int  \hy-8{241}{offset}, int * \hy-8{242}{line2}, int * \hy-8{243}{char2})}

Gets the line number and character position of the point which is \hy-7{244}{offset}
number of characters from the given point. The position is returned in \hy-7{245}{line2}
and \hy-7{246}{char2}.

Returns FALSE if it failed for any reason.


\hy-10{248}{wxHyperTextWindow::GetTitle}

\hy-8{249}{char * GetTitle(void)}

Returns NULL or the title (pointer to the hypertext window's local memory).


\hy-10{251}{wxHyperTextWindow::GetSpanText}

\hy-8{252}{void GetSpanText(char * \hy-8{253}{buffer}, int \hy-8{254}{ maxSize},

  int \hy-8{255}{ line1}, int \hy-8{256}{ char1}, int \hy-8{257}{ line2}, int \hy-8{258}{ char2},

  Bool \hy-8{259}{ convertNewLinesToSpaces = FALSE})}

Gets the plain text bounded by two line/character positions, stripping out any
block codes. The final parameter allows the user to get text in a form
that can be matched against a string with no newlines; the newlines are converted
to spaces. If this is FALSE, a ASCII code 10 will be inserted for
each newline.


\hy-10{261}{wxHyperTextWindow::LineLength}

\hy-8{262}{int LineLength(int \hy-8{263}{lineNo})}

Returns the length of the specified line, or -1 if there is no such
line.


\hy-10{265}{wxHyperTextWindow::LoadFile}

\hy-8{266}{Bool LoadFile(char * \hy-8{267}{file})}

Loads the named file.


\hy-10{269}{wxHyperTextWindow::Modified}

\hy-8{270}{Bool Modified(void)}

Returns true if the user has modified the text.


\hy-10{272}{wxHyperTextWindow::NoLines}

\hy-8{273}{int NoLines(void)}

Returns the current number of lines in the window.


\hy-10{275}{wxHyperTextWindow::OnBeginDragLeft}

\hy-8{276}{void OnBeginDragLeft(float \hy-8{277}{ x}, float \hy-8{278}{ y}, long \hy-8{279}{ blockId}, int \hy-8{280}{ keys})}

Called when the user starts to left-drag. Overrideable.


\hy-10{282}{wxHyperTextWindow::OnBeginDragRight}

\hy-8{283}{void OnBeginDragRight(float \hy-8{284}{ x}, float \hy-8{285}{ y}, long \hy-8{286}{ blockId}, int \hy-8{287}{ keys})}

Called when the user starts to right-drag. Overrideable.


\hy-10{289}{wxHyperTextWindow::OnDragLeft}

\hy-8{290}{void OnDragLeft(Bool \hy-8{291}{ draw}, float \hy-8{292}{ x}, float \hy-8{293}{ y}, long \hy-8{294}{ blockId}, int \hy-8{295}{ keys})}

Called when the user is in the middle of a drag operation; called once
with \hy-7{296}{draw} equal to FALSE and with \hy-7{297}{x} and \hy-7{298}{y} equal to
the old values, then again with \hy-7{299}{draw} equal to TRUE and updated
\hy-7{300}{x} and \hy-7{301}{y} (to allow erase/draw operations).


\hy-10{303}{wxHyperTextWindow::OnDragRight}

\hy-8{304}{void OnDragRight(Bool \hy-8{305}{ draw}, float \hy-8{306}{ x}, float \hy-8{307}{ y}, long \hy-8{308}{ blockId}, int \hy-8{309}{ keys})}

Called when the user is in the middle of a drag operation; called once
with \hy-7{310}{draw} equal to FALSE and with \hy-7{311}{x} and \hy-7{312}{y} equal to
the old values, then again with \hy-7{313}{draw} equal to TRUE and updated
\hy-7{314}{x} and \hy-7{315}{y} (to allow erase/draw operations).


\hy-10{317}{wxHyperTextWindow::OnEndDragLeft}

\hy-8{318}{void OnEndDragLeft(float \hy-8{319}{ x}, float \hy-8{320}{ y}, long \hy-8{321}{ blockId}, int \hy-8{322}{ keys})}

Called when the user finishes left-dragging. Overrideable.


\hy-10{324}{wxHyperTextWindow::OnEndDragRight}

\hy-8{325}{void OnEndDragRight(float \hy-8{326}{ x}, float \hy-8{327}{ y}, long \hy-8{328}{ blockId}, int \hy-8{329}{ keys})}

Called when the user finishes right-dragging. Overrideable.


\hy-10{331}{wxHyperTextWindow::OnLeftClick}

\hy-8{332}{void OnLeftClick(float \hy-8{333}{ x}, float \hy-8{334}{ y}, int \hy-8{335}{ charPos}, int \hy-8{336}{ linePos}, long \hy-8{337}{ blockId}, int \hy-8{338}{ keys})}

Called when the user left-clicks. Overrideable. The default behaviour when SHIFT is held down
is to select or deselect the mouse-over block.


\hy-10{340}{wxHyperTextWindow::OnRightClick}

\hy-8{341}{void OnRightClick(float \hy-8{342}{ x}, float \hy-8{343}{ y}, int \hy-8{344}{ charPos}, int \hy-8{345}{ linePos}, long \hy-8{346}{ blockId}, int \hy-8{347}{ keys})}

Called when the user right-clicks. Overrideable.


\hy-10{349}{wxHyperTextWindow::OnSelectBlock}

\hy-8{350}{void OnSelectBlock(long \hy-8{351}{ blockId}, Bool \hy-8{352}{ select})}

Called whenever a block is selected or deselected. Overridable.


\hy-10{354}{wxHyperTextWindow::RestoreSection}

\hy-8{355}{void RestoreSection(void)}

When a call is made to \hy-8{356}{Compile}, the current pointer to the current
section becomes invalid, since all sections are recalculated. You need
to \hy-8{357}{SaveSection} before \hy-8{358}{Compile}, followed by \hy-8{359}{RestoreSection} after
the \hy-8{360}{Compile}, in order to restore the display to the previous state.


\hy-10{362}{wxHyperTextWindow::SaveFile}

\hy-8{363}{Bool SaveFile(char * \hy-8{364}{file})}

Saves the hypertext file and index.


\hy-10{366}{wxHyperTextWindow::SaveSection}

\hy-8{367}{void SaveSection(void)}

When a call is made to \hy-8{368}{Compile}, the current pointer to the current
section becomes invalid, since all sections are recalculated. You need
to call this before \hy-8{369}{Compile}, followed by \hy-8{370}{RestoreSection} after
the \hy-8{371}{Compile}, in order to restore the display to the previous state.


\hy-10{373}{wxHyperTextWindow::SelectBlock}

\hy-8{374}{void SelectBlock(wxTextChunk * \hy-8{375}{ block}, Bool \hy-8{376}{ select = TRUE})}

\hy-8{377}{void SelectBlock(long \hy-8{378}{ blockId}, Bool \hy-8{379}{ select = TRUE})}

If \hy-7{380}{select} is TRUE, select the existing block, marking it in cyan
(colour screens) or in inverse video (monochrome screens).  If \hy-7{381}{
select} is FALSE, deselect the block. The first form is more efficient
since no search need be done for the block.

Note that \hy-8{382}{Compile} must be called before this call has any visible effect.


\hy-10{384}{wxHyperTextWindow::SetBlockType}

\hy-8{385}{void SetBlockType(long \hy-8{386}{ blockId}, int \hy-8{387}{ blockType})}

Set the specified block to have the given type.


\hy-10{389}{wxHyperTextWindow::SetEditMode}

\hy-8{390}{void SetEditMode(Bool \hy-8{391}{ editable})}

Specifies whether the user should be able to mark up the text or not.


\hy-10{393}{wxHyperTextWindow::SetIndexWriting}

\hy-8{394}{void SetIndexWriting(Bool \hy-8{395}{ indexWriting})}

Specifies whether the built-in index and title should be written when
\hy-8{396}{SaveFile} is called. The default is FALSE.


\hy-10{398}{wxHyperTextWindow::SetMapping}

\hy-8{399}{void SetMapping(wxHyperTextMapping * \hy-8{400}{mapping})}

Specify the set of block mappings for this window; this must be called.


\hy-10{402}{wxHyperTextWindow::SetMargins}

\hy-8{403}{void SetMargins(int \hy-8{404}{ left}, int \hy-8{405}{ top})}

Sets the margins to leave to the left and top of the canvas when
displaying text.


\hy-10{407}{wxHyperTextWindow::SetTitle}

\hy-8{408}{void SetTitle(char * \hy-8{409}{title})}

Sets the title of the hypertext window (allocates its own memory), to be written
to the index file if index writing mode is on.


\hy-10{411}{wxHyperTextWindow::StringSearch}

\hy-8{412}{Bool StringSearch(char * \hy-8{413}{searchString}, int * \hy-8{414}{linePos},

  int * \hy-8{415}{charPos}, Bool  \hy-8{416}{ignoreCase = TRUE})}

Search for a string from the given position. If the search matches,
the values of the \hy-7{417}{linePos} and \hy-7{418}{charPos} arguments will be
set to the start of the matching string, and the function returns TRUE.

If there are no (more) matches, the functions returns FALSE.

If \hy-7{419}{ignoreCase} is TRUE, case is ignored, otherwise an exact match
is required.

In this function, newlines in the hypertext are converted to spaces, increasing
the chance of matching a phrase across newline boundaries.


\hy-10{430}{wxTextChunk::wxTextChunk}

\hy-8{431}{void wxTextChunk(int \hy-8{432}{ chunkType}, int \hy-8{433}{ lineNumber}, char * \hy-8{434}{text}, wxFont * \hy-8{435}{font},

wxColour * \hy-8{436}{colour}, int \hy-8{437}{ blockType}, long \hy-8{438}{ blockId}, int \hy-8{439}{ attribute}, Bool \hy-8{440}{ visibility})}

Constructor. Used only internally.


\hy-10{442}{wxTextChunk::~wxTextChunk}

\hy-8{443}{void ~wxTextChunk(void)}

Destructor. Used only internally.


\hy-10{445}{wxTextChunk::background_colour}

\hy-8{446}{wxColour * background_colour}

The background colour allocated for the chunk by \hy-8{447}{Compile}.


\hy-10{449}{wxTextChunk::block_id}

\hy-8{450}{long block_id}

Id of the block associated with the text in the chunk.


\hy-10{452}{wxTextChunk::block_type}

\hy-8{453}{int block_type}

Block type, an integer defined by the application using a \hy-8{454}{wxHyperTextMapping}
object.


\hy-10{456}{wxTextChunk::chunk_type}

\hy-8{457}{int chunk_type}

The \hy-8{458}{chunk_type} data member may be one of:


\hy-8{459}{o}  CHUNK_START_BLOCK
\hy-8{460}{o}  CHUNK_START_UNRECOGNIZED_BLOCK
\hy-8{461}{o}  CHUNK_END_BLOCK
\hy-8{462}{o}  CHUNK_START_BLOCK



\hy-10{464}{wxTextChunk::colour}

\hy-8{465}{wxColour * colour}

The foreground colour allocated for the chunk by \hy-8{466}{Compile}.


\hy-10{468}{wxTextChunk::end_id}

\hy-8{469}{long end_id}

Id of the block which has just ended, if the type of this chunk is CHUNK_END_BLOCK.
\hy-8{470}{block_id} is the id of block which has come into scope, and which starts with the
text stored in the chunk.


\hy-10{472}{wxTextChunk::font}

\hy-8{473}{wxFont * font}

The font allocated for the chunk by \hy-8{474}{Compile}.


\hy-10{476}{wxTextChunk::line_no}

\hy-8{477}{int line_no}

The line number for this chunk.


\hy-10{479}{wxTextChunk::logical_op}

\hy-8{480}{int logical_op}

The logical operator for this chunk.


\hy-10{482}{wxTextChunk::selected}

\hy-8{483}{Bool selected}

For chunks which start a block, TRUE if the block is currently selected.


\hy-10{485}{wxTextChunk::special_attribute}

\hy-8{486}{int special_attribute}

For a block-starting chunk, specifies one or more special attributes ORed together.
There is currently only one such attribute, wxHYPER_SECTION, which
if present indicates that the block starts a new section.


\hy-10{488}{wxTextChunk::text}

\hy-8{489}{char * text}

The actual text in the chunk.


\hy-10{491}{wxTextChunk::visibility}

\hy-8{492}{Bool visibility}

For a block-starting chunk, determines whether the chunk is visible.




\hyindex{
"hyText Manual"
4 5
6 7
8 9
12 13
16 17
22 23
24 25
26 27
38 39
41 42
44 45
47 48
52 53
55 56
58 59
72 73
75 76
79 80
91 92
95 96
105 106
108 109
119 120
125 126
128 129
136 137
140 141
144 145
151 152
154 155
157 158
160 161
167 168
171 172
178 179
184 185
190 191
198 199
201 202
213 214
217 218
220 221
223 224
227 228
232 233
236 237
247 248
250 251
260 261
264 265
268 269
271 272
274 275
281 282
288 289
302 303
316 317
323 324
330 331
339 340
348 349
353 354
361 362
365 366
372 373
383 384
388 389
392 393
397 398
401 402
406 407
410 411
420 421
429 430
441 442
444 445
448 449
451 452
455 456
463 464
467 468
471 472
475 476
478 479
481 482
484 485
487 488
490 491
}
