Пример #1
0
 public MpeSelectButton() : base()
 {
   MpeLog.Debug("MpeSelectButton()");
   Type = MpeControlType.SelectButton;
   layoutStyle = MpeLayoutStyle.HorizontalFlow;
   autoSize = false;
   active = false;
   offset = Point.Empty;
   textureSize = new Size(32, 32);
   items = new MpeItemManager();
   items.Type = MpeItemType.Text;
   items.TypeChanging += new MpeItemManager.TypeChangingHandler(OnItemTypeChanging);
   leftImage = new MpeImage();
   leftImage.Embedded = true;
   leftImage.AutoSize = false;
   leftImage.Size = textureSize;
   leftImage.Padding = new MpeControlPadding(8);
   rightImage = new MpeImage();
   rightImage.Embedded = true;
   rightImage.AutoSize = false;
   rightImage.Size = textureSize;
   rightImage.Padding = new MpeControlPadding(8);
   label = new MpeLabel();
   label.Embedded = true;
   Prepare();
 }
 public MpeSelectButton() : base()
 {
     MpeLog.Debug("MpeSelectButton()");
     Type                = MpeControlType.SelectButton;
     layoutStyle         = MpeLayoutStyle.HorizontalFlow;
     autoSize            = false;
     active              = false;
     offset              = Point.Empty;
     textureSize         = new Size(32, 32);
     items               = new MpeItemManager();
     items.Type          = MpeItemType.Text;
     items.TypeChanging += new MpeItemManager.TypeChangingHandler(OnItemTypeChanging);
     leftImage           = new MpeImage();
     leftImage.Embedded  = true;
     leftImage.AutoSize  = false;
     leftImage.Size      = textureSize;
     leftImage.Padding   = new MpeControlPadding(8);
     rightImage          = new MpeImage();
     rightImage.Embedded = true;
     rightImage.AutoSize = false;
     rightImage.Size     = textureSize;
     rightImage.Padding  = new MpeControlPadding(8);
     label               = new MpeLabel();
     label.Embedded      = true;
     Prepare();
 }
Пример #3
0
 public MpeImage(MpeImage image) : base(image)
 {
     MpeLog.Debug("MpeImage(image)");
     textureFile     = image.textureFile;
     textureImage    = image.textureImage;
     keepAspectRatio = image.keepAspectRatio;
     centered        = image.centered;
     filtered        = image.filtered;
     colorKey        = image.colorKey;
     diffuseColor    = image.diffuseColor;
 }
Пример #4
0
 public MpeImage(MpeImage image) : base(image)
 {
   MpeLog.Debug("MpeImage(image)");
   textureFile = image.textureFile;
   textureImage = image.textureImage;
   keepAspectRatio = image.keepAspectRatio;
   centered = image.centered;
   filtered = image.filtered;
   colorKey = image.colorKey;
   diffuseColor = image.diffuseColor;
 }
Пример #5
0
 public MpeCheckBox(MpeCheckBox checkbox) : base(checkbox)
 {
   MpeLog.Debug("MpeCheckBox(checkbox)");
   Type = MpeControlType.CheckBox;
   AllowDrop = false;
   label = new MpeLabel(checkbox.label);
   image = new MpeImage(checkbox.image);
   textureFile = checkbox.textureFile;
   textureCheckedFile = checkbox.textureCheckedFile;
   Controls.Add(label);
   Controls.Add(image);
 }
 public MpeCheckBox(MpeCheckBox checkbox) : base(checkbox)
 {
     MpeLog.Debug("MpeCheckBox(checkbox)");
     Type               = MpeControlType.CheckBox;
     AllowDrop          = false;
     label              = new MpeLabel(checkbox.label);
     image              = new MpeImage(checkbox.image);
     textureFile        = checkbox.textureFile;
     textureCheckedFile = checkbox.textureCheckedFile;
     Controls.Add(label);
     Controls.Add(image);
 }
Пример #7
0
 public MpeContainer() : base()
 {
   MpeLog.Debug("MpeContainer()");
   backImage = new MpeImage();
   backImage.Embedded = true;
   backImage.AutoSize = false;
   backImage.Id = 1;
   layoutStyle = MpeLayoutStyle.Grid;
   gridSize = new Size(8, 8);
   showGrid = true;
   showBorder = true;
   snapToGrid = true;
   spacing = 0;
   spring = false;
 }
