From bdd8e61600ce849d36e1b4932a01540f2575b738 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 24 Feb 2017 21:16:45 -0500 Subject: Notification frontend. Sorta. --- .../Applications/Notifications.Designer.cs | 62 +++++++++++ ShiftOS.WinForms/Applications/Notifications.cs | 40 +++++++ ShiftOS.WinForms/Applications/Notifications.resx | 120 +++++++++++++++++++++ 3 files changed, 222 insertions(+) create mode 100644 ShiftOS.WinForms/Applications/Notifications.Designer.cs create mode 100644 ShiftOS.WinForms/Applications/Notifications.cs create mode 100644 ShiftOS.WinForms/Applications/Notifications.resx (limited to 'ShiftOS.WinForms/Applications') diff --git a/ShiftOS.WinForms/Applications/Notifications.Designer.cs b/ShiftOS.WinForms/Applications/Notifications.Designer.cs new file mode 100644 index 0000000..f8372de --- /dev/null +++ b/ShiftOS.WinForms/Applications/Notifications.Designer.cs @@ -0,0 +1,62 @@ +namespace ShiftOS.WinForms.Applications +{ + partial class Notifications + { + /// + /// 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.lblnotifications = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // lblnotifications + // + this.lblnotifications.AutoSize = true; + this.lblnotifications.Dock = System.Windows.Forms.DockStyle.Top; + this.lblnotifications.Location = new System.Drawing.Point(0, 0); + this.lblnotifications.Name = "lblnotifications"; + this.lblnotifications.Padding = new System.Windows.Forms.Padding(10); + this.lblnotifications.Size = new System.Drawing.Size(85, 33); + this.lblnotifications.TabIndex = 0; + this.lblnotifications.Tag = "header1"; + this.lblnotifications.Text = "Notifications"; + // + // Notifications + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lblnotifications); + this.Name = "Notifications"; + this.Size = new System.Drawing.Size(437, 520); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label lblnotifications; + } +} diff --git a/ShiftOS.WinForms/Applications/Notifications.cs b/ShiftOS.WinForms/Applications/Notifications.cs new file mode 100644 index 0000000..9e1b36b --- /dev/null +++ b/ShiftOS.WinForms/Applications/Notifications.cs @@ -0,0 +1,40 @@ +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.Engine; + +namespace ShiftOS.WinForms.Applications +{ + [DefaultTitle("Notifications")] + [Launcher("Notifications", true, "al_notifications", "Utilities")] + public partial class Notifications : UserControl, IShiftOSWindow + { + public Notifications() + { + InitializeComponent(); + } + + public void OnLoad() + { + } + + public void OnSkinLoad() + { + } + + public bool OnUnload() + { + return true; + } + + public void OnUpgrade() + { + } + } +} diff --git a/ShiftOS.WinForms/Applications/Notifications.resx b/ShiftOS.WinForms/Applications/Notifications.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.WinForms/Applications/Notifications.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 From 5573e82ca48bb891bbaf6c2f05215dba8e441ce8 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 24 Feb 2017 21:55:23 -0500 Subject: Notification app resets UI when new note is posted --- ShiftOS.WinForms/Applications/Notifications.Designer.cs | 11 +++++++++++ ShiftOS.WinForms/Applications/Notifications.cs | 14 ++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'ShiftOS.WinForms/Applications') diff --git a/ShiftOS.WinForms/Applications/Notifications.Designer.cs b/ShiftOS.WinForms/Applications/Notifications.Designer.cs index f8372de..d9a8388 100644 --- a/ShiftOS.WinForms/Applications/Notifications.Designer.cs +++ b/ShiftOS.WinForms/Applications/Notifications.Designer.cs @@ -29,6 +29,7 @@ private void InitializeComponent() { this.lblnotifications = new System.Windows.Forms.Label(); + this.fllist = new System.Windows.Forms.FlowLayoutPanel(); this.SuspendLayout(); // // lblnotifications @@ -43,10 +44,19 @@ this.lblnotifications.Tag = "header1"; this.lblnotifications.Text = "Notifications"; // + // fllist + // + this.fllist.Dock = System.Windows.Forms.DockStyle.Fill; + this.fllist.Location = new System.Drawing.Point(0, 33); + this.fllist.Name = "fllist"; + this.fllist.Size = new System.Drawing.Size(437, 487); + this.fllist.TabIndex = 1; + // // Notifications // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.fllist); this.Controls.Add(this.lblnotifications); this.Name = "Notifications"; this.Size = new System.Drawing.Size(437, 520); @@ -58,5 +68,6 @@ #endregion private System.Windows.Forms.Label lblnotifications; + private System.Windows.Forms.FlowLayoutPanel fllist; } } diff --git a/ShiftOS.WinForms/Applications/Notifications.cs b/ShiftOS.WinForms/Applications/Notifications.cs index 9e1b36b..aa8ba71 100644 --- a/ShiftOS.WinForms/Applications/Notifications.cs +++ b/ShiftOS.WinForms/Applications/Notifications.cs @@ -18,10 +18,23 @@ namespace ShiftOS.WinForms.Applications public Notifications() { InitializeComponent(); + onMade = (note) => + { + SetupUI(); + }; + } + + Action onMade = null; + + public void SetupUI() + { + } public void OnLoad() { + SetupUI(); + NotificationDaemon.NotificationMade += onMade; } public void OnSkinLoad() @@ -30,6 +43,7 @@ namespace ShiftOS.WinForms.Applications public bool OnUnload() { + NotificationDaemon.NotificationMade -= onMade; return true; } -- cgit v1.2.3