public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference)
        {
            base.Save(doc, node, parser, reference);
            MpeButton button = null;

            if (reference != null)
            {
                button = (MpeButton)reference;
            }
            // Size
            if (button == null || button.Size != Size)
            {
                parser.SetInt(doc, node, "width", Width);
                parser.SetInt(doc, node, "height", Height);
            }
            // hyperlink
            if (button == null || button.Hyperlink != Hyperlink)
            {
                parser.SetInt(doc, node, "hyperlink", Hyperlink);
            }
            // DiffuseColor
            if (button == null || button.DiffuseColor != DiffuseColor)
            {
                parser.SetColor(doc, node, "colordiffuse", DiffuseColor);
            }
            // TextOffsetX
            if (button == null || button.Padding.Left != Padding.Left)
            {
                parser.SetInt(doc, node, "textXOff", Padding.Left);
            }
            // TextOffsetY
            if (button == null || button.Padding.Top != Padding.Top)
            {
                parser.SetInt(doc, node, "textYOff", Padding.Top);
            }
            // TextureFocus
            if (button == null || button.TextureFocus == null || button.TextureFocus.Equals(TextureFocus) == false)
            {
                if (TextureFocus == null)
                {
                    parser.SetValue(doc, node, "textureFocus", "-");
                }
                else
                {
                    parser.SetValue(doc, node, "textureFocus", TextureFocus.Name);
                }
            }
            // TextureNoFocus
            if (button == null || button.TextureNoFocus == null || button.TextureNoFocus.Equals(TextureNoFocus) == false)
            {
                if (TextureNoFocus == null)
                {
                    parser.SetValue(doc, node, "textureNoFocus", "-");
                }
                else
                {
                    parser.SetValue(doc, node, "textureNoFocus", TextureNoFocus.Name);
                }
            }
        }
Beispiel #2
0
 public MpeButton(MpeButton button) : base(button)
 {
   MpeLog.Debug("MpeButton(button)");
   Type = MpeControlType.Button;
   textureFocus = button.textureFocus;
   textureFocusImage = button.textureFocusImage;
   textureNoFocus = button.textureNoFocus;
   textureNoFocusImage = button.textureNoFocusImage;
   diffuseColor = button.diffuseColor;
 }
 public MpeButton(MpeButton button) : base(button)
 {
     MpeLog.Debug("MpeButton(button)");
     Type                = MpeControlType.Button;
     textureFocus        = button.textureFocus;
     textureFocusImage   = button.textureFocusImage;
     textureNoFocus      = button.textureNoFocus;
     textureNoFocusImage = button.textureNoFocusImage;
     diffuseColor        = button.diffuseColor;
 }