Names of icons, menus and actions in gvSIG 2.0 (III): standardizations of naming

In the previous article, “Names of icons, menus and actions in gvSIG 2.0 II: aplying in gvSIG.“, we saw how to define an action and how to use it in menus and buttons in the application. We named the action, the icon, elected an “action-command” and positioned it. Now well, when electing  this things it’s not in a random way, we follow some rules we have to when doing it. First is that every action have got to be in an entry in main menus in gvSIG. It should not have an action in a button or contextual menu not represented in menus. In our example, we situated the action in menu entry:

  • Tools
    • Symbology
      • Import point symbols

The general rule to name an action is the complete route in menus, in English, separating menus entries by ““, replacing spaces by “” and eliminating others pointing symbols that could exist. Also the name of action would be “tools-symbology-import-point-symbols“. It could happen the action name would conflict with other action, for example, menu entry:

  • Selection
    • Select all

It would  be used to select all lines of a table, or all elements in map or geometries  in active layer in the view. We’d have  three distinct actions, and what we would do would be add a suffix in the name’s end of the action indicating about what object is applied the action. So we’d have:

  • selection-select-all-table
  • selection-select-all-layout
  • selection-select-all-layer

Following these little considerations we’ll name our action, and so we have the name, we’ll name the remaining actions elements.

Now we elect  the name used to the “action-command“. As general rule, we’’ll use same name of the action.

The  next we’ll have to select would be the name of icon. We’ll follow three simple rules:

  • If action is contemplated in actions recognized within Tango Desktop Project, of freedesktop.org will be used icon name proposed by it.
  • If a suffix had not been added to the action, the name of the action will be used.
  • If a suffix had been added to the action, the name of the action will be used, eliminating the suffix.

Finally, we have to assign a position to our action. In version 2 of gvSIG is stablished the following convention to stablish the positions of action:

AAABBBCCCD

Where:

  • AAA, represents first level menu inside gvSIG menu. There are stablished the following values:
    • 10 to menu File
    • 20 to menu Edit
    • 30 to menu Select
    • 40 to menu Show
    • 50 to menu Table
    • 60 to menu Layer
    • 65 to menu View
    • 70 to menu Map
    • 90 to menu Tools
    • 96 to menu Window
    • 99 to menu Help
  • BBB, three digits filled of zeros in left represented by position  inside menu AAA. In case of not proceeding, we could indicate “000″.
  • CCC, in case entry in BBB is a submenu, this indicates position inside this submenu. It also is filled of zeros in left, and in case it doesn’t proceed we indicate “000″.
  • D, in case entry in CCC be a submenu, this indicates position inside this submenu, in case it don’t proceed we indicate “0″.

With these values we could compose the position’s value, that will be used to situate an action related to others always when showed to user.

In case of the example the position indicated is “900400200″:

  • 90, menu “Tools
    • 040, submenu “Symbology
      • 020, position inside menu symbology of entry “Import point symbols
        • 0, don’t proceeding this way leaving a zero.

In gvSIG are included several tools that allow us to see a list of actions or menu entries installed in a moment. We could follow menu:

  • Tools
    • Devel
      • Show menu information

To get a list of menu entries, where we could see its position to get an idea where we have to put ours and what position‘s number we have to assign it.

In the same menu Development, we have an option “Show action information” that will show us a list of all registered actions in the app ordered by plugin that supports it.

It’s possible to get a list of action and menu entries of the app following menu “Tools->development->Show actions information”

This entry was posted in opinion. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s