Exemplo n.º 1
0
        public static XmlNodeList fromXML(XmlNode node, out UIWidget ui, UIWidget p)
        {
            uint color = (uint)schemes.strokeColor;
            bool br = true;

            float lineWidth = (uint)getProp<float>(node, "lineWidth", 1, out br);

            color = (uint)getProp<EColorUtil>(node, "color", (EColorUtil)schemes.strokeColor, out br);
            string strBegin = tryGetProp("begin", node);
            PointF ptBegin = parsePt(strBegin);

            string strEnd = tryGetProp("end", node);
            PointF ptEnd = parsePt(strEnd);

            var uiLine = new UILine();
            uiLine.setLineWidth(lineWidth);//must be under color
            uiLine.setBegin(ptBegin.X, ptBegin.Y);
            uiLine.setEnd(ptEnd.X, ptEnd.Y);
            uiLine.color = color;

            uiLine.fromXML(node);

            ui = uiLine;
            return node.ChildNodes;
        }
Exemplo n.º 2
0
        public UIMM()
        {
            mRoot = UI.Instance.fromXML(XMLLayout, false);
            mRoot.adjustLayout();
            var round = mRoot.findByPath("subs");
            mRoot.evtOnLMUp += (ui, x, y) => { return false; };//to disable paresent.round to handle event
            round.evtOnLMUp += (ui, x, y) =>
            {
                var node = this.cast<YAMMNode>();
                node.toggleOpen();
                return false;
            };

            mline1 = new UILine();//line1
            mline1.color = (uint)EColorUtil.dimgray;
            mline1.setLineWidth(2);

            mline2 = new UILine();
            mline2.color = (uint)EColorUtil.dimgray;
            mline2.setLineWidth(2);

            mRoot.evtOnDragMove += (x, y) =>
                {
                    adjustLink();
                };
            mRoot.evtOnDragBegin += (x, y) =>
                {
                    var node = this.cast<YAMMNode>();
                    YAMM.Instance.setCurrent(node);
                };
            mRoot.evtOnDClick += (ui, x, y) =>
                {
                    rerangeChildren();
                    return false;
                };
        }