Exemple #1
0
        public override DomElement GetPresentationDomNode(WebDom.Impl.HtmlDocument htmldoc)
        {
            if (pnode != null)
            {
                return(pnode);
            }
            this.htmldoc = htmldoc;

            pnode = htmldoc.CreateElement("div");
            //TODO: review IsLandPart again, this is temp fixed
            if (!this.IsLandPart)
            {
                pnode.SetAttribute("style", "position:absolute;width:100px;height:200px");
            }

            if (menuItems != null)
            {
                int j = menuItems.Count;
                for (int i = 0; i < j; ++i)
                {
                    pnode.AddChild(menuItems[i].GetPresentationDomNode(pnode));
                }
            }
            return(pnode);
        }
Exemple #2
0
        public override DomElement GetPresentationDomNode(WebDom.Impl.HtmlDocument htmldoc)
        {
            //TODO: use template engine,
            //ideas:  AngularJS style ?

            //1. create body node
            // and content
            //style 2, lambda and adhoc attach event
            if (pnode != null)
            {
                return(pnode);
            }
            //---------------------------------------------------
            pnode = htmldoc.CreateElement("div");

            pnode.AddChild("img", img =>
            {
                //init
                bool is_close = true;
                img.SetAttribute("src", "../../Demo/arrow_close.png");
                img.AttachMouseDownEvent(e =>
                {
                    img.SetAttribute("src", is_close ?
                                     "../../Demo/arrow_open.png" :
                                     "../../Demo/arrow_close.png");
                    is_close = !is_close;
                    e.StopPropagation();
                });
            });

            //pnode.AddChild("img", img =>
            //{

            //    //change style
            //    bool is_close = true;
            //    img.SetAttribute("src", "../../Demo/arrow_close.png");
            //    //3. attach event to specific span
            //    img.AttachMouseDownEvent(e =>
            //    {
            //        img.SetAttribute("src", is_close ?
            //            "../../Demo/arrow_open.png" :
            //            "../../Demo/arrow_close.png");

            //        is_close = !is_close;
            //        e.StopPropagation();

            //        this.InvalidateGraphics();
            //    });

            //});
            pnode.AddChild("span", span =>
            {
                span.AddTextContent(this.checkBoxText);
            });

            return(pnode);
        }
Exemple #3
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);
        }
Exemple #4
0
        public override DomElement GetPresentationDomNode(WebDom.Impl.HtmlDocument htmldoc)
        {
            if (_presentationNode != null)
            {
                return(_presentationNode);
            }
            //-------------------
            _presentationNode = htmldoc.CreateElement("div");
            _presentationNode.AddChild("div", div =>
            {
                div.SetAttribute("style", "font:10pt tahoma;");
                div.AddChild("span", span1 =>
                {
                    _span_textLabel = span1;
                    span1.SetAttribute("style", "background-color:white;width:50px;height:20px;");
                    span1.AddTextContent("");
                });
                div.AddChild("img", img =>
                {
                    //init
                    img.SetAttribute("src", "arrow_close.png");
                    img.AttachMouseDownEvent(e =>
                    {
                        if (this.IsOpen)
                        {
                            img.SetAttribute("src", "arrow_close.png");
                            this.CloseHinge();
                        }
                        else
                        {
                            img.SetAttribute("src", "arrow_open.png");
                            this.OpenHinge();
                        }

                        //-----------------------------
                        e.StopPropagation();
                    });
                });
            });

            _div_landingPoint = _presentationNode.AddChild("div", div =>
            {
                div.SetAttribute("style", "display:block");
            });
            //-------------------

            _floatPartDomElement = this.CreateFloatPartDom(htmldoc);
            return(_presentationNode);
        }
Exemple #5
0
        DomElement CreateFloatPartDom(WebDom.Impl.HtmlDocument htmldoc)
        {
            //create land part
            var div = htmldoc.CreateElement("div");

            div.SetAttribute("style", "position:absolute;left:0px;top:0px;width:300px;height:500px;");
            for (int i = 0; i < 10; ++i)
            {
                div.AddChild("div", div2 =>
                {
                    div2.AddTextContent("HELLO!" + i);
                });
            }
            return(div);
        }
Exemple #6
0
 DomElement CreateFloatPartDom(WebDom.Impl.HtmlDocument htmldoc)
 {
     //create land part
     _div_floatingPart = htmldoc.CreateElement("div");
     _div_floatingPart.SetAttribute("style", "background-color:white;position:absolute;left:0px;top:0px;width:300px;height:500px;");
     if (_items != null)
     {
         int j = _items.Count;
         for (int i = 0; i < j; ++i)
         {
             _div_floatingPart.AddChild(_items[i]);
         }
     }
     //---------------------------------------
     _div_glassCover = htmldoc.CreateElement("div");
     _div_glassCover.SetAttribute("style", "position:absolute;width:100%;height:100%;");
     _div_glassCover.AddChild(_div_floatingPart);
     _div_glassCover.AttachMouseDownEvent(e =>
     {
         //when click on cover glass
         CloseHinge();
     });
     return(_div_floatingPart);
 }
