Пример #1
0
 public override void SetValue(object component, object value)
 {
     if (value is MpeItem)
     {
         item = (MpeItem)value;
     }
 }
        public void Add(MpeItemType type, string value)
        {
            MpeItem item = new MpeItem();

            item.Type  = type;
            item.Value = value;
            Add(item);
        }
        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;
        }
Пример #4
0
 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;
 }
Пример #5
0
 public MpeItemDescriptor(MpeItem item, int index, int count) : base(item.Value, null)
 {
   this.item = item;
   this.index = index;
   this.count = count;
 }
 private void OnItemSet(int index, MpeItem oldItem, MpeItem newItem)
 {
     MpeLog.Debug("OnItemSet()");
     SetLabel();
 }
 private void OnItemRemoved(int index, MpeItem item)
 {
     MpeLog.Debug("OnItemRemoved()");
     SetLabel();
 }
Пример #8
0
 public void Add(MpeItem item)
 {
   List.Add(item);
 }
Пример #9
0
 public void Add(MpeItemType type, string value)
 {
   MpeItem item = new MpeItem();
   item.Type = type;
   item.Value = value;
   Add(item);
 }
Пример #10
0
 public MpeItem(MpeItem item)
 {
     text      = item.text;
     textValue = item.textValue;
     type      = item.type;
 }
Пример #11
0
 public void Remove(MpeItem item)
 {
   List.Remove(item);
 }
Пример #12
0
 public MpeItemDescriptor(MpeItem item, int index, int count) : base(item.Value, null)
 {
     this.item  = item;
     this.index = index;
     this.count = count;
 }
Пример #13
0
 public override void SetValue(object component, object value)
 {
   if (value is MpeItem)
   {
     item = (MpeItem) value;
   }
 }
Пример #14
0
 private void OnItemRemoved(int index, MpeItem item)
 {
   MpeLog.Debug("OnItemRemoved()");
   SetLabel();
 }
Пример #15
0
 private void OnItemSet(int index, MpeItem oldItem, MpeItem newItem)
 {
   MpeLog.Debug("OnItemSet()");
   SetLabel();
 }
Пример #16
0
 public MpeItem(MpeItem item)
 {
   text = item.text;
   textValue = item.textValue;
   type = item.type;
 }
 public void Add(MpeItem item)
 {
     List.Add(item);
 }
 public void Remove(MpeItem item)
 {
     List.Remove(item);
 }