From 5d5f351138b55b27fe92690d824257b6b6e1a469 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 2 Jul 2017 14:09:07 -0400 Subject: [PATCH] Mouse cursor --- ShiftOS.Frontend/GUI/TextControl.cs | 24 ++++ .../Properties/Resources.Designer.cs | 73 +++++++++++ ShiftOS.Frontend/Properties/Resources.resx | 124 ++++++++++++++++++ .../Resources/cursor_9x_pointer.png | Bin 0 -> 219 bytes ShiftOS.Frontend/ShiftOS.Frontend.csproj | 13 +- ShiftOS.Frontend/ShiftOS.cs | 32 ++++- 6 files changed, 263 insertions(+), 3 deletions(-) create mode 100644 ShiftOS.Frontend/Properties/Resources.Designer.cs create mode 100644 ShiftOS.Frontend/Properties/Resources.resx create mode 100644 ShiftOS.Frontend/Resources/cursor_9x_pointer.png diff --git a/ShiftOS.Frontend/GUI/TextControl.cs b/ShiftOS.Frontend/GUI/TextControl.cs index 06d8233..c8eb56b 100644 --- a/ShiftOS.Frontend/GUI/TextControl.cs +++ b/ShiftOS.Frontend/GUI/TextControl.cs @@ -13,6 +13,30 @@ namespace ShiftOS.Frontend.GUI private TextAlign _textAlign = TextAlign.TopLeft; private Font _font = new Font("Tahoma", 9f); + public string Text + { + get { return _text; } + set { _text = value; } + } + + public Font Font + { + get + { + return _font; + } + set + { + _font = value; + } + } + + public TextAlign TextAlign + { + get { return _textAlign; } + set { _textAlign = value; } + } + public override void Paint(Graphics gfx) { var sMeasure = gfx.MeasureString(_text, _font); diff --git a/ShiftOS.Frontend/Properties/Resources.Designer.cs b/ShiftOS.Frontend/Properties/Resources.Designer.cs new file mode 100644 index 0000000..b3bb6d7 --- /dev/null +++ b/ShiftOS.Frontend/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ShiftOS.Frontend.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ShiftOS.Frontend.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap cursor_9x_pointer { + get { + object obj = ResourceManager.GetObject("cursor_9x_pointer", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/ShiftOS.Frontend/Properties/Resources.resx b/ShiftOS.Frontend/Properties/Resources.resx new file mode 100644 index 0000000..9510e93 --- /dev/null +++ b/ShiftOS.Frontend/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\cursor_9x_pointer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/ShiftOS.Frontend/Resources/cursor_9x_pointer.png b/ShiftOS.Frontend/Resources/cursor_9x_pointer.png new file mode 100644 index 0000000000000000000000000000000000000000..ff4815041b541f3575ea7bcb9e6bb7e521fccebe GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^+(0bM!3HGVG{0W}Qfx`y?k)`fL2$v|<&%LToCO|{ z#Xyz9Ak4@xYmNj^kiEpy*OmPNn;18%^@HwxjzFOdPZ!4!jq__K1@awG;Bd~|{5yW< zZ%IxgK|2*gw@d8-rpA+boA0mN7;%Z?!zty4j~5uvbP6Ac-NY0TyOX&>N`v{$o2~=F zoeY00%$SZGRcT><+MqYb&iqVCeU*Oqi%KWnR@P~#yrpp^^^p00i_ I>zopr0Di?txc~qF literal 0 HcmV?d00001 diff --git a/ShiftOS.Frontend/ShiftOS.Frontend.csproj b/ShiftOS.Frontend/ShiftOS.Frontend.csproj index 672024b..48748a9 100644 --- a/ShiftOS.Frontend/ShiftOS.Frontend.csproj +++ b/ShiftOS.Frontend/ShiftOS.Frontend.csproj @@ -46,6 +46,11 @@ + + True + True + Resources.resx + @@ -62,6 +67,10 @@ + + ResXFileCodeGenerator + Resources.Designer.cs + @@ -121,7 +130,9 @@ ShiftOS.Engine - + + +