From b8eb7dccfdd16bd1d39bbedeb176fce7f0f1dc9e Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 19 Jul 2017 16:08:33 -0400 Subject: Fix terminal and add support for animations --- ShiftOS.Frontend/GUI/Button.cs | 2 +- ShiftOS.Frontend/GUI/Control.cs | 9 ++++----- ShiftOS.Frontend/GUI/ItemGroup.cs | 4 ++-- ShiftOS.Frontend/GUI/ListBox.cs | 4 ++-- ShiftOS.Frontend/GUI/PictureBox.cs | 7 ++++--- ShiftOS.Frontend/GUI/TextControl.cs | 3 ++- 6 files changed, 15 insertions(+), 14 deletions(-) (limited to 'ShiftOS.Frontend/GUI') 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) { -- cgit v1.2.3