Пример #8
0
 public MpeContainer() : base()
 {
     MpeLog.Debug("MpeContainer()");
     backImage          = new MpeImage();
     backImage.Embedded = true;
     backImage.AutoSize = false;
     backImage.Id       = 1;
     layoutStyle        = MpeLayoutStyle.Grid;
     gridSize           = new Size(8, 8);
     showGrid           = true;
     showBorder         = true;
     snapToGrid         = true;
     spacing            = 0;
     spring             = false;
 }
Пример #9
0
 public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference)
 {
     if (doc != null && node != null)
     {
         base.Save(doc, node, parser, reference);
         if (AutoSize)
         {
             parser.RemoveNode(node, "width");
             parser.RemoveNode(node, "height");
         }
         MpeImage image = null;
         if (reference != null && reference is MpeImage)
         {
             image = (MpeImage)reference;
         }
         // For the reference image, the texture should be set to the default screen background
         if (IsReference)
         {
             parser.SetValue(doc, node, "texture", (MpeScreen.TextureBack != null ? MpeScreen.TextureBack.Name : "-"));
         }
         else
         {
             parser.SetValue(doc, node, "texture", (Texture != null ? Texture.Name : "-"));
         }
         if (image == null || image.Centered != Centered)
         {
             parser.SetValue(doc, node, "centered", Centered ? "yes" : "no");
         }
         if (image == null || image.Filtered != Filtered)
         {
             parser.SetValue(doc, node, "filtered", Filtered ? "yes" : "no");
         }
         if (image == null || image.KeepAspectRatio != KeepAspectRatio)
         {
             parser.SetValue(doc, node, "keepaspectratio", KeepAspectRatio ? "yes" : "no");
         }
         if (image == null || image.ColorKey != ColorKey)
         {
             parser.SetInt(doc, node, "colorkey", ColorKey);
         }
     }
 }
 public MpeSelectButton(MpeSelectButton sb) : base(sb)
 {
     MpeLog.Debug("MpeSelectButton(sb)");
     Type                   = MpeControlType.SelectButton;
     offset                 = sb.offset;
     leftImage              = new MpeImage(sb.leftImage);
     rightImage             = new MpeImage(sb.rightImage);
     label                  = new MpeLabel(sb.label);
     items                  = new MpeItemManager(sb.items);
     items.TypeChanging    += new MpeItemManager.TypeChangingHandler(OnItemTypeChanging);
     textureSize            = sb.textureSize;
     buttonTextureFile      = sb.buttonTextureFile;
     buttonFocusTextureFile = sb.buttonFocusTextureFile;
     backTextureFile        = sb.backTextureFile;
     leftTextureFile        = sb.leftTextureFile;
     leftFocusTextureFile   = sb.leftFocusTextureFile;
     rightTextureFile       = sb.rightTextureFile;
     rightFocusTextureFile  = sb.rightFocusTextureFile;
     Prepare();
 }
Пример #11
0
 public MpeCheckBox() : base()
 {
   MpeLog.Debug("MpeCheckBox()");
   Type = MpeControlType.CheckBox;
   AllowDrop = false;
   alignment = MpeControlAlignment.Right;
   layoutStyle = MpeLayoutStyle.HorizontalFlow;
   spring = false;
   spacing = 5;
   showBorder = false;
   autoSize = true;
   controlLock.Size = true;
   image = new MpeImage();
   image.Embedded = true;
   image.AutoSize = false;
   label = new MpeLabel();
   label.Embedded = true;
   label.Text = "MpeCheckBox";
   Controls.Add(label);
   Controls.Add(image);
 }
 public MpeCheckBox() : base()
 {
     MpeLog.Debug("MpeCheckBox()");
     Type             = MpeControlType.CheckBox;
     AllowDrop        = false;
     alignment        = MpeControlAlignment.Right;
     layoutStyle      = MpeLayoutStyle.HorizontalFlow;
     spring           = false;
     spacing          = 5;
     showBorder       = false;
     autoSize         = true;
     controlLock.Size = true;
     image            = new MpeImage();
     image.Embedded   = true;
     image.AutoSize   = false;
     label            = new MpeLabel();
     label.Embedded   = true;
     label.Text       = "MpeCheckBox";
     Controls.Add(label);
     Controls.Add(image);
 }
