Exemplo n.º 1
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;
                };
        }