btn ElementThe btn element is used to place a button on the toolbar. The contents of the element determine the image that will appear on the button and what it does. The contents of a btn element can be:
Consult the tables of Predefined Templates, Palettes, Palette Labels, and MathFlow Characters for a complete listing. When a character or character name is given as the content of the When a pre-defined template name is given, a button is created displaying a graphic representation of the template, and clicking inserts the corresponding template at the current cursor location. When an icon name is given, a button is placed on the toolbar displaying the named image. In the case of toolbox icons, the button is associated with the corresponding editor action, i.e., cut, paste, etc. However, when a non-toolbox icon name is given, i.e., "TRIGPALETTE," a button without any default action is created. Normally, one only uses these icons when creating a button to open a pull-down palette using the If a button name is not recognized, the toolbar parser will indicate the problem by creating a button displaying a red "X". When MathML is given, an image of the corresponding typeset mathematical expression is generated and placed on the button. Unless the optional When the
When creating a button to insert a character, there is an issue of what MathML code to generate. Some characters can be used as identifiers, numbers or operators, and thus should be tagged with the MI, MN, and MO MathML elements respectively. MathFlow tries to guess according to the following rules: If the character is in the MathFlow operator dictionary, it tags it as an MO. If it is a digit, it tags it as an MN. Otherwise, characters are treated as MI. By specifying a type attribute on a btn element, you can override this default behavior, and specify which element you would like to have generated. Similarly, MathFlow displays a default status line message when a reader mouses over a button on the toolbar. For characters, this default message is just the character name. For other icons and templates, the default message varies. By giving a
When using a MathML string for a button, you can differentiate the MathML used to display an image on the button from the MathML that is inserted into the editor. This allows you to "tweak" the MathML to appear correctly depending on where it is displayed. The content of the btn element indicates the MathML to be displayed on the button. The optional child element insertas indicates the MathML to be inserted into the editor.
| ||||||||||||||||||||
Copyright © 1996-2016 Design Science, Inc. All rights reserved. |