public override void Load(XPathNodeIterator iterator, MpeParser parser) { base.Load(iterator, parser); MpeLog.Debug("MpeCheckBox.Load()"); this.parser = parser; label.Load(iterator, parser); label.Enabled = false; tags.Remove("label"); tags.Remove("align"); tags.Remove("textcolor"); tags.Remove("disabledcolor"); tags.Remove("font"); // Textures Texture = parser.GetImageFile(iterator, "textureCheckmarkNoFocus", Texture); tags.Remove("textureCheckmarkNoFocus"); TextureChecked = parser.GetImageFile(iterator, "textureCheckmark", TextureChecked); tags.Remove("textureCheckmark"); int w = parser.GetInt(iterator, "MarkWidth", TextureSize.Width); tags.Remove("MarkWidth"); int h = parser.GetInt(iterator, "MarkHeight", TextureSize.Height); tags.Remove("MarkHeight"); TextureSize = new Size(w, h); Modified = false; }
public override void Load(XPathNodeIterator iterator, MpeParser parser) { MpeLog.Debug("MpeSelectButton.Load()"); base.Load(iterator, parser); this.parser = parser; // Regular Button Properties label.Load(iterator, parser); label.AutoSize = false; label.Size = new Size(parser.GetInt(iterator, "width", Width), parser.GetInt(iterator, "height", Height)); offset = new Point(parser.GetInt(iterator, "textXOff2", offset.X), parser.GetInt(iterator, "textYOff2", offset.Y)); TextureButton = parser.GetImageFile(iterator, "textureNoFocus", TextureButton); TextureButtonFocus = parser.GetImageFile(iterator, "textureFocus", TextureButton); tags.Remove("align"); tags.Remove("font"); tags.Remove("textcolor"); tags.Remove("disabledcolor"); tags.Remove("label"); tags.Remove("textXOff"); tags.Remove("textYOff"); tags.Remove("textureFocus"); tags.Remove("textureNoFocus"); // Select Button Properties int x = parser.GetInt(iterator, "textXOff", TexturePadding.Width); TextureSize = new Size(parser.GetInt(iterator, "textureWidth", textureSize.Width), parser.GetInt(iterator, "textureHeight", textureSize.Height)); TexturePadding = new MpeControlPadding(x / 2, (Height - textureSize.Height) / 2); TextureBackground = parser.GetImageFile(iterator, "texturebg", TextureBack); TextureLeft = parser.GetImageFile(iterator, "textureLeft", TextureLeft); TextureLeftFocus = parser.GetImageFile(iterator, "textureLeftFocus", TextureLeftFocus); TextureRight = parser.GetImageFile(iterator, "textureRight", TextureRight); TextureRightFocus = parser.GetImageFile(iterator, "textureRightFocus", TextureRightFocus); tags.Remove("texturebg"); tags.Remove("textureLeft"); tags.Remove("textureLeftFocus"); tags.Remove("textureRight"); tags.Remove("textureRightFocus"); tags.Remove("textureWidth"); tags.Remove("textureHeight"); tags.Remove("textXOff2"); tags.Remove("textYOff2"); // Get SubItems items.Values.Clear(); XPathNodeIterator i = iterator.Current.Select("subitems/subitem"); while (i.MoveNext()) { MpeItem item = new MpeItem(); item.Value = i.Current.Value; items.Values.Add(item); } Prepare(); Modified = false; }
public override void Load(XPathNodeIterator iterator, MpeParser parser) { MpeLog.Debug("MpeSpinButton.Load()"); base.Load(iterator, parser); this.parser = parser; label.Load(iterator, parser); TextureUp = parser.GetImageFile(iterator, "textureUp", TextureUp); TextureUpFocus = parser.GetImageFile(iterator, "textureUpFocus", TextureUpFocus); TextureDown = parser.GetImageFile(iterator, "textureDown", TextureDown); TextureDownFocus = parser.GetImageFile(iterator, "textureDownFocus", TextureDownFocus); int w = parser.GetInt(iterator, "width", TextureSize.Width); int h = parser.GetInt(iterator, "height", TextureSize.Height); TextureSize = new Size(w, h); string s = parser.GetString(iterator, "orientation", ""); if (s.Equals("vertical")) { Orientation = MpeControlOrientation.Vertical; } else { Orientation = MpeControlOrientation.Horizontal; } Reverse = parser.GetBoolean(iterator, "reverse", Reverse); ShowRange = parser.GetBoolean(iterator, "showrange", ShowRange); // Load SubItems s = parser.GetString(iterator, "subtype", ""); if (s.Equals("integer")) { items.Type = MpeItemType.Integer; items.First = parser.GetString(iterator, "subitems/first", items.First); items.Last = parser.GetString(iterator, "subitems/last", items.Last); items.Digits = parser.GetString(iterator, "subitems/digits", items.Digits); items.Interval = parser.GetString(iterator, "subitems/interval", items.Interval); } else if (s.Equals("float")) { items.Type = MpeItemType.Float; items.First = parser.GetString(iterator, "subitems/first", items.First); items.Last = parser.GetString(iterator, "subitems/last", items.Last); items.Digits = parser.GetString(iterator, "subitems/digits", items.Digits); items.Interval = parser.GetString(iterator, "subitems/interval", items.Interval); } // Remove known tags tags.Remove("align"); tags.Remove("font"); tags.Remove("textcolor"); tags.Remove("disabledcolor"); tags.Remove("label"); tags.Remove("orientation"); tags.Remove("reverse"); tags.Remove("showrange"); tags.Remove("subtype"); tags.Remove("textureDown"); tags.Remove("textureDownFocus"); tags.Remove("textureUp"); tags.Remove("textureUpFocus"); SetLabel(); Prepare(); Modified = false; }