Пример #13
0
 public MpeContainer(MpeContainer container) : base(container)
 {
   MpeLog.Debug("MpeContainer(container)");
   backImage = new MpeImage(container.backImage);
   layoutStyle = container.layoutStyle;
   gridSize = container.gridSize;
   showGrid = container.showGrid;
   showBorder = container.showBorder;
   snapToGrid = container.snapToGrid;
   spring = container.spring;
   spacing = container.spacing;
   for (int i = 0; i < container.Controls.Count; i++)
   {
     if (container.Controls[i] is MpeControl)
     {
       MpeControl c = (MpeControl) container.Controls[i];
       if (c.Embedded == false)
       {
         Controls.Add(c.Copy());
       }
     }
   }
 }
 public MpeSpinButton(MpeSpinButton spinner) : base(spinner)
 {
     MpeLog.Debug("MpeSpinButton(spinner)");
     orientation                = spinner.orientation;
     reverse                    = spinner.reverse;
     showRange                  = spinner.showRange;
     textureUp                  = spinner.textureUp;
     textureUpFocus             = spinner.textureUpFocus;
     textureDown                = spinner.textureDown;
     textureDownFocus           = spinner.textureDownFocus;
     label                      = new MpeLabel(spinner.label);
     imageUp                    = new MpeImage(spinner.imageUp);
     imageDown                  = new MpeImage(spinner.imageDown);
     imageGroup                 = new MpeGroup(spinner.imageGroup);
     items                      = new MpeItemManager(spinner.items);
     items.TypeChanging        += new MpeItemManager.TypeChangingHandler(OnItemTypeChanging);
     items.Values.ItemInserted += new MpeItemCollection.ItemInsertedHandler(OnItemInserted);
     items.Values.ItemRemoved  += new MpeItemCollection.ItemRemovedHandler(OnItemRemoved);
     items.Values.ItemSet      += new MpeItemCollection.ItemSetHandler(OnItemSet);
     items.Values.ItemsCleared += new MpeItemCollection.ItemsClearedHandler(OnItemsCleared);
     SetLabel();
     Prepare();
 }
Пример #15
0
 public MpeContainer(MpeContainer container) : base(container)
 {
     MpeLog.Debug("MpeContainer(container)");
     backImage   = new MpeImage(container.backImage);
     layoutStyle = container.layoutStyle;
     gridSize    = container.gridSize;
     showGrid    = container.showGrid;
     showBorder  = container.showBorder;
     snapToGrid  = container.snapToGrid;
     spring      = container.spring;
     spacing     = container.spacing;
     for (int i = 0; i < container.Controls.Count; i++)
     {
         if (container.Controls[i] is MpeControl)
         {
             MpeControl c = (MpeControl)container.Controls[i];
             if (c.Embedded == false)
             {
                 Controls.Add(c.Copy());
             }
         }
     }
 }
