Beispiel #1
0
        override public void ConstructFromXML(XML cxml)
        {
            base.ConstructFromXML(cxml);

            _titleObject = GetChildByName("title") as GTextField;
            _iconObject  = GetChildByName("icon") as GLoader;
        }
Beispiel #2
0
        override public void ConstructFromXML(XML cxml)
        {
            base.ConstructFromXML(cxml);

            XML xml = cxml.GetNode("Button");

            string str;

            str = (string)xml.GetAttribute("mode");
            if (str != null)
            {
                _mode = str;
            }
            else
            {
                _mode = COMMON;
            }

            _buttonController = GetController("button");
            _titleObject      = GetChildByName("title") as GTextField;
            _iconObject       = GetChildByName("icon") as GLoader;

            if (_mode == COMMON)
            {
                SetState(UP);
            }

            //_displayObject.AddEventListenerObsolete(MouseEvent.ROLL_OVER, __rolloverObsolete);
            //_displayObject.AddEventListenerObsolete(MouseEvent.ROLL_OUT, __rolloutObsolete);
            //_displayObject.AddEventListenerObsolete(MouseEvent.MOUSE_DOWN, __mousedown);
            //AddClickListener(__clickObsolete);
            //
            displayObject.onRollOver.Add(__rollover);
            displayObject.onRollOut.Add(__rollout);
            displayObject.onTouchBegin.Add(__touchBegin);
            displayObject.onRemovedFromStage.Add(__removedFromStage);
            displayObject.onClick.Add(__click);
        }
Beispiel #3
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);
        }