User Tools

Site Tools


dev-guide:linking-help-button

Configuration of Help buttons

By default every explorer created in GroIMP has a small question mark button on the upper right corner. Moreover several buttons are added to different panels. In the following it will be described how to link this buttons to the right places and how to add buttons to newly created panels.

Linking a button to a certain page

Every help button triggers the HelpExplorerFactory which then creates the help panel, during this creation the factory can receive a path to a certain page. If a path was received this path will be opened. A path in this case is defined by the name of the tree items in the help explorer separated by a slash. e.g.: GroIMP User Manual/Using GroIMP/Common Panels

This path can be provided by the plugin.properties file on different levels, the button will first look for a 'docLink' attribute in its own description, then in the description of the panel and then in the description of the plugin. It will always pick the first one it gets.

In practice this means a plugin can have a default path defined by 'docLink' directly and additionally individual paths for certain panels e.g. for the RGG toolbar:

pluginName = RGG
provider = grogra.de
docLink = RGG Plugin Manual

[...]

/ui/panels/rgg/toolbar.docLink = RGG Plugin Manual/GroIMP's Relational Growth Grammars Plugin/Working with a Relational Growth Grammar

In the case of an explorer created by a resource directory, the path in the properties file is /ui/panels/objects/<Name-of-the-dir>.

Adding a new help button to a panel

In order to add a help button to the upper right corner of a panel without a menu, the easiest way is to link the default menu which already includes a help button. This can be done by adding <link source=“/ui/explorer/menu”/> as a child of any PanelFactory (<panel>). If a menu already exists, the following lines can be added as the last entry of the src directory.

  <separator fill="true" />
  <link source="/ui/doc/helpButton"/>	

If the help is not suppose to be added as a button but as a regular menu item, <link source=“/ui/doc/help”/> can be added similar to any other factory or command.

dev-guide/linking-help-button.txt · Last modified: 2024/07/08 12:19 by timOb