diff --git a/Neoforce/ArchiveManager.cs b/Neoforce/ArchiveManager.cs
deleted file mode 100644
index 1bb86d5..0000000
--- a/Neoforce/ArchiveManager.cs
+++ /dev/null
@@ -1,286 +0,0 @@
-////////////////////////////////////////////////////////////////
-// //
-// Neoforce Controls //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// File: ArchiveManager.cs //
-// //
-// Version: 0.7 //
-// //
-// Date: 11/09/2010 //
-// //
-// Author: Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// Copyright (c) by Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-
-
-#region //// Using /////////////
-
-////////////////////////////////////////////////////////////////////////////
-using System;
-using System.Collections.Generic;
-using System.IO;
-using Microsoft.Xna.Framework.Content;
-using TomShane.Neoforce.External.Zip;
-using System.Globalization;
-////////////////////////////////////////////////////////////////////////////
-
-#endregion
-
-namespace TomShane.Neoforce.Controls
-{
-
- #region //// Classes ///////////
-
- ////////////////////////////////////////////////////////////////////////////
- ///
- public class ArchiveManager : ContentManager
- {
-
- #region //// Fields ////////////
-
- ////////////////////////////////////////////////////////////////////////////
- private string archivePath = null;
- private ZipFile archive = null;
- private bool useArchive = false;
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Properties ////////
-
- ////////////////////////////////////////////////////////////////////////////
- ///
- public virtual string ArchivePath
- {
- get { return archivePath; }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public bool UseArchive
- {
- get { return useArchive; }
- set { useArchive = value; }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Constructors //////
-
- ////////////////////////////////////////////////////////////////////////////
- ///
- public ArchiveManager(IServiceProvider serviceProvider) : this(serviceProvider, null) { }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- ///
- public ArchiveManager(IServiceProvider serviceProvider, string archive): base(serviceProvider)
- {
- if (archive != null)
- {
- this.archive = ZipFile.Read(archive);
- archivePath = archive;
- useArchive = true;
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Methods ///////////
-
- ////////////////////////////////////////////////////////////////////////////
- ///
- protected override Stream OpenStream(string assetName)
- {
- if (useArchive && archive != null)
- {
- assetName = assetName.Replace("\\", "/");
- if (assetName.StartsWith("/")) assetName = assetName.Remove(0, 1);
-
- string fullAssetName = (assetName + ".xnb").ToLower();
-
- foreach (ZipEntry entry in archive)
- {
- ZipDirEntry ze = new ZipDirEntry(entry);
-
- string entryName = entry.FileName.ToLower();
-
- if (entryName == fullAssetName)
- {
- return entry.GetStream();
- }
- }
- throw new Exception("Cannot find asset \"" + assetName + "\" in the archive.");
- }
- else
- {
- return base.OpenStream(assetName);
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- ///
- public string[] GetAssetNames()
- {
- if (useArchive && archive != null)
- {
- List filenames = new List();
-
- foreach (ZipEntry entry in archive)
- {
- string name = entry.FileName;
- if (name.EndsWith(".xnb"))
- {
- name = name.Remove(name.Length - 4, 4);
- filenames.Add(name);
- }
- }
- return filenames.ToArray();
- }
- else
- {
- return null;
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- ///
- public string[] GetAssetNames(string path)
- {
- if (useArchive && archive != null)
- {
- if (path != null && path != "" && path != "\\" && path != "/")
- {
- List filenames = new List();
-
- foreach (ZipEntry entry in archive)
- {
- string name = entry.FileName;
- if (name.EndsWith(".xnb"))
- {
- name = name.Remove(name.Length - 4, 4);
- }
-
- string[] parts = name.Split('/');
- string dir = "";
- for (int i = 0; i < parts.Length - 1; i++)
- {
- dir += parts[i] + '/';
- }
-
- path = path.Replace("\\", "/");
- if (path.StartsWith("/")) path = path.Remove(0, 1);
- if (!path.EndsWith("/")) path += '/';
-
- if (dir.ToLower() == path.ToLower() && !name.EndsWith("/"))
- {
- filenames.Add(name);
- }
- }
- return filenames.ToArray();
- }
- else
- {
- return GetAssetNames();
- }
- }
- else
- {
- return null;
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- ///
- public Stream GetFileStream(string filename)
- {
- if (useArchive && archive != null)
- {
- filename = filename.Replace("\\", "/").ToLower();
- if (filename.StartsWith("/")) filename = filename.Remove(0, 1);
-
- foreach (ZipEntry entry in archive)
- {
- string entryName = entry.FileName.ToLower();
-
- if (entryName.Equals(filename))
- return entry.GetStream();
- }
-
- throw new Exception("Cannot find file \"" + filename + "\" in the archive.");
- }
- else
- {
- return null;
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public string[] GetDirectories(string path)
- {
- if (useArchive && archive != null)
- {
- if (path != null && path != "" && path != "\\" && path != "/")
- {
- List dirs = new List();
-
- path = path.Replace("\\", "/");
- if (path.StartsWith("/")) path = path.Remove(0, 1);
- if (!path.EndsWith("/")) path += '/';
-
- foreach (ZipEntry entry in archive)
- {
- string name = entry.FileName;
- if (name.ToLower().StartsWith(path.ToLower()))
- {
- int i = name.IndexOf("/", path.Length);
- string item = name.Substring(path.Length, i - path.Length) + "\\";
- if (!dirs.Contains(item))
- {
- dirs.Add(item);
- }
- }
- }
- return dirs.ToArray();
- }
- else
- {
- return GetAssetNames();
- }
- }
- else if (Directory.Exists(path))
- {
- string[] dirs = Directory.GetDirectories(path);
-
- for (int i = 0; i < dirs.Length; i++)
- {
- string[] parts = dirs[i].Split('\\');
- dirs[i] = parts[parts.Length - 1] + '\\';
- }
-
- return dirs;
- }
- else return null;
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
-}
diff --git a/Neoforce/Bevel.cs b/Neoforce/Bevel.cs
deleted file mode 100644
index a7995db..0000000
--- a/Neoforce/Bevel.cs
+++ /dev/null
@@ -1,306 +0,0 @@
-////////////////////////////////////////////////////////////////
-// //
-// Neoforce Controls //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// File: Bevel.cs //
-// //
-// Version: 0.7 //
-// //
-// Date: 11/09/2010 //
-// //
-// Author: Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// Copyright (c) by Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-
-#region //// Using /////////////
-
-using Microsoft.Xna.Framework;
-////////////////////////////////////////////////////////////////////////////
-using Microsoft.Xna.Framework.Graphics;
-////////////////////////////////////////////////////////////////////////////
-
-#endregion
-
-namespace TomShane.Neoforce.Controls
-{
-
- #region //// Enums /////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public enum BevelStyle
- {
- None,
- Flat,
- Etched,
- Bumped,
- Lowered,
- Raised
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public enum BevelBorder
- {
- None,
- Left,
- Top,
- Right,
- Bottom,
- All
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- public class Bevel: Control
- {
-
- #region //// Fields ////////////
-
- ////////////////////////////////////////////////////////////////////////////
- private BevelBorder border = BevelBorder.All;
- private BevelStyle style = BevelStyle.Etched;
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Properties ////////
-
- ////////////////////////////////////////////////////////////////////////////
- public BevelBorder Border
- {
- get { return border; }
- set
- {
- if (border != value)
- {
- border = value;
- if (!Suspended) OnBorderChanged(new EventArgs());
- }
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public BevelStyle Style
- {
- get { return style; }
- set
- {
- if (style != value)
- {
- style = value;
- if (!Suspended) OnStyleChanged(new EventArgs());
- }
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Events ////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public event EventHandler BorderChanged;
- public event EventHandler StyleChanged;
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Construstors //////
-
- ////////////////////////////////////////////////////////////////////////////
- public Bevel(Manager manager): base(manager)
- {
- CanFocus = false;
- Passive = true;
- Width = 64;
- Height = 64;
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Methods ///////////
-
- ////////////////////////////////////////////////////////////////////////////
- public override void Init()
- {
- base.Init();
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected internal override void InitSkin()
- {
- base.InitSkin();
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
- {
- if (Border != BevelBorder.None && Style != BevelStyle.None)
- {
- if (Border != BevelBorder.All)
- {
- DrawPart(renderer, rect, Border, Style, false);
- }
- else
- {
- DrawPart(renderer, rect, BevelBorder.Left, Style, true);
- DrawPart(renderer, rect, BevelBorder.Top, Style, true);
- DrawPart(renderer, rect, BevelBorder.Right, Style, true);
- DrawPart(renderer, rect, BevelBorder.Bottom, Style, true);
- }
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- private void DrawPart(Renderer renderer, Rectangle rect, BevelBorder pos, BevelStyle style, bool all)
- {
- SkinLayer layer = Skin.Layers["Control"];
- Color c1 = Utilities.ParseColor(layer.Attributes["LightColor"].Value);
- Color c2 = Utilities.ParseColor(layer.Attributes["DarkColor"].Value);
- Color c3 = Utilities.ParseColor(layer.Attributes["FlatColor"].Value);
-
- if (Color != UndefinedColor) c3 = Color;
-
- Texture2D img = Skin.Layers["Control"].Image.Resource;
-
- int x1 = 0; int y1 = 0; int w1 = 0; int h1 = 0;
- int x2 = 0; int y2 = 0; int w2 = 0; int h2 = 0;
-
- if (style == BevelStyle.Bumped || style == BevelStyle.Etched)
- {
- if (all && (pos == BevelBorder.Top || pos == BevelBorder.Bottom))
- {
- rect = new Rectangle(rect.Left + 1, rect.Top, rect.Width - 2, rect.Height);
- }
- else if (all && (pos == BevelBorder.Left))
- {
- rect = new Rectangle(rect.Left, rect.Top, rect.Width, rect.Height - 1);
- }
- switch (pos)
- {
- case BevelBorder.Left:
- {
- x1 = rect.Left; y1 = rect.Top; w1 = 1; h1 = rect.Height;
- x2 = x1 + 1; y2 = y1; w2 = w1; h2 = h1;
- break;
- }
- case BevelBorder.Top:
- {
- x1 = rect.Left; y1 = rect.Top; w1 = rect.Width; h1 = 1;
- x2 = x1; y2 = y1 + 1; w2 = w1; h2 = h1;
- break;
- }
- case BevelBorder.Right:
- {
- x1 = rect.Left + rect.Width - 2; y1 = rect.Top; w1 = 1; h1 = rect.Height;
- x2 = x1 + 1; y2 = y1; w2 = w1; h2 = h1;
- break;
- }
- case BevelBorder.Bottom:
- {
- x1 = rect.Left; y1 = rect.Top + rect.Height - 2; w1 = rect.Width; h1 = 1;
- x2 = x1; y2 = y1 + 1; w2 = w1; h2 = h1;
- break;
- }
- }
- }
- else
- {
- switch (pos)
- {
- case BevelBorder.Left:
- {
- x1 = rect.Left; y1 = rect.Top; w1 = 1; h1 = rect.Height;
- break;
- }
- case BevelBorder.Top:
- {
- x1 = rect.Left; y1 = rect.Top; w1 = rect.Width; h1 = 1;
- break;
- }
- case BevelBorder.Right:
- {
- x1 = rect.Left + rect.Width - 1; y1 = rect.Top; w1 = 1; h1 = rect.Height;
- break;
- }
- case BevelBorder.Bottom:
- {
- x1 = rect.Left; y1 = rect.Top + rect.Height - 1; w1 = rect.Width; h1 = 1;
- break;
- }
- }
- }
-
- switch (Style)
- {
- case BevelStyle.Bumped:
- {
- renderer.Draw(img, new Rectangle(x1, y1, w1, h1), c1);
- renderer.Draw(img, new Rectangle(x2, y2, w2, h2), c2);
- break;
- }
- case BevelStyle.Etched:
- {
- renderer.Draw(img, new Rectangle(x1, y1, w1, h1), c2);
- renderer.Draw(img, new Rectangle(x2, y2, w2, h2), c1);
- break;
- }
- case BevelStyle.Raised:
- {
- Color c = c1;
- if (pos == BevelBorder.Left || pos == BevelBorder.Top) c = c1;
- else c = c2;
-
- renderer.Draw(img, new Rectangle(x1, y1, w1, h1), c);
- break;
- }
- case BevelStyle.Lowered:
- {
- Color c = c1;
- if (pos == BevelBorder.Left || pos == BevelBorder.Top) c = c2;
- else c = c1;
-
- renderer.Draw(img, new Rectangle(x1, y1, w1, h1), c);
- break;
- }
- default:
- {
- renderer.Draw(img, new Rectangle(x1, y1, w1, h1), c3);
- break;
- }
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected virtual void OnBorderChanged(EventArgs e)
- {
- if (BorderChanged != null) BorderChanged.Invoke(this, e);
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected virtual void OnStyleChanged(EventArgs e)
- {
- if (StyleChanged != null) StyleChanged.Invoke(this, e);
- }
- ////////////////////////////////////////////////////////////////////////////
-
-
- #endregion
-
- }
-
-}
diff --git a/Neoforce/Button.cs b/Neoforce/Button.cs
deleted file mode 100644
index 0850113..0000000
--- a/Neoforce/Button.cs
+++ /dev/null
@@ -1,294 +0,0 @@
-////////////////////////////////////////////////////////////////
-// //
-// Neoforce Controls //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// File: Button.cs //
-// //
-// Version: 0.7 //
-// //
-// Date: 11/09/2010 //
-// //
-// Author: Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// Copyright (c) by Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-
-
-#region //// Using /////////////
-
-using Microsoft.Xna.Framework;
-////////////////////////////////////////////////////////////////////////////
-using Microsoft.Xna.Framework.Graphics;
-////////////////////////////////////////////////////////////////////////////
-
-#endregion
-
-namespace TomShane.Neoforce.Controls
-{
-
- #region //// Enums /////////////
-
- ////////////////////////////////////////////////////////////////////////////
- ///
- public enum SizeMode
- {
- Normal,
- Auto,
- Centered,
- Stretched,
- ///
- /// Only Supported by ImageBox
- ///
- Tiled
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- ///
- public enum ButtonMode
- {
- Normal,
- PushButton
- }
- ////////////////////////////////////////////////////////////////////////////
-
-
- #endregion
-
- #region //// Classes ///////////
-
- ////////////////////////////////////////////////////////////////////////////
- ///
- public class Glyph
- {
- ////////////////////////////////////////////////////////////////////////////
- public Texture2D Image = null;
- public SizeMode SizeMode = SizeMode.Stretched;
- public Color Color = Color.White;
- public Point Offset = Point.Zero;
- public Rectangle SourceRect = Rectangle.Empty;
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public Glyph(Texture2D image)
- {
- Image = image;
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public Glyph(Texture2D image, Rectangle sourceRect): this(image)
- {
- SourceRect = sourceRect;
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- ///
- public class Button: ButtonBase
- {
-
- #region //// Consts ////////////
-
- ////////////////////////////////////////////////////////////////////////////
- private const string skButton = "Button";
- private const string lrButton = "Control";
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Fields ////////////
-
- ////////////////////////////////////////////////////////////////////////////
- private Glyph glyph = null;
- private ModalResult modalResult = ModalResult.None;
- private ButtonMode mode = ButtonMode.Normal;
- private bool pushed = false;
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Properties ////////
-
- ////////////////////////////////////////////////////////////////////////////
- public Glyph Glyph
- {
- get { return glyph; }
- set
- {
- glyph = value;
- if (!Suspended) OnGlyphChanged(new EventArgs());
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public ModalResult ModalResult
- {
- get { return modalResult; }
- set { modalResult = value; }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public ButtonMode Mode
- {
- get { return mode; }
- set { mode = value; }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public bool Pushed
- {
- get { return pushed; }
- set
- {
- pushed = value;
- Invalidate();
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Events ////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public event EventHandler GlyphChanged;
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Construstors //////
-
- ////////////////////////////////////////////////////////////////////////////
- public Button(Manager manager): base(manager)
- {
- SetDefaultSize(72, 24);
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Destructors ///////
-
- ////////////////////////////////////////////////////////////////////////////
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- }
- base.Dispose(disposing);
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Methods ///////////
-
- ////////////////////////////////////////////////////////////////////////////
- public override void Init()
- {
- base.Init();
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected internal override void InitSkin()
- {
- base.InitSkin();
- Skin = new SkinControl(Manager.Skin.Controls[skButton]);
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
- {
-
- if (mode == ButtonMode.PushButton && pushed)
- {
- SkinLayer l = Skin.Layers[lrButton];
- renderer.DrawLayer(l, rect, l.States.Pressed.Color, l.States.Pressed.Index);
- if (l.States.Pressed.Overlay)
- {
- renderer.DrawLayer(l, rect, l.Overlays.Pressed.Color, l.Overlays.Pressed.Index);
- }
- }
- else
- {
- base.DrawControl(renderer, rect, gameTime);
- }
-
- SkinLayer layer = Skin.Layers[lrButton];
- SpriteFont font = (layer.Text != null && layer.Text.Font != null) ? layer.Text.Font.Resource : null;
- Color col = Color.White;
- int ox = 0; int oy = 0;
-
- if (ControlState == ControlState.Pressed)
- {
- if (layer.Text != null) col = layer.Text.Colors.Pressed;
- ox = 1; oy = 1;
- }
- if (glyph != null)
- {
- Margins cont = layer.ContentMargins;
- Rectangle r = new Rectangle(rect.Left + cont.Left,
- rect.Top + cont.Top,
- rect.Width - cont.Horizontal,
- rect.Height - cont.Vertical);
- renderer.DrawGlyph(glyph, r);
- }
- else
- {
- renderer.DrawString(this, layer, Text, rect, true, ox, oy);
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- private void OnGlyphChanged(EventArgs e)
- {
- if (GlyphChanged != null) GlyphChanged.Invoke(this, e);
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected override void OnClick(EventArgs e)
- {
- MouseEventArgs ex = (e is MouseEventArgs) ? (MouseEventArgs)e : new MouseEventArgs();
-
- if (ex.Button == MouseButton.Left || ex.Button == MouseButton.None)
- {
- pushed = !pushed;
- }
-
- base.OnClick(e);
-
- if ((ex.Button == MouseButton.Left || ex.Button == MouseButton.None) && Root != null)
- {
- if (Root is Window)
- {
- Window wnd = (Window)Root;
- if (ModalResult != ModalResult.None)
- {
- wnd.Close(ModalResult);
- }
- }
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- }
-
- #endregion
-
-}
diff --git a/Neoforce/ButtonBase.cs b/Neoforce/ButtonBase.cs
deleted file mode 100644
index 5de4bb3..0000000
--- a/Neoforce/ButtonBase.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-////////////////////////////////////////////////////////////////
-// //
-// Neoforce Controls //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// File: ButtonBase.cs //
-// //
-// Version: 0.7 //
-// //
-// Date: 11/09/2010 //
-// //
-// Author: Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// Copyright (c) by Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-
-#region //// Using /////////////
-
-////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////
-
-#endregion
-
-namespace TomShane.Neoforce.Controls
-{
-
- #region //// Classes ///////////
-
- ////////////////////////////////////////////////////////////////////////////
- ///
- public abstract class ButtonBase: Control
- {
-
- #region //// Fields ////////////
-
- ////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Properties ////////
-
- ////////////////////////////////////////////////////////////////////////////
- public override ControlState ControlState
- {
- get
- {
- if (DesignMode) return ControlState.Enabled;
- else if (Suspended) return ControlState.Disabled;
- else
- {
- if (!Enabled) return ControlState.Disabled;
-
- if ((Pressed[(int)MouseButton.Left] && Inside) || (Focused && (Pressed[(int)GamePadActions.Press] || Pressed[(int)MouseButton.None]))) return ControlState.Pressed;
- else if (Hovered && Inside) return ControlState.Hovered;
- else if ((Focused && !Inside) || (Hovered && !Inside) || (Focused && !Hovered && Inside)) return ControlState.Focused;
- else return ControlState.Enabled;
- }
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Events ////////////
-
- ////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Construstors //////
-
- ////////////////////////////////////////////////////////////////////////////
- protected ButtonBase(Manager manager)
- : base(manager)
- {
- SetDefaultSize(72, 24);
- DoubleClicks = false;
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Methods ///////////
-
- ////////////////////////////////////////////////////////////////////////////
- public override void Init()
- {
- base.Init();
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected override void OnClick(EventArgs e)
- {
- MouseEventArgs ex = (e is MouseEventArgs) ? (MouseEventArgs)e : new MouseEventArgs();
- if (ex.Button == MouseButton.Left || ex.Button == MouseButton.None)
- {
- base.OnClick(e);
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- }
-
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
-}
diff --git a/Neoforce/CheckBox.cs b/Neoforce/CheckBox.cs
deleted file mode 100644
index 0b1cb16..0000000
--- a/Neoforce/CheckBox.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-////////////////////////////////////////////////////////////////
-// //
-// Neoforce Controls //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// File: CheckBox.cs //
-// //
-// Version: 0.7 //
-// //
-// Date: 11/09/2010 //
-// //
-// Author: Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// Copyright (c) by Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-
-#region //// Using /////////////
-
-////////////////////////////////////////////////////////////////////////////
-using Microsoft.Xna.Framework;
-////////////////////////////////////////////////////////////////////////////
-
-#endregion
-
-namespace TomShane.Neoforce.Controls
-{
-
- public class CheckBox: ButtonBase
- {
-
- #region //// Consts ////////////
-
- ////////////////////////////////////////////////////////////////////////////
- private const string skCheckBox = "CheckBox";
- private const string lrCheckBox = "Control";
- private const string lrChecked = "Checked";
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Fields ////////////
-
- ////////////////////////////////////////////////////////////////////////////
- private bool state = false;
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Properties ////////
-
- ////////////////////////////////////////////////////////////////////////////
- public virtual bool Checked
- {
- get
- {
- return state;
- }
- set
- {
- state = value;
- Invalidate();
- if (!Suspended) OnCheckedChanged(new EventArgs());
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Events ////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public event EventHandler CheckedChanged;
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Construstors //////
-
- ////////////////////////////////////////////////////////////////////////////
- public CheckBox(Manager manager): base(manager)
- {
- CheckLayer(Skin, lrChecked);
-
- Width = 64;
- Height = 16;
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Methods ///////////
-
- ////////////////////////////////////////////////////////////////////////////
- public override void Init()
- {
- base.Init();
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected internal override void InitSkin()
- {
- base.InitSkin();
- Skin = new SkinControl(Manager.Skin.Controls[skCheckBox]);
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
- {
- SkinLayer layer = Skin.Layers[lrChecked];
- SkinText font = Skin.Layers[lrChecked].Text;
-
- if (!state)
- {
- layer = Skin.Layers[lrCheckBox];
- font = Skin.Layers[lrCheckBox].Text;
- }
-
- rect.Width = layer.Width;
- rect.Height = layer.Height;
- Rectangle rc = new Rectangle(rect.Left + rect.Width + 4, rect.Y, Width - (layer.Width + 4), rect.Height);
-
- renderer.DrawLayer(this, layer, rect);
- renderer.DrawString(this, layer, Text, rc, false, 0, 0);
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected override void OnClick(EventArgs e)
- {
- MouseEventArgs ex = (e is MouseEventArgs) ? (MouseEventArgs)e : new MouseEventArgs();
-
- if (ex.Button == MouseButton.Left || ex.Button == MouseButton.None)
- {
- Checked = !Checked;
- }
- base.OnClick(e);
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected virtual void OnCheckedChanged(EventArgs e)
- {
- if (CheckedChanged != null) CheckedChanged.Invoke(this, e);
- }
- ////////////////////////////////////////////////////////////////////////////
-
-
- #endregion
-
- }
-
-}
diff --git a/Neoforce/ClipBox.cs b/Neoforce/ClipBox.cs
deleted file mode 100644
index ca4716c..0000000
--- a/Neoforce/ClipBox.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-////////////////////////////////////////////////////////////////
-// //
-// Neoforce Controls //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// File: ClipBox.cs //
-// //
-// Version: 0.7 //
-// //
-// Date: 11/09/2010 //
-// //
-// Author: Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// Copyright (c) by Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-
-
-
-#region //// Using /////////////
-
-////////////////////////////////////////////////////////////////////////////
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-////////////////////////////////////////////////////////////////////////////
-
-#endregion
-
-namespace TomShane.Neoforce.Controls
-{
-
- public class ClipBox: Control
- {
-
- #region //// Constructors //////
-
- ////////////////////////////////////////////////////////////////////////////
- public ClipBox(Manager manager): base(manager)
- {
- Color = Color.Transparent;
- BackColor = Color.Transparent;
- CanFocus = false;
- Passive = true;
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Methods ///////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
- {
- base.DrawControl(renderer, rect, gameTime);
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- }
-
-}
\ No newline at end of file
diff --git a/Neoforce/ClipControl.cs b/Neoforce/ClipControl.cs
deleted file mode 100644
index 2ad5ffb..0000000
--- a/Neoforce/ClipControl.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-////////////////////////////////////////////////////////////////
-// //
-// Neoforce Controls //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// File: Control.cs //
-// //
-// Version: 0.7 //
-// //
-// Date: 11/09/2010 //
-// //
-// Author: Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// Copyright (c) by Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-
-#region //// Using /////////////
-
-////////////////////////////////////////////////////////////////////////////
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-////////////////////////////////////////////////////////////////////////////
-
-#endregion
-
-namespace TomShane.Neoforce.Controls
-{
-
- public class ClipControl: Control
- {
-
- #region //// Fields ////////////
-
- ////////////////////////////////////////////////////////////////////////////
- private ClipBox clientArea;
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Properties ////////
-
- ////////////////////////////////////////////////////////////////////////////
- public virtual ClipBox ClientArea
- {
- get { return clientArea; }
- set { clientArea = value; }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public override Margins ClientMargins
- {
- get
- {
- return base.ClientMargins;
- }
- set
- {
- base.ClientMargins = value;
- if (clientArea != null)
- {
- clientArea.Left = ClientLeft;
- clientArea.Top = ClientTop;
- clientArea.Width = ClientWidth;
- clientArea.Height = ClientHeight;
- }
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Constructors //////
-
- ////////////////////////////////////////////////////////////////////////////
- public ClipControl(Manager manager): base(manager)
- {
- clientArea = new ClipBox(manager);
-
- clientArea.Init();
- clientArea.MinimumWidth = 0;
- clientArea.MinimumHeight = 0;
- clientArea.Left = ClientLeft;
- clientArea.Top = ClientTop;
- clientArea.Width = ClientWidth;
- clientArea.Height = ClientHeight;
-
- base.Add(clientArea);
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
-
- #region //// Methods ///////////
-
- ////////////////////////////////////////////////////////////////////////////
- public override void Init()
- {
- base.Init();
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected internal override void InitSkin()
- {
- base.InitSkin();
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public virtual void Add(Control control, bool client)
- {
- if (client)
- {
- clientArea.Add(control);
- }
- else
- {
- base.Add(control);
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public override void Add(Control control)
- {
- Add(control, true);
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- public override void Remove(Control control)
- {
- base.Remove(control);
- clientArea.Remove(control);
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected internal override void Update(GameTime gameTime)
- {
- base.Update(gameTime);
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected override void DrawControl(Renderer renderer, Rectangle rect, GameTime gameTime)
- {
- base.DrawControl(renderer, rect, gameTime);
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected override void OnResize(ResizeEventArgs e)
- {
- base.OnResize(e);
-
- if (clientArea != null)
- {
- clientArea.Left = ClientLeft;
- clientArea.Top = ClientTop;
- clientArea.Width = ClientWidth;
- clientArea.Height = ClientHeight;
- }
- }
- ////////////////////////////////////////////////////////////////////////////
-
- ////////////////////////////////////////////////////////////////////////////
- protected virtual void AdjustMargins()
- {
- }
- ////////////////////////////////////////////////////////////////////////////
-
- #endregion
- }
-
-}
diff --git a/Neoforce/ComboBox.cs b/Neoforce/ComboBox.cs
deleted file mode 100644
index a74a2be..0000000
--- a/Neoforce/ComboBox.cs
+++ /dev/null
@@ -1,418 +0,0 @@
-////////////////////////////////////////////////////////////////
-// //
-// Neoforce Controls //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// File: ComboBox.cs //
-// //
-// Version: 0.7 //
-// //
-// Date: 11/09/2010 //
-// //
-// Author: Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-// //
-// Copyright (c) by Tom Shane //
-// //
-////////////////////////////////////////////////////////////////
-
-#region //// Using /////////////
-
-using System.Collections.Generic;
-////////////////////////////////////////////////////////////////////////////
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Input;
-using System;
-using Microsoft.Xna.Framework.Graphics;
-////////////////////////////////////////////////////////////////////////////
-
-#endregion
-
-namespace TomShane.Neoforce.Controls
-{
-
- public class ComboBox: TextBox
- {
-
- #region //// Fields ////////////
-
- ////////////////////////////////////////////////////////////////////////////
- private Button btnDown = null;
- private List