InsertSubmenu Method



 
The InsertSubmenu method inserts a submenu into the menu.


Syntax

    SKMenu.InsertSubmenu(beforeID, commandID, menuhandle, string, image)
Parameters
    beforeID UINT value that contains the command ID of the following item.
    commandID UINT value that contains the command ID of the new item.
    menuhandle Handle to a popup menu that represents the new submenu.
    string String that contains the text of the item.
    image String that contains the absolute path of an image to show on the left side of the item.
Return Value
    None.
Remarks
    None.
Examples
    The following example creates a HTML dialog containing a menu with submenus.

    <SCRIPT TYPE="text/javascript">
    window.external.InitScriptInterface();
    function onCommand(ai_Code, ai_CommandID, al_Handle)
    {
       switch (ai_CommandID)
       {
          case 1: alert('Hello'); break;
          case 3: alert('Bye'); break;
       }
    }
    mySubMenu = SiteKiosk.SiteKioskUI.CreatePopupMenu();
    mySubMenu.InsertString(3,1, "Say Hello", "");
    mySubMenu.InsertString(4,3, "Say Bye", "");
    myMenu = SiteKiosk.SiteKioskUI.CreateMenu();
    myMenu.InsertSubmenu(2,4, mySubMenu.Handle, "MessageBox", "");
    myMenu.InsertString(5,2, "Exit", "");
    mydialog = SiteKiosk.SiteKioskUI.CreateHTMLDialog();
    mydialog.URL = "http://www.myURL.com";
    mydialog.Title = true;
    mydialog.Menu = myMenu.Handle;
    mydialog.OnCommand = onCommand;
    mydialog.ShowDialog();
    </SCRIPT>
    

Applies to
    SiteKiosk v5.5 (and later versions).

Back to top