Beispiel #1
0
 void ItemSelected(LayoutFarm.UI.UIEventArgs e)
 {
     //some item is selected
     if (e.SourceHitElement is DomElement)
     {
         DomElement domElem = (DomElement)e.SourceHitElement;
         if (domElem.Tag != null)
         {
             //selected value
             _span_textLabel.ClearAllElements();
             _span_textLabel.AddTextContent(domElem.Tag.ToString());
             NeedUpdateDom = true;
         }
     }
     e.StopPropagation();
     CloseHinge();
 }
Beispiel #2
0
        public override WebDom.DomElement GetPresentationDomNode(WebDom.Impl.HtmlDocument htmldoc)
        {
            if (pnode != null)
            {
                return(pnode);
            }
            //------------------------------

            pnode = htmldoc.CreateElement("div");
            pnode.SetAttribute("style", "font:10pt tahoma");
            //------------------------------
            titleBar = htmldoc.CreateElement("div");
            titleBar.AddTextContent("hello tabPage");
            pnode.AddChild(titleBar);
            //------------------------------
            tabTitleList = htmldoc.CreateElement("div");
            pnode.AddChild(tabTitleList);
            //------------------------------
            contentNode = htmldoc.CreateElement("div");
            pnode.AddChild(contentNode);
            //------------------------------
            return(pnode);
        }
Beispiel #3
0
        public DomElement GetPresentationDomNode(DomElement hostNode)
        {
            if (pnode != null)
            {
                return(pnode);
            }
            //-----------------------------------
            var doc = hostNode.OwnerDocument;

            this.pnode = doc.CreateElement("div");
            pnode.AddChild("img", item_icon =>
            {
                menuIcon = item_icon;
                menuIcon.AttachMouseDownEvent(e =>
                {
                    //****
                    this.MaintenanceParentOpenState();
                    if (this.IsOpened)
                    {
                        this.Close();
                    }
                    else
                    {
                        this.Open();
                    }
                    e.StopPropagation();
                });
                menuIcon.AttachMouseUpEvent(e =>
                {
                    this.UnmaintenanceParentOpenState();
                    e.StopPropagation();
                });
                menuIcon.AttachEventOnMouseLostFocus(e =>
                {
                    if (!this.MaintenaceOpenState)
                    {
                        this.CloseRecursiveUp();
                    }
                });
            });
            pnode.AddChild("span", content =>
            {
                if (menuItemText != null)
                {
                    pnode.AddTextContent(this.menuItemText);
                }
            });
            //--------------------------------------------------------
            //create simple menu item box

            if (childItems != null)
            {
                floatPart = new MenuBox(400, 200);
                int j = childItems.Count;
                for (int i = 0; i < j; ++i)
                {
                    floatPart.AddChildBox(childItems[i]);
                }
            }
            return(pnode);
        }