diff --git a/.screenshots/Witcher_WF_CR.png b/.screenshots/Witcher_WF_CR.png index 65d119d..4366001 100644 Binary files a/.screenshots/Witcher_WF_CR.png and b/.screenshots/Witcher_WF_CR.png differ diff --git a/src/Witcher.WF/Notify/Standard/WF.Designer.cs b/src/Witcher.WF/Notify/Standard/WF.Designer.cs index 4f9fe3c..6e285ee 100644 --- a/src/Witcher.WF/Notify/Standard/WF.Designer.cs +++ b/src/Witcher.WF/Notify/Standard/WF.Designer.cs @@ -29,7 +29,6 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WitcherStandardWF)); this.LEFT = new System.Windows.Forms.Panel(); this.CLOSE = new System.Windows.Forms.PictureBox(); this.TEXT = new System.Windows.Forms.Label(); @@ -79,7 +78,7 @@ private void InitializeComponent() this.TEXT.Location = new System.Drawing.Point(26, 0); this.TEXT.Margin = new System.Windows.Forms.Padding(0); this.TEXT.Name = "TEXT"; - this.TEXT.Size = new System.Drawing.Size(374, 60); + this.TEXT.Size = new System.Drawing.Size(374, 58); this.TEXT.TabIndex = 7; this.TEXT.Text = "My Name Is Soferity Witcher WF Sweetheart!"; this.TEXT.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -119,13 +118,14 @@ private void InitializeComponent() this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(38)))), ((int)(((byte)(38))))); this.ClientSize = new System.Drawing.Size(400, 60); this.ControlBox = false; - this.Controls.Add(this.PANEL); this.Controls.Add(this.TEXT); + this.Controls.Add(this.PANEL); this.Controls.Add(this.LEFT); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Icon = global::Witcher.WF.Properties.Resources.ICO; this.MaximizeBox = false; this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(200, 40); this.Name = "WitcherStandardWF"; this.Opacity = 0D; this.ShowInTaskbar = false; diff --git a/src/Witcher.WF/Notify/Standard/WF.cs b/src/Witcher.WF/Notify/Standard/WF.cs index 91b7d1f..87f9b94 100644 --- a/src/Witcher.WF/Notify/Standard/WF.cs +++ b/src/Witcher.WF/Notify/Standard/WF.cs @@ -27,7 +27,7 @@ public partial class WitcherStandardWF : Form private StateType Stage = StateType.Show; private bool Exit = true; - private double Value = 0; + private double Value; public WitcherStandardWF(Structs.Data Data) { @@ -42,6 +42,11 @@ public WitcherStandardWF(Structs.Data Data) TEXT.Text = Local.Text; TEXT.Font = Local.Font; + Width = Local.Size.Width; + Height = Local.Size.Height; + + PANEL.Visible = Local.Close; + if (Local.Theme == ThemeType.Dark || Local.Theme == ThemeType.Light) { if (Local.Theme == ThemeType.Dark) @@ -203,34 +208,37 @@ private void General_Tick(object sender, EventArgs e) case StateType.Close: if (Text == NotifyName + "0") { - if (Local.Location == EdgeLocationType.BotRight || Local.Location == EdgeLocationType.TopRight || Local.Location == EdgeLocationType.RightCenter || Local.Location == EdgeLocationType.FullCenter) + if (Local.Close) { - Value += PANEL.Width / (Local.Time / General.Interval); - - if (PANEL.Width > Convert.ToInt32(Value)) - { - BAR.Location = new(PANEL.Width - Convert.ToInt32(Value), 0); - BAR.Width = Convert.ToInt32(Value); - } - else + if (Local.Location == EdgeLocationType.BotRight || Local.Location == EdgeLocationType.TopRight || Local.Location == EdgeLocationType.RightCenter || Local.Location == EdgeLocationType.FullCenter) { - BAR.Location = new(0, 0); - BAR.Width = PANEL.Width; - CLOSE_Click(sender, e); - } - } - else - { - Value += PANEL.Width / (Local.Time / General.Interval); + Value += PANEL.Width / (Local.Time / General.Interval); - if (PANEL.Width > Convert.ToInt32(Value)) - { - BAR.Width = Convert.ToInt32(Value); + if (PANEL.Width > Convert.ToInt32(Value)) + { + BAR.Location = new(PANEL.Width - Convert.ToInt32(Value), 0); + BAR.Width = Convert.ToInt32(Value); + } + else + { + BAR.Location = new(0, 0); + BAR.Width = PANEL.Width; + CLOSE_Click(sender, e); + } } else { - BAR.Width = PANEL.Width; - CLOSE_Click(sender, e); + Value += PANEL.Width / (Local.Time / General.Interval); + + if (PANEL.Width > Convert.ToInt32(Value)) + { + BAR.Width = Convert.ToInt32(Value); + } + else + { + BAR.Width = PANEL.Width; + CLOSE_Click(sender, e); + } } } } diff --git a/src/Witcher.WF/Notify/Standard/WF.resx b/src/Witcher.WF/Notify/Standard/WF.resx index 2096e64..272a13c 100644 --- a/src/Witcher.WF/Notify/Standard/WF.resx +++ b/src/Witcher.WF/Notify/Standard/WF.resx @@ -117,27 +117,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + True - - + + True - - + + True - - + + True - - - + + 17, 17 - - + + True - - + + True - + \ No newline at end of file diff --git a/src/Witcher.WF/Struct/Structs.cs b/src/Witcher.WF/Struct/Structs.cs index 3c32a0a..887c9ea 100644 --- a/src/Witcher.WF/Struct/Structs.cs +++ b/src/Witcher.WF/Struct/Structs.cs @@ -29,11 +29,23 @@ public struct Data public string Title; public string Text; public Font Font; + public Size Size; public bool Pause; + public bool Close; public bool Top; public int Time; } + /// + /// + /// + [StructLayout(LayoutKind.Sequential)] + public struct Size + { + public int Width; + public int Height; + } + /// /// /// diff --git a/src/Witcher.WF/Witcher.WF.cs b/src/Witcher.WF/Witcher.WF.cs index fd9079b..fe736d4 100644 --- a/src/Witcher.WF/Witcher.WF.cs +++ b/src/Witcher.WF/Witcher.WF.cs @@ -175,6 +175,9 @@ public static void Show(Structs.Data Data) case Enums.NotifyType.Standard: Show(new WitcherStandardWF(Data)); break; + case Enums.NotifyType.Beautiful: + //Show(new WitcherBeautifulWF(Data)); + break; } } else diff --git a/src/Witcher.WF/Witcher.WF.csproj b/src/Witcher.WF/Witcher.WF.csproj index d8e1058..2eb61c0 100644 --- a/src/Witcher.WF/Witcher.WF.csproj +++ b/src/Witcher.WF/Witcher.WF.csproj @@ -91,4 +91,8 @@ Changes are detailed at https://github.com/Soferity/Witcher/releases + + + + \ No newline at end of file diff --git a/src/Witcher.WPF/Notify/Standard/WPF.xaml b/src/Witcher.WPF/Notify/Standard/WPF.xaml index 781c3a6..a76b972 100644 --- a/src/Witcher.WPF/Notify/Standard/WPF.xaml +++ b/src/Witcher.WPF/Notify/Standard/WPF.xaml @@ -6,6 +6,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Height="60" Width="400" + MinHeight="40" MinWidth="200" Title="Witcher Standard WPF" WindowStartupLocation="Manual" ResizeMode="NoResize" WindowStyle="None" @@ -17,7 +18,7 @@ - + diff --git a/src/Witcher.WPF/Notify/Standard/WPF.xaml.cs b/src/Witcher.WPF/Notify/Standard/WPF.xaml.cs index dbe83cd..2c590b4 100644 --- a/src/Witcher.WPF/Notify/Standard/WPF.xaml.cs +++ b/src/Witcher.WPF/Notify/Standard/WPF.xaml.cs @@ -32,7 +32,7 @@ public partial class WitcherStandardWPF : Window private bool Exit = true; private bool Enabled = true; - private double Value = 0; + private double Value; private int Time = 50; public WitcherStandardWPF(Structs.Data Data) @@ -56,6 +56,15 @@ public WitcherStandardWPF(Structs.Data Data) TEXT.FontStyle = Local.Font.Style; TEXT.FontWeight = Local.Font.Weight; + Width = Local.Size.Width; + Height = Local.Size.Height; + + if (!Local.Close) + { + TOP.Height += 2; + PANEL.Visibility = Visibility.Hidden; + } + if (Local.Theme == ThemeType.Dark || Local.Theme == ThemeType.Light) { if (Local.Theme == ThemeType.Dark) @@ -250,16 +259,19 @@ private Task General_Tick() case StateType.Close: if (Title == NotifyName + "0") { - Value += PANEL.ActualWidth / (Local.Time / Time); - - if (PANEL.ActualWidth > Value) + if (Local.Close) { - BAR.Width = Value; - } - else - { - BAR.Width = PANEL.Width; - CLOSE_MouseLeftButtonUp(null, null); + Value += PANEL.ActualWidth / (Local.Time / Time); + + if (PANEL.ActualWidth > Value) + { + BAR.Width = Value; + } + else + { + BAR.Width = PANEL.Width; + CLOSE_MouseLeftButtonUp(null, null); + } } } break; diff --git a/src/Witcher.WPF/Struct/Structs.cs b/src/Witcher.WPF/Struct/Structs.cs index a0fb040..d5767fa 100644 --- a/src/Witcher.WPF/Struct/Structs.cs +++ b/src/Witcher.WPF/Struct/Structs.cs @@ -30,11 +30,23 @@ public struct Data public string Title; public string Text; public Font Font; + public Size Size; public bool Pause; + public bool Close; public bool Top; public int Time; } + /// + /// + /// + [StructLayout(LayoutKind.Sequential)] + public struct Size + { + public double Width; + public double Height; + } + /// /// /// diff --git a/src/Witcher.WPF/Witcher.WPF.csproj b/src/Witcher.WPF/Witcher.WPF.csproj index 8345542..a8d34fd 100644 --- a/src/Witcher.WPF/Witcher.WPF.csproj +++ b/src/Witcher.WPF/Witcher.WPF.csproj @@ -104,4 +104,8 @@ Changes are detailed at https://github.com/Soferity/Witcher/releases + + + + \ No newline at end of file diff --git a/src/Witcher.sln b/src/Witcher.sln index 74a93b6..c63b4c3 100644 --- a/src/Witcher.sln +++ b/src/Witcher.sln @@ -19,6 +19,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WPF", "WPF", "{188D1AD9-1AA EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Witcher_WPF_CR", "Witcher_WPF_CR\Witcher_WPF_CR.csproj", "{06647B67-C720-4DB1-92E9-DE559F4AD0A9}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Catcher", "Catcher", "{E0268EBA-276A-410F-8923-4EDB7FADF1F0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WF", "WF", "{0883B4DC-C35D-43D4-95F1-DAA5E1B31D96}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WPF", "WPF", "{19191630-9A04-4EE4-BE48-D155AAEC3AB1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -51,10 +57,12 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {29781EE5-4D9A-47BE-8C4A-3D79F69B0948} = {1EAD3DCD-AA7E-4645-B949-8D26184F2BA1} - {CE3B27D5-4416-4E0D-82D8-5E5C316AE974} = {F19BB245-AE13-48FE-9A76-A8B11AECCDA1} + {CE3B27D5-4416-4E0D-82D8-5E5C316AE974} = {0883B4DC-C35D-43D4-95F1-DAA5E1B31D96} {2079D7B4-A998-4C78-8674-10E4330A027A} = {188D1AD9-1AAE-43CE-886F-E366C61FBEDE} {A844967C-9F1A-4659-8D39-CCF79310FD09} = {F19BB245-AE13-48FE-9A76-A8B11AECCDA1} - {06647B67-C720-4DB1-92E9-DE559F4AD0A9} = {188D1AD9-1AAE-43CE-886F-E366C61FBEDE} + {06647B67-C720-4DB1-92E9-DE559F4AD0A9} = {19191630-9A04-4EE4-BE48-D155AAEC3AB1} + {0883B4DC-C35D-43D4-95F1-DAA5E1B31D96} = {E0268EBA-276A-410F-8923-4EDB7FADF1F0} + {19191630-9A04-4EE4-BE48-D155AAEC3AB1} = {E0268EBA-276A-410F-8923-4EDB7FADF1F0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {FE10105D-CE85-4315-A7F7-0BF056EFC5B7} diff --git a/src/Witcher_WF_CR/Main.Designer.cs b/src/Witcher_WF_CR/Main.Designer.cs index 08f7a43..41900b1 100644 --- a/src/Witcher_WF_CR/Main.Designer.cs +++ b/src/Witcher_WF_CR/Main.Designer.cs @@ -53,6 +53,9 @@ private void InitializeComponent() this.radioButton3 = new System.Windows.Forms.RadioButton(); this.checkBox1 = new System.Windows.Forms.CheckBox(); this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.checkBox3 = new System.Windows.Forms.CheckBox(); + this.maskedTextBox4 = new System.Windows.Forms.MaskedTextBox(); + this.maskedTextBox5 = new System.Windows.Forms.MaskedTextBox(); this.statusStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -159,7 +162,7 @@ private void InitializeComponent() "Right Center", "Calc Center", "Full Center"}); - this.comboBox1.Location = new System.Drawing.Point(169, 71); + this.comboBox1.Location = new System.Drawing.Point(169, 100); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new System.Drawing.Size(90, 21); this.comboBox1.TabIndex = 7; @@ -187,7 +190,7 @@ private void InitializeComponent() this.comboBox2.Items.AddRange(new object[] { "Standard", "Beautiful"}); - this.comboBox2.Location = new System.Drawing.Point(169, 100); + this.comboBox2.Location = new System.Drawing.Point(169, 129); this.comboBox2.Name = "comboBox2"; this.comboBox2.Size = new System.Drawing.Size(90, 21); this.comboBox2.TabIndex = 9; @@ -214,6 +217,7 @@ private void InitializeComponent() this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(247, 20); this.textBox1.TabIndex = 11; + this.textBox1.TabStop = false; this.textBox1.Text = "My Name Is Soferity Witcher WF Sweetheart!"; this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.textBox1.TextChanged += new System.EventHandler(this.TextBox1_TextChanged); @@ -258,7 +262,7 @@ private void InitializeComponent() // button5 // this.button5.Cursor = System.Windows.Forms.Cursors.Hand; - this.button5.Location = new System.Drawing.Point(101, 99); + this.button5.Location = new System.Drawing.Point(89, 128); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(55, 23); this.button5.TabIndex = 13; @@ -273,6 +277,7 @@ private void InitializeComponent() this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(247, 20); this.textBox2.TabIndex = 14; + this.textBox2.TabStop = false; this.textBox2.Text = "Soferity Witcher WF"; this.textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.textBox2.TextChanged += new System.EventHandler(this.TextBox2_TextChanged); @@ -282,7 +287,7 @@ private void InitializeComponent() this.button6.Cursor = System.Windows.Forms.Cursors.Hand; this.button6.Location = new System.Drawing.Point(12, 128); this.button6.Name = "button6"; - this.button6.Size = new System.Drawing.Size(247, 23); + this.button6.Size = new System.Drawing.Size(75, 23); this.button6.TabIndex = 15; this.button6.TabStop = false; this.button6.Text = "Select Font"; @@ -310,6 +315,7 @@ private void InitializeComponent() this.checkBox1.Name = "checkBox1"; this.checkBox1.Size = new System.Drawing.Size(56, 17); this.checkBox1.TabIndex = 18; + this.checkBox1.TabStop = false; this.checkBox1.Text = "Pause"; this.checkBox1.UseVisualStyleBackColor = true; this.checkBox1.CheckedChanged += new System.EventHandler(this.CheckBox1_CheckedChanged); @@ -323,15 +329,61 @@ private void InitializeComponent() this.checkBox2.Name = "checkBox2"; this.checkBox2.Size = new System.Drawing.Size(68, 17); this.checkBox2.TabIndex = 19; + this.checkBox2.TabStop = false; this.checkBox2.Text = "TopMost"; this.checkBox2.UseVisualStyleBackColor = true; this.checkBox2.CheckedChanged += new System.EventHandler(this.CheckBox2_CheckedChanged); // + // checkBox3 + // + this.checkBox3.AutoSize = true; + this.checkBox3.Checked = true; + this.checkBox3.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBox3.Location = new System.Drawing.Point(96, 102); + this.checkBox3.Name = "checkBox3"; + this.checkBox3.Size = new System.Drawing.Size(52, 17); + this.checkBox3.TabIndex = 20; + this.checkBox3.TabStop = false; + this.checkBox3.Text = "Close"; + this.checkBox3.UseVisualStyleBackColor = true; + this.checkBox3.CheckedChanged += new System.EventHandler(this.CheckBox3_CheckedChanged); + // + // maskedTextBox4 + // + this.maskedTextBox4.BeepOnError = true; + this.maskedTextBox4.Location = new System.Drawing.Point(238, 71); + this.maskedTextBox4.Mask = "00"; + this.maskedTextBox4.Name = "maskedTextBox4"; + this.maskedTextBox4.Size = new System.Drawing.Size(21, 20); + this.maskedTextBox4.TabIndex = 21; + this.maskedTextBox4.TabStop = false; + this.maskedTextBox4.Text = "60"; + this.maskedTextBox4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.maskedTextBox4.ValidatingType = typeof(int); + this.maskedTextBox4.TextChanged += new System.EventHandler(this.MaskedTextBox4_TextChanged); + // + // maskedTextBox5 + // + this.maskedTextBox5.BeepOnError = true; + this.maskedTextBox5.Location = new System.Drawing.Point(184, 71); + this.maskedTextBox5.Mask = "000"; + this.maskedTextBox5.Name = "maskedTextBox5"; + this.maskedTextBox5.Size = new System.Drawing.Size(48, 20); + this.maskedTextBox5.TabIndex = 22; + this.maskedTextBox5.TabStop = false; + this.maskedTextBox5.Text = "400"; + this.maskedTextBox5.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.maskedTextBox5.ValidatingType = typeof(int); + this.maskedTextBox5.TextChanged += new System.EventHandler(this.MaskedTextBox5_TextChanged); + // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.ClientSize = new System.Drawing.Size(271, 237); + this.Controls.Add(this.maskedTextBox5); + this.Controls.Add(this.maskedTextBox4); + this.Controls.Add(this.checkBox3); this.Controls.Add(this.checkBox2); this.Controls.Add(this.checkBox1); this.Controls.Add(this.button4); @@ -391,5 +443,8 @@ private void InitializeComponent() private System.Windows.Forms.RadioButton radioButton3; private System.Windows.Forms.CheckBox checkBox1; private System.Windows.Forms.CheckBox checkBox2; + private System.Windows.Forms.CheckBox checkBox3; + private System.Windows.Forms.MaskedTextBox maskedTextBox4; + private System.Windows.Forms.MaskedTextBox maskedTextBox5; } } \ No newline at end of file diff --git a/src/Witcher_WF_CR/Main.cs b/src/Witcher_WF_CR/Main.cs index 9629fc6..7ee07c7 100644 --- a/src/Witcher_WF_CR/Main.cs +++ b/src/Witcher_WF_CR/Main.cs @@ -26,7 +26,9 @@ public partial class Main : Form Title = "Soferity Witcher WF", Text = "My Name Is Soferity Witcher WF Sweetheart!", Font = new Font("Raleway SemiBold", 12F, FontStyle.Bold, GraphicsUnit.Point, 162), + Size = new() { Width = 400, Height = 60 }, Pause = true, + Close = true, Top = true, Time = 5000 }; @@ -98,6 +100,30 @@ private void MaskedTextBox3_TextChanged(object sender, EventArgs e) } } + private void MaskedTextBox4_TextChanged(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(maskedTextBox4.Text) || string.IsNullOrWhiteSpace(maskedTextBox4.Text)) + { + Data.Size.Height = 60; + } + else + { + Data.Size.Height = Convert.ToInt32(maskedTextBox4.Text); + } + } + + private void MaskedTextBox5_TextChanged(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(maskedTextBox5.Text) || string.IsNullOrWhiteSpace(maskedTextBox5.Text)) + { + Data.Size.Width = 400; + } + else + { + Data.Size.Width = Convert.ToInt32(maskedTextBox5.Text); + } + } + private void Thema_CheckedChanged(object sender, EventArgs e) { RadioButton RB = sender as RadioButton; @@ -183,5 +209,10 @@ private void CheckBox2_CheckedChanged(object sender, EventArgs e) { Data.Top = checkBox2.Checked; } + + private void CheckBox3_CheckedChanged(object sender, EventArgs e) + { + Data.Close = checkBox3.Checked; + } } } \ No newline at end of file diff --git a/src/Witcher_WPF_CR/App.xaml b/src/Witcher_WPF_CR/App.xaml index 60ea8f5..683eae0 100644 --- a/src/Witcher_WPF_CR/App.xaml +++ b/src/Witcher_WPF_CR/App.xaml @@ -2,7 +2,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Witcher_WPF_CR" - StartupUri="MainWindow.xaml"> + StartupUri="Main.xaml"> diff --git a/src/Witcher_WPF_CR/MainWindow.xaml b/src/Witcher_WPF_CR/Main.xaml similarity index 96% rename from src/Witcher_WPF_CR/MainWindow.xaml rename to src/Witcher_WPF_CR/Main.xaml index 7f47d66..d60dd86 100644 --- a/src/Witcher_WPF_CR/MainWindow.xaml +++ b/src/Witcher_WPF_CR/Main.xaml @@ -1,4 +1,4 @@ -