示例#1
0
 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;
 }
示例#2
0
 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;
     }
 }
示例#3
0
 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);
     }
 }