Toolbar Browser
3. Reference
Triggers
Controls
Variables
System Variables
Global Values
Functions
AutoFill()
Back()
Beep()
CheckLinks()
Checksum()
Click()
Command()
Customize()
DeleteOption()
Enable()
Execute()
ExportLinks()
Forward()
GetFolderIcon()
GetQuery()
GetSystemIcon()
Header()
Highlight()
HistoryMenu()
Home()
IfExactMatch()
IfMatch()
ImportValue()
ImportCaption()
ImportIntValue()
ImportXMLValue()
Length()
LoadMenu()
Menu()
OpenURL()
Options()
PageText()
PlaySound()
PopupManager()
Refresh()
Replace()
ReplaceAll()
Resize()
ResizeClient()
Redraw()
Save()
Search()
SearchBack()
SearchLast()
SearchNext()
SearchPage()
SetCaption()
SetClipboard()
SetFocus()
SetFontSize()
SetIcon()
SetOption()
SetParam()
SetText()
SetStatusText()
SetTooltip()
SetUserAgent()
SetValue()
Show()
Stop()
StripHTML()
ToolbarMenu()
TruncateOption()
UpdateToolbar()
Zoom()
Text Functions
 

LoadMenu() Function

Loads and displays a popup menu from an external XML file.

Syntax:

    LoadMenu(url,tag,caption, action, image,default_image,separator)


Parameters:


    ParameterDescription
    urlURL of an XML file to load menu from
    tagDefines XML tag encapsulating a menu item. Can be null.
    captionDefines an XML tag & parameter containing the menu item caption.
    actionDefines an XML tag & parameter containing the menu item action to be executed when the item is selected.
    imageDefines an XML tag & parameter containing menu item image or icon.
    default_imageDefines a default menu item image or icon.
    separatorDefines an XML Tag & parameter containing a menu separator.



Remarks:

  • tag, caption,action and image parameters can define an XML tag, and optionally an XML parameter value. The syntax is tag:parameter.
  • To create a separator, the separator tag in the XML needs to have a value. For example: <separator>1</separator>


Example:

    Assume that the URL http://www.somedomain.com/menu.xml returns the following code:


    <XML>
    <MENU>
    <ITEM>
    <OPTION name="Gif" command="SetText('<HTML>Gif Menu option selected</HTML>')">
    </OPTION>
    <ICON>http://www.toolbarbrowser.com/img/smiley.ico</ICON>
    </ITEM>
    <ITEM>
    <SEPARATOR>1</SEPARATOR> <!-- Menu Separator-->
    </ITEM>
    <ITEM>
    <OPTION name="Jpeg" icon="GetSystemIcon('*.jpg')" command="SetText('<HTML>Jpeg Menu option Selected</HTML>')
    </OPTION>
    </ITEM>
    </MENU>
    </XML>



    The command:

    LoadMenu(

      'http://www.somedomain.com/menu.xml',
      'ITEM',
      'OPTION:name',
      'OPTION:command',
      'ICON',
      NULL,
      'SEPARATOR');



    Can be used to load and display the menu defined in the above XML code.

    Notes:

      • ITEM defines the start of a menu item block. If menu items are not encapsulated, this parameter would be left blank.
      • OPTION:name extracts the value of the name= parameter from the OPTION tag.
      • OPTION:command extracts the value of the command= parameter from the OPTION tag.
      • As no parameter is defined, the ICON extracts the value of the ICON tag.