Exemple #7
0
        public override DomElement GetPresentationDomNode(WebDom.Impl.HtmlDocument htmldoc)
        {
            if (pnode != null)
            {
                return(pnode);
            }
            //----------------------------------
            pnode = htmldoc.CreateElement("div");
            pnode.SetAttribute("style", "display:inline-block;width:" + Width + "px;height:" + this.Height + "px;");

            pnode.AddChild("div", div2 =>
            {
                //init
                div2.SetAttribute("style", "padding:5px;background-color:#dddddd;");
                div2.AddChild("span", span =>
                {
                    span.AddTextContent(this.buttonText);
                });
                //------------------------------

                div2.AttachMouseDownEvent(e =>
                {
#if DEBUG
                    div2.dbugMark = 1;
#endif
                    // div2.SetAttribute("style", "padding:5px;background-color:#aaaaaa;");
                    EaseScriptElement ee = new EaseScriptElement(div2);
                    ee.ChangeBackgroundColor(Color.FromArgb(0xaa, 0xaa, 0xaa));
                    //div2.SetAttribute("style", "padding:5px;background-color:#aaaaaa;");
                    e.StopPropagation();
                });
                div2.AttachMouseUpEvent(e =>
                {
#if DEBUG
                    div2.dbugMark = 2;
#endif
                    //div2.SetAttribute("style", "padding:5px;background-color:#dddddd;");

                    EaseScriptElement ee = new EaseScriptElement(div2);
                    ee.ChangeBackgroundColor(Color.FromArgb(0xdd, 0xdd, 0xdd));
                    e.StopPropagation();
                });
            });

            return(pnode);
        }
Exemple #8
0
        public override DomElement GetPresentationDomNode(WebDom.Impl.HtmlDocument htmldoc)
        {
            if (pnode != null)
            {
                return(pnode);
            }
            //create primary presentation node

            pnode = htmldoc.CreateElement("div");
            pnode.SetAttribute("style", "font:10pt tahoma");
            int j = treeNodes.Count;

            for (int i = 0; i < j; ++i)
            {
                pnode.AddChild(treeNodes[i].GetPrimaryPresentationNode(pnode));
            }
            return(pnode);
        }
Exemple #9
0
        public override DomElement GetPresentationDomNode(WebDom.Impl.HtmlDocument htmldoc)
        {
            if (presentationNode != null)
            {
                return(presentationNode);
            }
            //-------------------
            presentationNode = htmldoc.CreateElement("div");
            presentationNode.AddChild("div", div =>
            {
                div.SetAttribute("style", "font:10pt tahoma;");
                div.AddChild("img", img =>
                {
                    //init
                    img.SetAttribute("src", "../../Demo/arrow_close.png");
                    img.AttachMouseDownEvent(e =>
                    {
                        //img.SetAttribute("src", this.IsOpen ?
                        //    "../../Demo/arrow_open.png" :
                        //    "../../Demo/arrow_close.png");
                        ////------------------------------

                        if (this.IsOpen)
                        {
                            img.SetAttribute("src", "../../Demo/arrow_close.png");
                            this.CloseHinge();
                        }
                        else
                        {
                            img.SetAttribute("src", "../../Demo/arrow_open.png");
                            this.OpenHinge();
                        }

                        //-----------------------------
                        e.StopPropagation();
                    });
                });
            });
            //-------------------

            this.floatPartDomElement = this.CreateFloatPartDom(htmldoc);

            return(presentationNode);
        }
Exemple #10
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;overflow:scroll;height:300px;");
            int j = items.Count;

            if (j > 0)
            {
                for (int i = 0; i < j; ++i)
                {
                    //itemnode
                    pnode.AddChild(items[i].GetPresentationNode(pnode));
                }
            }
            return(pnode);
        }
Exemple #11
0
        public override DomElement GetPresentationDomNode(WebDom.Impl.HtmlDocument htmldoc)
        {
            if (pnode != null) return pnode;
            this.htmldoc = htmldoc;
            pnode = htmldoc.CreateElement("div");
            //TODO: review IsLandPart again, this is temp fixed 
            if (!this.IsLandPart)
            {
                pnode.SetAttribute("style", "position:absolute;width:100px;height:200px");
            }

            if (menuItems != null)
            {
                int j = menuItems.Count;
                for (int i = 0; i < j; ++i)
                {
                    pnode.AddChild(menuItems[i].GetPresentationDomNode(pnode));
                }
            }
            return pnode;
        }