45 lines
30 KiB
Plaintext
45 lines
30 KiB
Plaintext
en·vÅos EQUATIONEDITOR
|
||
2
|
||
|
||
4
|
||
|
||
1
|
||
|
||
EQUATIONEDITOR
|
||
1
|
||
|
||
4
|
||
|
||
PROGRAMMER'S GUIDE
|
||
By: Tad Hogg (Hogg.pa@Xerox.com)
|
||
DESCRIPTION
|
||
This document describes how to define new kinds of equations to be used with the equation editor in TEdit, and how to construct equation image objects by function calls.
|
||
User Switches:
|
||
The global variable EquationDefaultSelectionFn specifies the default function to be called when an equation is selected with the middle mouse button. The initial value, EQIO.DefaultSelectFn, allows the user to select a piece of the equation by selecting from a menu.
|
||
The global variable UnknownEquationData is a formated string to use for displaying equations whose types are not defined.
|
||
The global variable EquationInfo is used to record all currently defined equation types. The specification information can be obtained by calling
|
||
(EQIO.GetInfo type info) [Function]
|
||
which returns the specified info for equations of the given type. Any of the PROPS mentioned below for EQIO.AddType, or formFn or numPieces, can be used as a value for info to get the corresponding data for this type of equation. Example: (EQIO.GetInfo 'fraction 'numPieces) returns the number of pieces in a fraction.
|
||
Individual specification items of an existing equation type can be modified using
|
||
(EQIO.SetInfo type info newValue) [Function]
|
||
although the caller must be sure that any new information is consistent with the remaining properties. For example, (EQIO.SetInfo 'fraction 'menuLabel myLabel) will make the value of myLabel be used for fractions in the equation type menu.
|
||
Defining new kinds of equations:
|
||
This module allows new types of equations to be defined. An equation consists of some number of pieces of text and, perhaps, some extra symbols or lines. A method for computing the relative position of the various pieces must be specified when new equation types are used. The pieces of equations consist of "formatted strings" which allow font information to be associated with strings and can also include image objects (which thus allows equations to contain other equations). Formatted strings are described below. Additional properties can be specified to determine the particular behavior of the new equation.
|
||
Additionally, a function can be provided to allow equations of the new type to be created under program control. Typically these are named EQ.Make.xxx where xxx = atom specifying the equation type.
|
||
Specifically, a new equation type (or a new definition for an existing type) is created by calling
|
||
(EQIO.AddType type formFn numPieces PROPS) [Function]
|
||
where
|
||
ÿÿ |