OSDMenu Written by Matthew Wire.
HTML Documentation for OSDMenu 1.6.4
Modified: 09 September 2002
^Top

Terminology used in this document:

For Menuitems:

WildCards:

^Top

Installation/Usage:

  1. Extract all files to girder/plugins. A subfolder named 'osdmenu' will be created - this is the default store for all your menus (osdmenu looks here first).
  2. Activate the plugin in Girder. It will appear on the 'Action Plugins' tab.
  3. Assign a command to the osdmenu action. Open the settings dialog and specify the name of the inifile containing your menu. Specify commands for OnMenuStart and OnMenuEnd if you want.
  4. See included inifiles for sample menus.
  5. See osdmenu.gml for simple usage in Girder.
  6. Note: If you store your Menu inifiles in the plugins/osdmenu subfolder you do not need to specify a path:
    Eg. mymenu.ini. Otherwise use full paths.
^Top

Opening a Menu:

^Top

Closing a Menu:

You have a number of options:
  1. Trigger the command you used to open the Menu again.
  2. Wait for the timeout specified in the inifile.
  3. Trigger a command that opens another menu (this will close the current menu and then open the new one).
You can 'Left' or 'Right' execute MenuItems. This puts either an 'l' or an 'r' in payload 2 when a girder event is triggered. This can be used for config menu's - eg volume changes etc.
^Top

Controlling the menu:

Either use the mouse or Girder to send messages directly to the menu. Target settings for OSDMenu Window:
Class Name:OSDMenuWnd
Executable:girder.exe
^Top

Non-OSD Menu's (LCD Menus):

OSDMenu 1.6.4 introduces a new way of using menus. No longer do they have to be displayed using OSDMenu's built-in OSD. By specifying a suitable value for "menudrawmethod" in the inifile(see [misc] section below) you can make osdmenu put the menu into Girder variables for parsing/display (see OSDMenu Sample.gml for an example (4line lcd-easy to modify)-included is a script to replace the "#ACTIVE:" tag with a ">" sign so you see a 'cursor' on the lcd). Each time the menu is updated OSDMenu will send an event to Girder (VirMenuUpdate).

The active menuitem will have the prefix #ACTIVE: which can be manipulated using LUA to display the active item however you want.

The menu can only be controlled via the WM_COMMAND messages method, using "OSDMenuWnd" as the target (be sure to set "Match invisible Tasks" in the target window).

Use the "itemsperscreen" inifile variable to set the number of menuitems to fit your display.

^Top

Menu Ini File Configuration:

IniFile Changes 1.5 -> 1.6

^Top

Menu Sections:

  • Girder Variables as Caption/Commandstring: You can use girder variables in both the caption and commandstrings which will be replaced with the variable values before the menu is opened.
    Eg. Launch [thegame]=c:\games\[gamename].
    Special case: Eg. [mycaptionvar]=fred. This would fail because the ini file interprets this as a separate section. To fix this use a % sign before the variable (ONLY if the variable comes first):
    Eg. %[mycaptionvar]=fred.
    (The % sign is removed internally).
  • Menuitem Caption: The inifile variable name specifies the caption for a menuitem.
  • Menuitem Commandstring: The commandstring for the menuitem specifies what happens when it is triggered.
  • Specifying Submenu to start:
    By default, initial submenu is [main]. To specify initial submenu:
    In the settings dialog, add a # followed by the submenu name to the ini file path.
    Eg. menu file: F:\Program Files\girder\Plugins\osdmenu\samplemenu.ini#greatmenu would display a submenu called greatmenu.
  • Spacer/Blank Entry: You can create non-selectable menuitems which act as spacers within the menu. To do this you must specify the menuitem caption as #CMD: followed by any text you wish displayed, or one of the following keywords:
    BLANK, LINETOP, LINEMID, LINEBOTTOM.
    Eg. #CMD:LINETOP= would display a spacer with a horizontal line across the top of the space.
    NOTE: The spacers are still treated as menuitems by the program logic. This means when you execute an item by number (keyboard or message) you must take into account the spacer (if the spacer entry is triggered the message is just dropped by osdmenu).
  • Tab character: You can use \t in the caption to shift all text after the \t to the right of the menu. This is useful for Title-Artist situations. It will display as (eg):
    Titlexxx1 - Artist
    Titlexxxxxx2 - Artist
