Exemplo n.º 1
0
        virtual public void Setup_AfterAdd(XML xml)
        {
            XML cxml = null;

            string s = (string)xml.GetAttribute("group");

            if (s != null)
            {
                _group = _parent.GetChildById(s) as GGroup;
            }

            cxml = xml.GetNode("gearDisplay");
            if (cxml != null)
            {
                _gearDisplay.Setup(cxml);
            }

            cxml = xml.GetNode("gearXY");
            if (cxml != null)
            {
                _gearXY.Setup(cxml);
            }

            cxml = xml.GetNode("gearSize");
            if (cxml != null)
            {
                _gearSize.Setup(cxml);
            }
            cxml = xml.GetNode("gearLook");
            if (cxml != null)
            {
                gearLook.Setup(cxml);
            }

            _relations.Setup(xml);
        }
Exemplo n.º 2
0
        public static GObject NewObject(string type, AppContext context)
        {
            GObject cls = null;

            switch (type)
            {
            case "image":
                cls = new GImage();
                break;

            case "movieclip":
                cls = new GMovieClip();
                break;

            case "swf":
                cls = new GSwfObject();
                break;

            case "jta":
                cls = new GJtaObject();
                break;

            case "component":
                cls = new GComponent();
                break;

            case "text":
                cls = new GTextField();
                break;

            case "group":
                cls = new GGroup();
                break;

            case "list":
                cls = new GList();
                break;

            case "graph":
                cls = new GGraph();
                break;

            case "loader":
                cls = new GLoader();
                break;

            //component derived
            case "Button":
                cls = new GButton();
                break;

            case "Label":
                cls = new GLabel();
                break;

            case "ProgressBar":
                cls = new GProgressBar();
                break;

            case "Slider":
                cls = new GSlider();
                break;

            case "ScrollBar":
                cls = new GScrollBar();
                break;

            case "ComboBox":
                cls = new GComboBox();
                break;
            }
            cls.OnCreate(context);
            return(cls);
        }