Changes

Jump to navigation Jump to search

US Tray Menu 2

70 bytes removed, 17:43, 29 June 2010
Minor grammatical corrections.
'''''US Tray Menu 2'''''
== Introduction ==
[[US Tray Menu: Introduction | Previous The previous tutorial]] concluded with a new UniTray other . Other than UTF-8 support , it offered no new features. It mimics the original menu , hence menu items are static and control files are command line based. Running When running the menu on a dark background , a noticeable ghosting effect is produced.
This tutorial covers adding new features , making our menu more user-friendlierfriendly. It also addresses that undesirable ghosting effect.
Due to a lack of interest for a plugin , there is an interesting final twist!  '''''[[#top | Top]]'''''
== User feedback ==
To start and stop either both or of the individual servers or both, currently our menu uses individual buttons. This applies to running as a standard program or as a service. Other than looking pretty , the icon to the left of each button provide provides no real information.
There is no real reason why an icon should not indicate current server status (green running and red not running). Also whey , why use two buttons when a single toggle button will do. ? Unlike with a third party menu program, we have no constraints this . This allows us to change anything we like.
'''''[[#top | Top]]'''''
=== Configuration file ===
Text The text displayed on each server button (menu item) toggles between start and stop , hence we need to supply these two pieces of text. Since they are user translatable (different language) they cannot be hard coded hence , so they are part of the configuration file. In addition our script needs to known what functionality a button is performing. Assigning a command to each button and letting the script decide its current state (in real time) accommodates the above.
Similarly there are menu items (buttons) that become active only when the servers are running. Assigning a command commands to these buttons allow allows for alternative text to be displayed, these . These again are defined in the configuration file.  '''''[[#top | Top]]'''''
=== Status Icon ===
The left icon of each button toggles showing the current server status (red stopped , green running). This can be difficult to achieve , however a feature inherent in our menu makes this very easy. Clicking any button automatically minimises our menu. On restoring; , the whole menu is redrawn using data from the master array. This is used to great effect; before redrawing , we update master array with current server status (real time) and appropriate button text.
This technique can be applied to any menu item.
'''''[[#top | Top]]'''''
=== Commands ===
'''''Note'':''' men1[] Is a special case it is set to whichever text (Text1 or Text2) is the longest. This text is used for calculating width of main or sub-menu. Duplication applies only to commands xxxx.
 
'''''[[#top | Top]]'''''
=== Define commands ===
'''''Note'':''' Above list reflects current menu options depending on final requirements this may change.
'''''[[#top | Top]]'''''
== Summary ==

Navigation menu