aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Frontend/GUI
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-07-19 16:08:33 -0400
committerMichael <[email protected]>2017-07-19 16:08:33 -0400
commitb8eb7dccfdd16bd1d39bbedeb176fce7f0f1dc9e (patch)
tree4502ced3e939ff3725bc7c1925f1ba88b62653d8 /ShiftOS.Frontend/GUI
parent3fe1872f5f81f8203e57cbba2dca6ce833f08f22 (diff)
downloadshiftos_thereturn-b8eb7dccfdd16bd1d39bbedeb176fce7f0f1dc9e.tar.gz
shiftos_thereturn-b8eb7dccfdd16bd1d39bbedeb176fce7f0f1dc9e.tar.bz2
shiftos_thereturn-b8eb7dccfdd16bd1d39bbedeb176fce7f0f1dc9e.zip
Fix terminal and add support for animations
Diffstat (limited to 'ShiftOS.Frontend/GUI')
-rw-r--r--ShiftOS.Frontend/GUI/Button.cs2
-rw-r--r--ShiftOS.Frontend/GUI/Control.cs9
-rw-r--r--ShiftOS.Frontend/GUI/ItemGroup.cs4
-rw-r--r--ShiftOS.Frontend/GUI/ListBox.cs4
-rw-r--r--ShiftOS.Frontend/GUI/PictureBox.cs7
-rw-r--r--ShiftOS.Frontend/GUI/TextControl.cs3
6 files changed, 15 insertions, 14 deletions
diff --git a/ShiftOS.Frontend/GUI/Button.cs b/ShiftOS.Frontend/GUI/Button.cs
index c2e55b9..62db283 100644
--- a/ShiftOS.Frontend/GUI/Button.cs
+++ b/ShiftOS.Frontend/GUI/Button.cs
@@ -18,7 +18,7 @@ namespace ShiftOS.Frontend.GUI
Text = "Click me!";
}
- protected override void OnLayout()
+ protected override void OnLayout(GameTime gameTime)
{
if(AutoSize == true)
{
diff --git a/ShiftOS.Frontend/GUI/Control.cs b/ShiftOS.Frontend/GUI/Control.cs
index d34a97a..b78f032 100644
--- a/ShiftOS.Frontend/GUI/Control.cs
+++ b/ShiftOS.Frontend/GUI/Control.cs
@@ -429,7 +429,7 @@ namespace ShiftOS.Frontend.GUI
}
}
- public void Layout()
+ public void Layout(GameTime gameTime)
{
//Dock style
if(_parent != null)
@@ -469,12 +469,12 @@ namespace ShiftOS.Frontend.GUI
break;
}
}
- OnLayout();
+ OnLayout(gameTime);
foreach (var child in _children)
- child.Layout();
+ child.Layout(gameTime);
}
- protected virtual void OnLayout()
+ protected virtual void OnLayout(GameTime gameTime)
{
//do nothing
}
@@ -621,7 +621,6 @@ namespace ShiftOS.Frontend.GUI
{
_mouseX = coords.X;
_mouseY = coords.Y;
- Layout();
_wasMouseInControl = true;
int newX = MathHelper.Clamp(state.X, X, X + Width);
int newY = MathHelper.Clamp(state.Y, Y, Y + Height);
diff --git a/ShiftOS.Frontend/GUI/ItemGroup.cs b/ShiftOS.Frontend/GUI/ItemGroup.cs
index e52a17f..13f02c6 100644
--- a/ShiftOS.Frontend/GUI/ItemGroup.cs
+++ b/ShiftOS.Frontend/GUI/ItemGroup.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Xna.Framework;
namespace ShiftOS.Frontend.GUI
{
@@ -12,7 +13,7 @@ namespace ShiftOS.Frontend.GUI
private FlowDirection _flowDir = FlowDirection.LeftToRight;
private int _initialgap = 2;
- protected override void OnLayout()
+ protected override void OnLayout(GameTime gameTime)
{
if (AutoSize)
{
@@ -44,7 +45,6 @@ namespace ShiftOS.Frontend.GUI
ctrl.X = _x;
ctrl.Y = _y;
ctrl.Dock = DockStyle.None;
- ctrl.Layout();
_x += ctrl.Width + _gap;
if (_maxYForRow < ctrl.Height + _gap)
diff --git a/ShiftOS.Frontend/GUI/ListBox.cs b/ShiftOS.Frontend/GUI/ListBox.cs
index 2fe5fc4..0339eff 100644
--- a/ShiftOS.Frontend/GUI/ListBox.cs
+++ b/ShiftOS.Frontend/GUI/ListBox.cs
@@ -168,14 +168,14 @@ namespace ShiftOS.Frontend.GUI
}
}
- protected override void OnLayout()
+ protected override void OnLayout(GameTime gameTime)
{
if(fontheight != LoadedSkin.MainFont.Height)
{
fontheight = LoadedSkin.MainFont.Height;
Invalidate();
}
- base.OnLayout();
+ base.OnLayout(gameTime);
}
public event Action SelectedIndexChanged;
diff --git a/ShiftOS.Frontend/GUI/PictureBox.cs b/ShiftOS.Frontend/GUI/PictureBox.cs
index 6f60b29..db4df7f 100644
--- a/ShiftOS.Frontend/GUI/PictureBox.cs
+++ b/ShiftOS.Frontend/GUI/PictureBox.cs
@@ -9,6 +9,7 @@ using ShiftOS.Engine;
using System.Drawing.Imaging;
using ShiftOS.Frontend.GraphicsSubsystem;
using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework;
namespace ShiftOS.Frontend.GUI
{
@@ -43,7 +44,7 @@ namespace ShiftOS.Frontend.GUI
}
}
- protected override void OnLayout()
+ protected override void OnLayout(GameTime gameTime)
{
if (AutoSize)
{
@@ -109,8 +110,8 @@ namespace ShiftOS.Frontend.GUI
InterpolationMode.HighQualityBicubic;
grPhoto.DrawImage(imgPhoto,
- new Rectangle(destX, destY, destWidth, destHeight),
- new Rectangle(sourceX, sourceY, sourceWidth, sourceHeight),
+ new System.Drawing.Rectangle(destX, destY, destWidth, destHeight),
+ new System.Drawing.Rectangle(sourceX, sourceY, sourceWidth, sourceHeight),
GraphicsUnit.Pixel);
grPhoto.Dispose();
diff --git a/ShiftOS.Frontend/GUI/TextControl.cs b/ShiftOS.Frontend/GUI/TextControl.cs
index f1bbef1..1e23680 100644
--- a/ShiftOS.Frontend/GUI/TextControl.cs
+++ b/ShiftOS.Frontend/GUI/TextControl.cs
@@ -4,6 +4,7 @@ using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Xna.Framework;
using ShiftOS.Frontend.GraphicsSubsystem;
namespace ShiftOS.Frontend.GUI
@@ -14,7 +15,7 @@ namespace ShiftOS.Frontend.GUI
private TextAlign _textAlign = TextAlign.TopLeft;
private Font _font = new Font("Tahoma", 9f);
- protected override void OnLayout()
+ protected override void OnLayout(GameTime gameTime)
{
if (AutoSize)
{