Search
Menu.draw Method
See Also
 






Control.draw override.

Namespace: MindFusion.Common.UI
File: Menu.js

 Syntax

JavaScript  Copy Code

function draw ()

 Example

The following code uses the bounds property of a ToolStrip to render a Menu right before the tool item, over which the mouse hovers:

JavaScript  Copy Code

// This is the handler function of the toolstrip.itemMouseEnter event.
// If the menu is currently visible it will be removed.
// Otherwise, the menu will be created right below the hovered item.
function itemMouseEnter(sender, args)
{
 if (menu.loaded)
 {
  menu.dispose();
 }
 else if (args.item.title == "Theme")
 {
  menu.theme = sender.theme;
  menu.left = ui.Unit.pixel(sender.bounds.x + args.item.bounds.x);
  menu.top = ui.Unit.pixel(sender.bounds.y + args.item.bounds.height);  

  document.body.appendChild(menu.draw());
  menu.attach();
 }
}

 See Also