/*! \page wxguitoolboxes WxGUI Toolboxes \tableofcontents \section introduction Introduction wxGUI toolboxes enables GUI customization and organization of menu (and other views) according to user needs. XML files are used for code generation and in case of toolboxes enables wxGUI (menu) customization. Currently, all the files described here are related to the menus which are generated from these files. The most of the files described here are the part of implementation of toolboxes in wxGUI. Each XML file has a DTD file which can by used for validation. XSD files are not provided (but this can change in the future). Some file types can occur multiple times, some occur only once. Note that in XML context, the term tag partially overlaps with the term element. Element emphasizes the XML structure, XML object model and content of these objects. Tag emphasizes the markup and the name of the element. \section toolboxesFilesOverview Files overview \subsection toolboxesFiles Files related to toolboxes GRASS source code contains these XML files: GRASS distribution contains these XML files: GRASS directory (\c ".grass7") in user home directory (i.e., \c "$HOME" on Unix) contains these XML files: \dot digraph toolboxes { graph [rankdir="LR"]; node [shape="record", style="rounded"]; menudata [label="menudata.xml in distribution", shape="note", URL="\ref menudataFile"]; umenudata [label="menudata.xml in user home", shape="note", URL="\ref menudataFile"]; toolboxes [label="toolboxes.xml in distribution", shape="note", URL="\ref toolboxesFile"]; utoolboxes [label="toolboxes.xml in user home", shape="note", URL="\ref toolboxesFile"]; main_menu [label="main_menu.xml in distribution", shape="note", URL="\ref main_menuFile"]; umain_menu [label="main_menu.xml in user home", shape="note", URL="\ref main_menuFile"]; wxgui_items [label="wxgui_items.xml in distribution", shape="note", URL="\ref wxgui_itemsFile"]; module_items [label="module_items.xml in distribution", shape="note", URL="\ref module_itemsFile"]; menustrings [label="menustrings.py\n(used for translations)", shape="note"]; module_items -> menudata; wxgui_items -> menudata; main_menu -> menudata; toolboxes -> menudata; module_items -> umenudata; wxgui_items -> umenudata; toolboxes -> umenudata; main_menu -> umenudata; umain_menu -> umenudata; utoolboxes -> umenudata; menudata -> menustrings; // guimenu [label="Main menu in wxGUI", shape="box3d"]; // menustrings -> guimenu; // menudata -> guimenu; // umenudata -> guimenu; } \enddot \subsection toolboxesOtherFiles Other files GRASS source code contains these XML files: In GRASS distribution these XML files are in the \c etc/gui/wxpython/xml directory. \section toolboxesGeneration Generation of files and menu As noted in the section \ref toolboxesFilesOverview, there are files in the GRASS distribution and in the user home directory (particularly in \c ".grass7/tooboxes" subdirectory). When user doesn't have any \c toolboxes.xml or \c main_menu.xml files in the home directory, file \c menudata.xml included in the distribution is used to build a menu. When \c toolboxes.xml or \c main_menu.xml file (in user home directory) is newer than \c menudata.xml in user home directory or \c menudata.xml does not exists in user home directory, the \c menudata.xml is generated when GUI starts. When \c menudata.xml in user home directory is fresh enough, it is used to create a menu. When \c toolboxes.xml or \c main_menu.xml file is not in user home directory but \c menudata.xml is, the file is re-generated (each time the GUI starts). So, if you just have your own \c main_menu.xml, it is better to create also a \c toolboxes.xml file with no toolboxes (note that you still need to create a valid XML toolbox file). Similarly, if you have only the \c toolboxes.xml file it is better to copy the \c main_menu.xml file from distribution into your home directory. When reading the main_menu file, user toolboxes are expanded first and then toolboxes from distribution are expanded. \section toolboxesFile Toolboxes file This file contains definition of toolboxes. A toolbox contains references (links) to other items, namely \c "", \c "" and other toolboxes using tag \c "". Tag \c "" is used when the view supports some kind of visual separators to group parts of the toolbox (or menu). Items are referenced using \c name attribute. In case of \c "", \c "" also subelements can be added to create new items or to replace subelements values from item definition. \dot graph toolboxes { graph [rankdir="LR"]; node [shape="record", style="rounded"]; // ∞ causes Doxygen warning but it's harmless for dot and html output toolboxes -- toolbox [label="1..∞"]; toolbox -- label; toolbox -- items [label="1..∞"]; items -- "module-item" [label="0..1"]; items -- "wxgui-item" [label="0..1"]; items -- subtoolbox [label="0..1"]; items -- separator [label="0..1"]; milabel [label="label"]; "module-item" -- milabel; "module-item" -- module [label="0..1"]; "module-item" -- description [label="0..1"]; "module-item" -- keywords [label="0..1"]; wilabel [label="label"]; widescription [label="description"]; wikeywords [label="keywords"]; "wxgui-item" -- wilabel [label="0..1"]; "wxgui-item" -- handler [label="0..1"]; "wxgui-item" -- "related-module" [label="0..1"]; "wxgui-item" -- command [label="0..1"]; "wxgui-item" -- widescription [label="0..1"]; "wxgui-item" -- wikeywords [label="0..1"]; "wxgui-item" -- shortcut [label="0..1"]; "wxgui-item" -- "wx-id" [label="0..1"]; } \enddot \section main_menuFile Main menu file File has a layout similar to the \ref toolboxesFile but contains only one toolbox which can contain only subtoolboxes and one special item user-toolboxes-list which will be replaced by a menu with the list of toolboxes in the user toolbox file. \section module_itemsFile Modules items file The file contains information obtained from modules' interface descriptions. The structure of one \c "module-item" is the same as in the \ref toolboxesFile but some subelements are mandatory. File contained in distribution is generated during compilation from available modules using the script \c gui/wxpython/tools/build_modules_xml.py. Element \c "" is the name of the executable, e.g. "r.info". Element \c "