public void AddChildBox(MenuItem mnuItem) { if (menuItems == null) { menuItems = new List<MenuItem>(); } this.menuItems.Add(mnuItem); if (pnode != null) { pnode.AddChild(mnuItem.GetPresentationDomNode(pnode)); } mnuItem.OwnerMenuBox = this; }
public void ShowMenu(MenuItem relativeToMenuItem) { //add to topmost box if (!showing) { //create presentation node if (this.pnode == null) { this.htmldoc = relativeToMenuItem.OwnerMenuBox.HtmlDoc; this.pnode = this.GetPresentationDomNode(htmldoc); } var relativeMenuItemElement = relativeToMenuItem.CurrentDomElement as IHtmlElement; int x, y; relativeMenuItemElement.getGlobalLocation(out x, out y); var pHtmlNode = pnode as WebDom.Impl.HtmlElement; pHtmlNode.SetLocation(x + relativeToMenuItem.OwnerMenuBox.Width, y); htmldoc.RootNode.AddChild(pnode); showing = true; } }
public void AddSubMenuItem(MenuItem childItem) { if (childItems == null) { childItems = new List<MenuItem>(); } this.childItems.Add(childItem); childItem.ParentMenuItem = this; if (floatPart != null) { floatPart.AddChildBox(childItem); } }