From ba0ae29bbb7eee83c5a4969316d97b43b5f18ba0 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 23 Apr 2017 08:06:00 -0400 Subject: Fix widget stacking --- .../DesktopWidgets/CodepointsWidget.Designer.cs | 61 +++++++++++ .../DesktopWidgets/CodepointsWidget.cs | 53 +++++++++ .../DesktopWidgets/CodepointsWidget.resx | 120 +++++++++++++++++++++ 3 files changed, 234 insertions(+) create mode 100644 ShiftOS.WinForms/DesktopWidgets/CodepointsWidget.Designer.cs create mode 100644 ShiftOS.WinForms/DesktopWidgets/CodepointsWidget.cs create mode 100644 ShiftOS.WinForms/DesktopWidgets/CodepointsWidget.resx (limited to 'ShiftOS.WinForms/DesktopWidgets') diff --git a/ShiftOS.WinForms/DesktopWidgets/CodepointsWidget.Designer.cs b/ShiftOS.WinForms/DesktopWidgets/CodepointsWidget.Designer.cs new file mode 100644 index 0000000..9f3ccc7 --- /dev/null +++ b/ShiftOS.WinForms/DesktopWidgets/CodepointsWidget.Designer.cs @@ -0,0 +1,61 @@ +namespace ShiftOS.WinForms.DesktopWidgets +{ + partial class CodepointsWidget + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.lbcodepoints = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // lbcodepoints + // + this.lbcodepoints.Cursor = System.Windows.Forms.Cursors.Default; + this.lbcodepoints.Dock = System.Windows.Forms.DockStyle.Fill; + this.lbcodepoints.Location = new System.Drawing.Point(0, 0); + this.lbcodepoints.Name = "lbcodepoints"; + this.lbcodepoints.Size = new System.Drawing.Size(274, 57); + this.lbcodepoints.TabIndex = 0; + this.lbcodepoints.Tag = "header3"; + this.lbcodepoints.Text = "label1"; + this.lbcodepoints.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // CodepointsWidget + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lbcodepoints); + this.Name = "CodepointsWidget"; + this.Size = new System.Drawing.Size(274, 57); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label lbcodepoints; + } +} diff --git a/ShiftOS.WinForms/DesktopWidgets/CodepointsWidget.cs b/ShiftOS.WinForms/DesktopWidgets/CodepointsWidget.cs new file mode 100644 index 0000000..fee8b1d --- /dev/null +++ b/ShiftOS.WinForms/DesktopWidgets/CodepointsWidget.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using ShiftOS.WinForms.Tools; +using ShiftOS.Engine; + +namespace ShiftOS.WinForms.DesktopWidgets +{ + [DesktopWidget("Codepoints Display", "Show how many Codepoints you have.")] + public partial class CodepointsWidget : UserControl, IDesktopWidget + { + public CodepointsWidget() + { + InitializeComponent(); + tmr.Tick += (o, a) => + { + try + { + lbcodepoints.Text = SaveSystem.CurrentSave.Codepoints.ToString() + " Codepoints"; + } + catch { } + }; + tmr.Interval = 350; + this.VisibleChanged += (o, a) => + { + if (this.Visible == false) + tmr.Stop(); + }; + } + + Timer tmr = new Timer(); + + public void OnSkinLoad() + { + ControlManager.SetupControls(this); + } + + public void OnUpgrade() + { + } + + public void Setup() + { + tmr.Start(); + } + } +} diff --git a/ShiftOS.WinForms/DesktopWidgets/CodepointsWidget.resx b/ShiftOS.WinForms/DesktopWidgets/CodepointsWidget.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.WinForms/DesktopWidgets/CodepointsWidget.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file -- cgit v1.2.3