FairyGUI.GComboBox.ConstructFromXML C# (CSharp) Method

ConstructFromXML() public method

public ConstructFromXML ( XML cxml ) : void
cxml FairyGUI.Utils.XML
return void
        public override void ConstructFromXML(XML cxml)
        {
            base.ConstructFromXML(cxml);

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

            string str;

            _buttonController = GetController("button");
            _titleObject = GetChild("title");
            _iconObject = GetChild("icon");

            str = xml.GetAttribute("dropdown");
            if (str != null && str.Length > 0)
            {
                dropdown = UIPackage.CreateObjectFromURL(str) as GComponent;
                if (dropdown == null)
                {
                    Debug.LogWarning("FairyGUI: " + this.resourceURL + " should be a component.");
                    return;
                }

                _list = dropdown.GetChild("list") as GList;
                if (_list == null)
                {
                    Debug.LogWarning("FairyGUI: " + this.resourceURL + ": should container a list component named list.");
                    return;
                }
                _list.onClickItem.Add(__clickItem);

                _list.AddRelation(dropdown, RelationType.Width);
                _list.RemoveRelation(dropdown, RelationType.Height);

                dropdown.AddRelation(_list, RelationType.Height);
                dropdown.RemoveRelation(_list, RelationType.Width);

                dropdown.SetHome(this);
            }

            displayObject.onRollOver.Add(__rollover);
            displayObject.onRollOut.Add(__rollout);
            displayObject.onTouchBegin.Add(__touchBegin);
            displayObject.onTouchEnd.Add(__touchEnd);
        }

Usage Example

示例#1
0
 static public int ConstructFromXML(IntPtr l)
 {
     try {
         FairyGUI.GComboBox self = (FairyGUI.GComboBox)checkSelf(l);
         FairyGUI.Utils.XML a1;
         checkType(l, 2, out a1);
         self.ConstructFromXML(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
All Usage Examples Of FairyGUI.GComboBox::ConstructFromXML