Search
Control.bounds Property
See Also
 






Gets the bounds of this control.

Namespace: MindFusion.Common
File: Control.js

 Syntax

JavaScript  Copy Code

get bounds() {}

 Property Value

Rect. The bounds.

 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