7. Adding a Characters menu
Prev | Chapter 2. Tutorial | Next

## 7. Adding a Characters menu

tutorial/tutorial7.xxe_gui:

      <action name="insertLeftAction" label="_L - &#x2190;">
        <command name="insertString" parameter="&#x2190;" />
      </action>
      <action name="insertRightAction" label="_R - &#x2192;">
        <command name="insertString" parameter="&#x2192;" />
      </action>

      <action name="insertAlphaAction" label="_A - &#x03B1;">
        <command name="insertString" parameter="&#x03B1;" />
      </action>
      <action name="insertBetaAction" label="_B - &#x03B2;">
        <command name="insertString" parameter="&#x03B2;" />
      </action>
      <action name="insertGammaAction" label="_C - &#x03B3;">
        <command name="insertString" parameter="&#x03B3;" />
      </action>

      <menu name="arrowsMenu" label="_Arrows">
        <action name="insertLeftAction" />
        <action name="insertRightAction" />
      </menu>

      <menu name="greekMenu" label="_Greek">
        <action name="insertAlphaAction" />
        <action name="insertBetaAction" />
        <action name="insertGammaAction" />
      </menu>

      <menu name="charactersMenu" label="_Characters">
        <menu name="arrowsMenu" />
        <menu name="greekMenu" />
      </menu>

      <menuBar name="customMenuBar">
        <menu name="fileMenu" />
        <menu name="selectMenu" />
        <menu name="editMenu" />
        <menu name="charactersMenu" />
        <menu name="searchMenu" />
        <menu name="viewMenu" />
        <menu name="toolsMenu" />
        <menu name="configSpecificMenu" />
        <menu name="windowMenu" />
        <menu name="optionsMenu" />
        <menu name="helpMenu" />
      </menuBar>

      <layout label="Document Editor" icon="docedit.png">
        <insert />

        <menuBar name="customMenuBar" />

        <leftToolBars>
          <toolBar name="configSpecificToolBar" />
        </leftToolBars>
     </layout>

| Define actions which insert the chosen special characters by wrapping an action around standard command "`insertString`" (see Section 40, “insertString” in <ttl>XMLmind XML Editor - Commands</ttl>).
| Define the Characters menu and its two submenus: the Arrows menu and the Greek menu.
| There is no way to insert `charactersMenu` after `editMenu` using the `<insert/>` facility. Therefore we define a new menuBar called "`customMenuBar`" from scratch.
| Without this reference, the menu bar used by XXE would have been the standard menu bar (called "`menuBar`" — see common.xxe_gui).

Prev | Up | Next
6. Making File → Print dependant on the type of the document to be printed | Home | Chapter 3. Deployment