Actions available for each menuitem:Description
Executing a file
  • Type the path to the file WITHOUT quotes:
    Eg. c:\program files\winamp\winamp.exe
  • If you want to use parameter for the file add them on the end:
    Eg. c:\program files\winamp\winamp.exe /ADD "e:\my playlists\myplaylist.m3u"
    (Note that the filename in the parameters has been enclosed by quotes, otherwise winamp would try and load it as two files - you'll have to experiment to see whether the parameters need to be quoted or not).
  • NOTE: If the file is located in the plugins/osdmenu subfolder you can just specify the filename. Otherwise use full paths.
Triggering an event in Girder
  • OSDMenu can send events directly to Girder.
    This is done by using # in a commandstring:
    myevent=#[devicenum]#[event_string]#[payload]
    [devicenum] - corresponds to the plugin device number which would be 18 for girderevent, or plugin id for any other.
    [eventstring] - any eventstring you wish(that exists in girder).
    [payload] - optional payload, referenced in girder by [pld1] - if you don't want a payload simply omit the final #[payload] section.
  • You can assign custom eventstrings in Girder through the usual method, selecting 'Girder Events' from the dropdown box and clicking 'Learn Event'. Type the eventstring in the textbox.
Opening a submenu
  • To open another submenu add a % sign to the beginning of the commandstring.
    Eg. newmenu=%mysubmenu.
  • You can also open submenus from another inifile in the same way:
    Eg. anothermenu=%moremenus.ini#anothersubmenu.
^Top

Visual Sections:

  • Master visual section must be [visual].
  • For submenu specific visual settings use [vis_{submenu name}] - Variables specifed here will override [visual] for that submenu.
  • Some variables are required, some optional.
VariableValuesDescription
backcolor{-1, $BBGGRR}Use -1 for transparency, color value otherwise.
oncolor{$BBGGRR}
offcolor{$BBGGRR}
fontsize{££}
fontname{any windows fontname}
fontstyle{bold, italic}Any combination of the options can be used, separated by spaces.
textalign{left, right, top, bottom, center}specifies alignment of text on OSD.
wnd_pos{topleft, topright, bottomleft, bottomright, screencenter}specifies onscreen position of osd (overrides wnd_left, wnd_top - set to any other value to ignore).
wnd_size{fit2text, fullscreen}Overrides wnd_width, wnd_height if used.
fit2text: Sets OSDMenu window to fit around text (+border etc.).
fullscreen: Sets OSDMenu window to screen size.
wnd_left{££}Overridden by wnd_pos if specified.
wnd_top{££}Overridden by wnd_pos if specified.
wnd_width{££}Overridden by wnd_size if specified.
wnd_height{££}Overridden by wnd_size if specified.
timeout{-1, ££}Time until menu closes (in seconds). Set to -1 for no timeout(menu will display until deactivated).
startpos{££}Menu item which is selected when the menu starts.
menustartposvar{varname}specify a girder variable to retrieve startpos var from NOTE: This overrides the startpos var.
bordercolor{$BBGGRR}Set this to a color value for a border of that color, or leave blank to disable.
itemsperscreen{££}Set this value to enable scrolling. If itemsperscreen is smaller than the number of items in the menu it will create a scrolling menu.
onbackcolor{$BBGGRR}Set this to a color value to highlight selected entry or leave blank to disable. Doesn't work with transparency.
closeonexecute{0,1}Specifies whether menu closes when command is executed or not - useful for adjustments menus (such as hue/saturation...). When set to 0 close the menu by: a)wait for timeout; b)Goto submenu which has closeonexecute set to 1; c)create a menuitem that executes a girder command to start the same menu - this will close it since it is already running.
autoexecute{any commandstring}Set this to a commandstring you want to execute as the submenu is displayed.
title{title string}Set this to a string you want displayed as a menu title, or leave blank for no title. Titles work best when textalign is set to 'top'
titlefontname{any available windows font}
titlefontstyle{bold, italic}Any combination of the options can be used, separated by spaces.
titlefontsize{££}Set this to a commandstring you want to execute as the submenu is displayed.
titlefontcolor{$BBGGRR}Set this to a color for the title.
spacercolor{$BBGGRR}Set this to a color for the line spacers.
^Top

Misc Section:

  • These variables go in the [misc] section.
  • These entries define variables for passing data to/from girder.
  • All variables are optional.
VariableValuesDescription
menupositionvar{varname}Saves the position of the menuitem to an integer variable.
menustringvar{varname}Saves the caption of the menuitem to a string variable.
menucmdstringvar{varname}Saves the commandstring of the menuitem to a string variable.
menuselectedvar{varname}Saves the caption of the current highlighted menuitem to a string variable.
menudrawmethod{0,1,2}Specifies draw mode for menu:
0=Display menu onscreen only;
1=Display menu onscreen + Put menu into variables and send change event to Girder;
2=Put menu into variables only (+send event notification).
^Top

Miscellaneous/Disclaimer

This program has no guarantees whatsoever so if your computer spontaneously combusts then it's not my problem! :-) etc...
I hope you find this program useful.

cmdlinemsgbox.exe is a small app I wrote which simply takes the command line parameters and displays them in a messagebox - useful for demo's such as in samplemenu.ini