Пример #16
0
 public MpeSpinButton() : base()
 {
   MpeLog.Debug("MpeSpinButton()");
   Type = MpeControlType.SpinButton;
   orientation = MpeControlOrientation.Horizontal;
   alignment = MpeControlAlignment.Right;
   reverse = false;
   spacing = 5;
   layoutStyle = MpeLayoutStyle.HorizontalFlow;
   alignment = MpeControlAlignment.Left;
   autoSize = true;
   controlLock.Size = true;
   // Label
   label = new MpeLabel();
   label.Embedded = true;
   // Images
   imageGroup = new MpeGroup();
   imageGroup.Embedded = true;
   imageGroup.ShowBorder = false;
   imageGroup.LayoutStyle = MpeLayoutStyle.VerticalFlow;
   imageUp = new MpeImage();
   imageUp.Embedded = true;
   imageUp.Size = new Size(16, 16);
   imageDown = new MpeImage();
   imageDown.Embedded = true;
   imageDown.Size = new Size(16, 16);
   // Items
   items = new MpeItemManager();
   items.Type = MpeItemType.Integer;
   items.TypeChanging += new MpeItemManager.TypeChangingHandler(OnItemTypeChanging);
   items.Values.ItemInserted += new MpeItemCollection.ItemInsertedHandler(OnItemInserted);
   items.Values.ItemRemoved += new MpeItemCollection.ItemRemovedHandler(OnItemRemoved);
   items.Values.ItemSet += new MpeItemCollection.ItemSetHandler(OnItemSet);
   items.Values.ItemsCleared += new MpeItemCollection.ItemsClearedHandler(OnItemsCleared);
   SetLabel();
   Prepare();
 }
 public MpeSpinButton() : base()
 {
     MpeLog.Debug("MpeSpinButton()");
     Type             = MpeControlType.SpinButton;
     orientation      = MpeControlOrientation.Horizontal;
     alignment        = MpeControlAlignment.Right;
     reverse          = false;
     spacing          = 5;
     layoutStyle      = MpeLayoutStyle.HorizontalFlow;
     alignment        = MpeControlAlignment.Left;
     autoSize         = true;
     controlLock.Size = true;
     // Label
     label          = new MpeLabel();
     label.Embedded = true;
     // Images
     imageGroup             = new MpeGroup();
     imageGroup.Embedded    = true;
     imageGroup.ShowBorder  = false;
     imageGroup.LayoutStyle = MpeLayoutStyle.VerticalFlow;
     imageUp            = new MpeImage();
     imageUp.Embedded   = true;
     imageUp.Size       = new Size(16, 16);
     imageDown          = new MpeImage();
     imageDown.Embedded = true;
     imageDown.Size     = new Size(16, 16);
     // Items
     items                      = new MpeItemManager();
     items.Type                 = MpeItemType.Integer;
     items.TypeChanging        += new MpeItemManager.TypeChangingHandler(OnItemTypeChanging);
     items.Values.ItemInserted += new MpeItemCollection.ItemInsertedHandler(OnItemInserted);
     items.Values.ItemRemoved  += new MpeItemCollection.ItemRemovedHandler(OnItemRemoved);
     items.Values.ItemSet      += new MpeItemCollection.ItemSetHandler(OnItemSet);
     items.Values.ItemsCleared += new MpeItemCollection.ItemsClearedHandler(OnItemsCleared);
     SetLabel();
     Prepare();
 }
Пример #18
0
 public MpeSelectButton(MpeSelectButton sb) : base(sb)
 {
   MpeLog.Debug("MpeSelectButton(sb)");
   Type = MpeControlType.SelectButton;
   offset = sb.offset;
   leftImage = new MpeImage(sb.leftImage);
   rightImage = new MpeImage(sb.rightImage);
   label = new MpeLabel(sb.label);
   items = new MpeItemManager(sb.items);
   items.TypeChanging += new MpeItemManager.TypeChangingHandler(OnItemTypeChanging);
   textureSize = sb.textureSize;
   buttonTextureFile = sb.buttonTextureFile;
   buttonFocusTextureFile = sb.buttonFocusTextureFile;
   backTextureFile = sb.backTextureFile;
   leftTextureFile = sb.leftTextureFile;
   leftFocusTextureFile = sb.leftFocusTextureFile;
   rightTextureFile = sb.rightTextureFile;
   rightFocusTextureFile = sb.rightFocusTextureFile;
   Prepare();
 }
Пример #19
0
 public MpeSpinButton(MpeSpinButton spinner) : base(spinner)
 {
   MpeLog.Debug("MpeSpinButton(spinner)");
   orientation = spinner.orientation;
   reverse = spinner.reverse;
   showRange = spinner.showRange;
   textureUp = spinner.textureUp;
   textureUpFocus = spinner.textureUpFocus;
   textureDown = spinner.textureDown;
   textureDownFocus = spinner.textureDownFocus;
   label = new MpeLabel(spinner.label);
   imageUp = new MpeImage(spinner.imageUp);
   imageDown = new MpeImage(spinner.imageDown);
   imageGroup = new MpeGroup(spinner.imageGroup);
   items = new MpeItemManager(spinner.items);
   items.TypeChanging += new MpeItemManager.TypeChangingHandler(OnItemTypeChanging);
   items.Values.ItemInserted += new MpeItemCollection.ItemInsertedHandler(OnItemInserted);
   items.Values.ItemRemoved += new MpeItemCollection.ItemRemovedHandler(OnItemRemoved);
   items.Values.ItemSet += new MpeItemCollection.ItemSetHandler(OnItemSet);
   items.Values.ItemsCleared += new MpeItemCollection.ItemsClearedHandler(OnItemsCleared);
   SetLabel();
   Prepare();
 }