Ejemplo n.º 1
0
 protected internal DropdownListWindow(GuiManager guiManager, Widget parent, DropdownList dropdownList)
     : base(guiManager, parent)
 {
     _dropdownList = dropdownList;
     Visible = false;
     Enabled = true;
 }
Ejemplo n.º 2
0
        private static Widget Create(GuiManager guiManager, XmlElement xmlElement, Widget parent)
        {
            var widget = new DropdownList(guiManager, parent)
            {
                SelectedItemIndex = xmlElement.ReadInteger("selectedItemIndex", 0)
            };

            foreach (XmlLinkedNode node in xmlElement)
            {
                var childNode = node as XmlElement;
                if (childNode == null)
                    continue;

                if (!childNode.Name.Equals("items"))
                    continue;

                foreach (XmlLinkedNode childChildNode in childNode)
                {
                    var row = childChildNode as XmlElement;
                    if (row == null)
                        continue;

                    var item = DropdownListItem.Create(row);

                    widget.Items.Add(item);
                }
            }

            return widget;
        }