ButtonDefinitions

Synopsis

<button name="b" col="1" row="1" action="ToggleTextClass" ns="http://www.w3.org/1999/xhtml" />

Attributes

name: name of tag to insert in case of ToggleTextClass action else "just" a name; showed as alt-attr of buttons%%%
col/row: icon to show on the button (lookup table below):

For each button, we need a definition

attributes:

  • col: in which column the button is in the button image
  • row: in which row the button is in the button image
  • name: the name of the button, this has to be unique and is used as tool tip at the moment
  • ns: a namespace associated to the button (usually the namespace of the element to be inserted)
  • type: The type of the "event" which should happen
  • "function": This function will be called, when the button is clicked
  • "insertElement": This element will be inserted
  • "event": This event will be triggered.
    If there's no "type" attribute, but a "action" attribute, the event in the action attribute will be triggered.
    If type "event" or the action attribute is defined, the event gets the value of @name as parameter.

Examples:

inserts the element xhtml:b at cursor position
<button name="b" col="1" row="1" type="insertElement" ns="http://www.w3.org/1999/xhtml">b</button>

calls the function DoSomething(), when clicked

<button name="b" col="1" row="1" type="function">DoSomething</button>

triggers the event ToggleTextClass (and makes the selection bold in this example)

the 2 examples are the same, the later is here for backwards compatibility.
<button name="b" col="1" row="1" type="event" ns="http://www.w3.org/1999/xhtml">ToggleTextClass</button>%%%
<button name="b" col="1" row="1" action="ToggleTextClass" ns="http://www.w3.org/1999/xhtml"/>

The order of the buttons denotes the position on the icons bar.

Further reading about config.xml:
(dead link) http://cvs.bitflux.ch/chora/co.php/trunk/examples/uni/config.xml?&rt=svneditor&r=HEAD

Back to Config.xml

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.