diff --git a/.gitignore b/.gitignore index fb85c11..30a047b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,6 @@ /.vs /bin /obj -/packages -/Installer/Debug -/Installer/Release -/FizzyLauncher.UI/bin -/FizzyLauncher.UI/obj +*.user +*.pubxml.user +*.csproj.user diff --git a/Properties/Resources.Designer.cs b/AppResource.Designer.cs similarity index 86% rename from Properties/Resources.Designer.cs rename to AppResource.Designer.cs index 90bd94d..4512104 100644 --- a/Properties/Resources.Designer.cs +++ b/AppResource.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace AppLauncher.Properties { +namespace FizzyLauncher { using System; @@ -22,14 +22,14 @@ namespace AppLauncher.Properties { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { + internal class AppResource { 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() { + internal AppResource() { } /// @@ -39,7 +39,7 @@ namespace AppLauncher.Properties { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AppLauncher.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FizzyLauncher.AppResource", typeof(AppResource).Assembly); resourceMan = temp; } return resourceMan; @@ -60,16 +60,6 @@ namespace AppLauncher.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap app_icon { - get { - object obj = ResourceManager.GetObject("app_icon", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/Properties/Resources.resx b/AppResource.resx similarity index 86% rename from Properties/Resources.resx rename to AppResource.resx index dda20bf..f5bec56 100644 --- a/Properties/Resources.resx +++ b/AppResource.resx @@ -112,22 +112,19 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\app_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + - ..\Resources\folder_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\folder_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\toggle-left-ea-16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\toggle-left-ea-16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\toggle-right-ea-16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\toggle-right-ea-16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/FizzyLauncher.UI/FizzyLauncher.UI.csproj b/FizzyLauncher.UI/FizzyLauncher.UI.csproj deleted file mode 100644 index ddfdb4a..0000000 --- a/FizzyLauncher.UI/FizzyLauncher.UI.csproj +++ /dev/null @@ -1,272 +0,0 @@ - - - - - Debug - AnyCPU - {D9A49347-583F-41B4-AFE1-63EC80BBDB38} - Library - Properties - AppLauncher - fizzylauncher.ui - v4.7.2 - 512 - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - false - - - - - - - - - - - - - - - - - True - True - Resources16.resx - - - True - True - Resources.resx - - - - Form - - - UserControl - - - Component - - - UserControl - - - THorizontalSeparator.cs - - - - Component - - - UserControl - - - TButton.cs - - - UserControl - - - TButtonTextBox.cs - - - Form - - - TDialogForm.cs - - - UserControl - - - UserControl - - - TListBox.cs - - - UserControl - - - UserControl - - - TPickerBox.cs - - - UserControl - - - TTextBox.cs - - - UserControl - - - TUserControl.cs - - - UserControl - - - - - ResXFileCodeGenerator - Resources16.Designer.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - - - TForm.cs - - - TButton.cs - - - TButtonTextBox.cs - - - TDialogForm.cs - - - TListBox.cs - - - TPickerBox.cs - - - TTextBox.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/FizzyLauncher.UI/FizzyLauncher.UI.csproj.user b/FizzyLauncher.UI/FizzyLauncher.UI.csproj.user deleted file mode 100644 index c10e84b..0000000 --- a/FizzyLauncher.UI/FizzyLauncher.UI.csproj.user +++ /dev/null @@ -1,6 +0,0 @@ - - - - ProjectFiles - - \ No newline at end of file diff --git a/FizzyLauncher.UI/Properties/AssemblyInfo.cs b/FizzyLauncher.UI/Properties/AssemblyInfo.cs deleted file mode 100644 index 0ec23d9..0000000 --- a/FizzyLauncher.UI/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("FizzyLauncher.UI")] -[assembly: AssemblyDescription("UI")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("FizzyLauncher.UI")] -[assembly: AssemblyCopyright("Copyright © Ray Lam 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d9a49347-583f-41b4-afe1-63ec80bbdb38")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/FizzyLauncher.UI/Properties/Resources.Designer.cs b/FizzyLauncher.UI/Properties/Resources.Designer.cs deleted file mode 100644 index 64c08bd..0000000 --- a/FizzyLauncher.UI/Properties/Resources.Designer.cs +++ /dev/null @@ -1,263 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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 AppLauncher.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", "16.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("AppLauncher.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 titlebar_blank { - get { - object obj = ResourceManager.GetObject("titlebar_blank", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_blank2 { - get { - object obj = ResourceManager.GetObject("titlebar_blank2", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_blank3 { - get { - object obj = ResourceManager.GetObject("titlebar_blank3", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_blank4 { - get { - object obj = ResourceManager.GetObject("titlebar_blank4", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_blank5 { - get { - object obj = ResourceManager.GetObject("titlebar_blank5", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_close { - get { - object obj = ResourceManager.GetObject("titlebar_close", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_close2 { - get { - object obj = ResourceManager.GetObject("titlebar_close2", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_close3 { - get { - object obj = ResourceManager.GetObject("titlebar_close3", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_close4 { - get { - object obj = ResourceManager.GetObject("titlebar_close4", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_close5 { - get { - object obj = ResourceManager.GetObject("titlebar_close5", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_maximise { - get { - object obj = ResourceManager.GetObject("titlebar_maximise", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_maximise2 { - get { - object obj = ResourceManager.GetObject("titlebar_maximise2", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_maximise3 { - get { - object obj = ResourceManager.GetObject("titlebar_maximise3", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_maximise4 { - get { - object obj = ResourceManager.GetObject("titlebar_maximise4", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_maximise5 { - get { - object obj = ResourceManager.GetObject("titlebar_maximise5", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_minimise { - get { - object obj = ResourceManager.GetObject("titlebar_minimise", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_minimise2 { - get { - object obj = ResourceManager.GetObject("titlebar_minimise2", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_minimise3 { - get { - object obj = ResourceManager.GetObject("titlebar_minimise3", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_minimise4 { - get { - object obj = ResourceManager.GetObject("titlebar_minimise4", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap titlebar_minimise5 { - get { - object obj = ResourceManager.GetObject("titlebar_minimise5", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/FizzyLauncher.UI/Properties/Resources.resx b/FizzyLauncher.UI/Properties/Resources.resx deleted file mode 100644 index 5f47cda..0000000 --- a/FizzyLauncher.UI/Properties/Resources.resx +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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\titlebar_blank.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_blank2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_blank3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_blank4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_blank5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_close2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_close3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_close4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_close5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_maximise.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_maximise2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_maximise3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_maximise4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_maximise5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_minimise.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_minimise2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_minimise3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_minimise4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\titlebar_minimise5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/FizzyLauncher.UI/Resources/titlebar_blank.png b/FizzyLauncher.UI/Resources/titlebar_blank.png deleted file mode 100644 index 1f31a99..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_blank.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_blank2.png b/FizzyLauncher.UI/Resources/titlebar_blank2.png deleted file mode 100644 index a04ab4d..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_blank2.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_blank3.png b/FizzyLauncher.UI/Resources/titlebar_blank3.png deleted file mode 100644 index 7f2bae3..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_blank3.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_blank4.png b/FizzyLauncher.UI/Resources/titlebar_blank4.png deleted file mode 100644 index af1f600..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_blank4.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_blank5.png b/FizzyLauncher.UI/Resources/titlebar_blank5.png deleted file mode 100644 index 32fc5d2..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_blank5.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_close.png b/FizzyLauncher.UI/Resources/titlebar_close.png deleted file mode 100644 index 2ee4079..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_close.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_close2.png b/FizzyLauncher.UI/Resources/titlebar_close2.png deleted file mode 100644 index f497ea7..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_close2.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_close3.png b/FizzyLauncher.UI/Resources/titlebar_close3.png deleted file mode 100644 index 9813d70..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_close3.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_close4.png b/FizzyLauncher.UI/Resources/titlebar_close4.png deleted file mode 100644 index ee5d5dd..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_close4.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_close5.png b/FizzyLauncher.UI/Resources/titlebar_close5.png deleted file mode 100644 index dc57050..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_close5.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_maximise.png b/FizzyLauncher.UI/Resources/titlebar_maximise.png deleted file mode 100644 index b17fa34..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_maximise.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_maximise2.png b/FizzyLauncher.UI/Resources/titlebar_maximise2.png deleted file mode 100644 index 6f98201..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_maximise2.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_maximise3.png b/FizzyLauncher.UI/Resources/titlebar_maximise3.png deleted file mode 100644 index c9b0e18..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_maximise3.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_maximise4.png b/FizzyLauncher.UI/Resources/titlebar_maximise4.png deleted file mode 100644 index 613d94d..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_maximise4.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_maximise5.png b/FizzyLauncher.UI/Resources/titlebar_maximise5.png deleted file mode 100644 index f655957..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_maximise5.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_minimise.png b/FizzyLauncher.UI/Resources/titlebar_minimise.png deleted file mode 100644 index 19c19ae..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_minimise.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_minimise2.png b/FizzyLauncher.UI/Resources/titlebar_minimise2.png deleted file mode 100644 index 2f6a976..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_minimise2.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_minimise3.png b/FizzyLauncher.UI/Resources/titlebar_minimise3.png deleted file mode 100644 index 78fe59e..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_minimise3.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_minimise4.png b/FizzyLauncher.UI/Resources/titlebar_minimise4.png deleted file mode 100644 index fb55d84..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_minimise4.png and /dev/null differ diff --git a/FizzyLauncher.UI/Resources/titlebar_minimise5.png b/FizzyLauncher.UI/Resources/titlebar_minimise5.png deleted file mode 100644 index 0513690..0000000 Binary files a/FizzyLauncher.UI/Resources/titlebar_minimise5.png and /dev/null differ diff --git a/FizzyLauncher.UI/RyzStudio/Windows/Forms/TForm.cs b/FizzyLauncher.UI/RyzStudio/Windows/Forms/TForm.cs deleted file mode 100644 index 48a2803..0000000 --- a/FizzyLauncher.UI/RyzStudio/Windows/Forms/TForm.cs +++ /dev/null @@ -1,433 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -using Resources = AppLauncher.Properties.Resources; - -namespace RyzStudio.Windows.Forms -{ - public class TForm : Form - { - protected readonly Color borderColour = Color.FromArgb(200, 200, 200); - protected readonly int borderWidth = 1; - - protected readonly int resizeBorderWidth = 4; - - protected readonly Color backColour = Color.FromArgb(250, 250, 250); - - protected readonly Color titleBackColour = Color.FromArgb(235, 234, 233); - protected readonly Color titleBorderColour = Color.FromArgb(200, 198, 196); - protected readonly Color titleColour = Color.FromArgb(102, 102, 102); - protected readonly int titleBarHeight = 33; - protected readonly bool showTitleBarLine = true; - protected Font titleFont = null; - protected int titleFontTop = 0; - - protected readonly Size titleBarIconSize = new Size(48, 32); - protected readonly int titleBarIconMargin = 0; - protected readonly int titleBarIconMarginRight = 0; - - protected Image appIcon = null; - protected const int appIconLeft = 12; - protected const int appIconRight = 6; - protected int appIconTop = 0; - - protected bool isDragging = false; - protected Point startPosition = new Point(); - protected Point startWindowSize = new Point(); - - protected bool enableMinimise { get; set; } = true; - protected bool enableMaximise { get; set; } = true; - protected bool enableClose { get; set; } = true; - protected bool closeOnMinimise { get; set; } = false; - - protected bool isBusy = false; - - private IContainer components; - - public TForm() : base() - { - InitializeComponent(); - - if (!this.DesignMode) - { - this.FormBorderStyle = FormBorderStyle.None; - this.StartPosition = FormStartPosition.Manual; - } - - this.AutoScaleMode = AutoScaleMode.None; - this.BackColor = backColour; - this.Padding = new Padding(0); - this.DoubleBuffered = true; - - this.MouseDown += new MouseEventHandler(form_MouseDown); - this.MouseMove += new MouseEventHandler(form_MouseMove); - this.MouseUp += new MouseEventHandler(form_MouseUp); - this.PreviewKeyDown += new PreviewKeyDownEventHandler(form_PreviewKeyDown); - } - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - this.Text = Application.ProductName; - - initialiseLoadComponent(); - - if (appIcon != null) appIconTop = (int)Math.Floor((decimal)(titleBarHeight - appIcon.Height) / 2) + borderWidth; - titleFont = new Font(this.Font.FontFamily, 10F); - titleFontTop = (int)Math.Floor((decimal)(titleBarHeight - TextRenderer.MeasureText("#", titleFont).Height) / 2) + borderWidth; - - } - - protected override void OnMouseClick(MouseEventArgs e) - { - base.OnMouseClick(e); - - bool isLabel = ((e.Location.X >= 0) && (e.Location.X <= this.Width) && (e.Location.Y >= 0) && (e.Location.Y <= titleBarHeight)); - - if (e.Button == MouseButtons.Left) - { - if (isLabel) - { - // do nothing - } - else - { - // do nothing - } - } - else if (e.Button == MouseButtons.Right) - { - if (isLabel) - { - if (this.TitleContextMenuStrip != null) - { - this.TitleContextMenuStrip.Show(this, e.Location); - } - } - else - { - // do nothing - } - } - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - Graphics g = e.Graphics; - Rectangle area = new Rectangle(this.DisplayRectangle.X, this.DisplayRectangle.Y, (this.DisplayRectangle.Width - borderWidth), (this.DisplayRectangle.Height - borderWidth)); - - // border - g.DrawRectangle(new Pen(borderColour, borderWidth), area); - - area.Inflate((-1 * borderWidth), (-1 * borderWidth)); - - g.FillRectangle(new SolidBrush(titleBackColour), area.X, area.Y, (area.Width + area.X), titleBarHeight); - - if (showTitleBarLine) g.DrawLine(new Pen(titleBorderColour, 1), area.X, titleBarHeight, (area.Width + area.X), titleBarHeight); - - if (!DesignMode) - { - if (appIcon != null) g.DrawImageUnscaled(appIcon, appIconLeft, appIconTop); - - int iconPosX = borderWidth + appIconLeft + appIconRight + ((appIcon == null) ? 0 : appIcon.Width); - TextRenderer.DrawText(g, this.Text, titleFont, new Point(iconPosX, titleFontTop), titleColour); - } - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - - this.Invalidate(); - } - - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] - public override Color BackColor { get => base.BackColor; set => base.BackColor = backColour; } - - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] - public new FormBorderStyle FormBorderStyle { get => base.FormBorderStyle; set => base.FormBorderStyle = value; } - - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] - public new Padding Padding { get => base.Padding; set => base.Padding = value; } - - [Category("Appearance")] - public ContextMenuStrip TitleContextMenuStrip { get; set; } = null; - - //[Browsable(false)] - //public Image AppIcon { get; set; } = null; - - //[Browsable(false)] - //public bool IsMaximiseEnabled { get; set; } = false; - - //protected Point DefaultLocation - //{ - // get - // { - // Point newPosition = new Point(Cursor.Position.X, Cursor.Position.Y); - // newPosition.X -= (this.Width / 2); - // newPosition.Y -= (this.Height / 2); - - // newPosition.X = Math.Max(newPosition.X, Screen.PrimaryScreen.WorkingArea.Left); - // newPosition.Y = Math.Max(newPosition.Y, Screen.PrimaryScreen.WorkingArea.Top); - - // return newPosition; - // } - //} - - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TForm)); - this.SuspendLayout(); - // - // AForm - // - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.Name = "AForm"; - this.ResumeLayout(false); - } - - private void form_MouseDown(object sender, MouseEventArgs e) - { - if (e.Button == MouseButtons.Left) - { - isDragging = true; - startPosition = e.Location; - startWindowSize = new Point(this.Width, this.Height); - } - } - - private void form_MouseMove(object sender, MouseEventArgs e) - { - if (isDragging) - { - int x = (this.Location.X + (e.Location.X - startPosition.X)); - int y = (this.Location.Y + (e.Location.Y - startPosition.Y)); - - //this.Location = validateFormLocation(x, y); - this.Location = new Point(x, y); - } - } - - private void form_MouseUp(object sender, MouseEventArgs e) - { - isDragging = false; - } - - private void form_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) - { - if (e.KeyCode == Keys.Escape) - { - Application.Exit(); - } - } - - protected virtual void initialiseLoadComponent() - { - if (DesignMode) return; - - // close - TImageBox closeBox = generateToolbarImageBox(); - closeBox.Image = closeBox.ImageNormal = (enableClose) ? Resources.titlebar_close : Resources.titlebar_blank; - closeBox.ImageHover = (enableClose) ? Resources.titlebar_close3 : Resources.titlebar_blank; - closeBox.ImageSelected = Resources.titlebar_close3; - closeBox.MouseClick += delegate (object sender, MouseEventArgs e) - { - if (e.Button == MouseButtons.Left) - { - if (enableClose) - { - this.Close(); - } - } - }; - closeBox.Left = this.DisplayRectangle.Width - closeBox.Width - (titleBarIconMarginRight + borderWidth); - - this.Controls.Add(closeBox); - - // maximise - TImageBox maximiseBox = generateToolbarImageBox(); - maximiseBox.Image = maximiseBox.ImageNormal = (enableMaximise) ? Resources.titlebar_maximise : Resources.titlebar_blank; - maximiseBox.ImageHover = (enableMaximise) ? Resources.titlebar_maximise5 : Resources.titlebar_blank; - maximiseBox.ImageSelected = Resources.titlebar_maximise3; - maximiseBox.MouseClick += delegate (object sender, MouseEventArgs e) - { - if (!(sender is TImageBox)) return; - - TImageBox imageBox2 = (sender as TImageBox); - - if (imageBox2 == null) return; - - if (e.Button == MouseButtons.Left) - { - if (enableMaximise) - { - if (this.WindowState == FormWindowState.Maximized) - { - this.WindowState = FormWindowState.Normal; - imageBox2.Image = imageBox2.ImageNormal = Resources.titlebar_maximise; - } - else - { - this.WindowState = FormWindowState.Maximized; - imageBox2.Image = imageBox2.ImageNormal = Resources.titlebar_maximise5; - } - } - } - else if (e.Button == MouseButtons.Right) - { - this.TopMost = !this.TopMost; - - if (this.TopMost) - { - imageBox2.Image = imageBox2.ImageNormal = Resources.titlebar_maximise3; - imageBox2.ImageHover = (enableMaximise) ? Resources.titlebar_maximise5 : Resources.titlebar_maximise3; - } - else - { - imageBox2.Image = imageBox2.ImageNormal = (enableMaximise) ? Resources.titlebar_maximise : Resources.titlebar_blank; - imageBox2.ImageHover = (enableMaximise) ? Resources.titlebar_maximise5 : Resources.titlebar_blank; - } - } - }; - maximiseBox.Left = closeBox.Left - maximiseBox.Width - titleBarIconMargin; - - this.Controls.Add(maximiseBox); - - // minimise - TImageBox minimiseBox = generateToolbarImageBox(); - minimiseBox.Image = minimiseBox.ImageNormal = (enableMinimise) ? Resources.titlebar_minimise : Resources.titlebar_blank; - minimiseBox.ImageHover = (enableMinimise) ? Resources.titlebar_minimise5 : Resources.titlebar_blank; - //minimiseBox.ImageSelected = null; - minimiseBox.MouseClick += delegate (object sender, MouseEventArgs e) - { - if (!enableMinimise) return; - if (e.Button != MouseButtons.Left) return; - - if (closeOnMinimise) - { - this.Close(); - } - else - { - this.WindowState = FormWindowState.Minimized; - } - }; - minimiseBox.Left = maximiseBox.Left - minimiseBox.Width - titleBarIconMargin; - - this.Controls.Add(minimiseBox); - - // resize - UserControl uc1 = new UserControl() - { - Anchor = (AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right), - Height = resizeBorderWidth, - Width = this.DisplayRectangle.Width - resizeBorderWidth, - Left = 0, - Top = this.DisplayRectangle.Height - resizeBorderWidth, - BackColor = Color.Transparent, - Cursor = Cursors.SizeNS - }; - uc1.MouseDown += form_MouseDown; - uc1.MouseUp += form_MouseUp; - uc1.MouseMove += delegate (object sender, MouseEventArgs e) - { - if (isDragging) - { - this.Size = new Size(startWindowSize.X, e.Y - startPosition.Y + this.Height); - } - }; - uc1.BringToFront(); - - this.Controls.Add(uc1); - - UserControl uc2 = new UserControl() - { - Anchor = (AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom), - Height = this.DisplayRectangle.Height - resizeBorderWidth, - Width = resizeBorderWidth, - Left = this.DisplayRectangle.Width - resizeBorderWidth, - Top = 0, - BackColor = Color.Transparent, - Cursor = Cursors.SizeWE - }; - uc2.MouseDown += form_MouseDown; - uc2.MouseUp += form_MouseUp; - uc2.MouseMove += delegate (object sender, MouseEventArgs e) - { - if (isDragging) - { - this.Size = new Size(e.X - startPosition.X + this.Width, startWindowSize.Y); - } - }; - uc2.BringToFront(); - - this.Controls.Add(uc2); - - UserControl uc3 = new UserControl() - { - Anchor = (AnchorStyles.Bottom | AnchorStyles.Right), - Height = resizeBorderWidth, - Width = resizeBorderWidth, - Left = this.DisplayRectangle.Width - resizeBorderWidth, - Top = this.DisplayRectangle.Height - resizeBorderWidth, - BackColor = Color.Transparent, - Cursor = Cursors.SizeNWSE - }; - uc3.MouseDown += form_MouseDown; - uc3.MouseUp += form_MouseUp; - uc3.MouseMove += delegate (object sender, MouseEventArgs e) - { - if (isDragging) - { - this.Size = new Size((e.X - startPosition.X + this.Width), (e.Y - startPosition.Y + this.Height)); - } - }; - uc3.BringToFront(); - - this.Controls.Add(uc3); - } - - protected TImageBox generateToolbarImageBox() - { - TImageBox imageBox = new TImageBox(); - //imageBox.BackColor = Color.Transparent; - imageBox.BackColorHover = imageBox.BackColorSelected = Color.FromArgb(220, 220, 220); - imageBox.BackgroundImageLayout = ImageLayout.Center; - imageBox.ErrorImage = null; - //imageBox.Image = Resources.close; - //imageBox.ImageHover = Resources.close2; - //imageBox.ImageNormal = Resources.close; - imageBox.ImageSelected = null; - imageBox.IsSelected = false; - //closeBox.Location = new System.Drawing.Point(169, 12); - imageBox.Size = titleBarIconSize; - imageBox.SizeMode = PictureBoxSizeMode.CenterImage; - //imageBox.MouseClick += new MouseEventHandler(closeBox_MouseClick); - //imageBox.Left = this.DisplayRectangle.Width - imageBox.Width - 17; - imageBox.Top = (int)Math.Floor((decimal) (titleBarHeight - titleBarIconSize.Height) / 2) + borderWidth; - imageBox.Anchor = (AnchorStyles.Top | AnchorStyles.Right); - imageBox.Padding = new Padding(0); - - return imageBox; - } - - //private void exitToolStripMenuItem_Click(object sender, EventArgs e) => this.Close(); - - //private void notifyIcon1_MouseClick(object sender, MouseEventArgs e) - //{ - // if (e.Button == MouseButtons.Left) - // { - // this.Visible = !this.Visible; - // } - - // //notifyIcon1.Visible = !this.Visible; - //} - - - } -} \ No newline at end of file diff --git a/FizzyLauncher.UI/RyzStudio/Windows/Forms/THorizontalSeparator.cs b/FizzyLauncher.UI/RyzStudio/Windows/Forms/THorizontalSeparator.cs deleted file mode 100644 index 3311e09..0000000 --- a/FizzyLauncher.UI/RyzStudio/Windows/Forms/THorizontalSeparator.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Drawing; -using System.Windows.Forms; - -namespace RyzStudio.Windows.Forms -{ - public partial class THorizontalSeparator : System.Windows.Forms.UserControl - { - public THorizontalSeparator() - { - InitializeComponent(); - - this.MaximumSize = new Size(SystemInformation.VirtualScreen.Width, 2); - } - - protected override void OnPaintBackground(PaintEventArgs e) - { - base.OnPaintBackground(e); - - Graphics g = e.Graphics; - - g.FillRectangle(new SolidBrush(Color.FromArgb(213, 223, 229)), new Rectangle(this.DisplayRectangle.Left, 0, this.DisplayRectangle.Width, 1)); - g.FillRectangle(new SolidBrush(Color.FromArgb(249, 251, 253)), new Rectangle(this.DisplayRectangle.Left, 1, this.DisplayRectangle.Width, 1)); - } - - } -} diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TDialogForm.Designer.cs b/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TDialogForm.Designer.cs deleted file mode 100644 index 5ee7579..0000000 --- a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TDialogForm.Designer.cs +++ /dev/null @@ -1,96 +0,0 @@ -namespace RyzStudio.Windows.ThemedForms -{ - partial class TDialogForm - { - /// - /// 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 Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.panel1 = new System.Windows.Forms.Panel(); - this.imgbxClose = new RyzStudio.Windows.Forms.TImageBox(); - this.area1 = new System.Windows.Forms.Panel(); - ((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit(); - this.SuspendLayout(); - // - // panel1 - // - this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.panel1.BackColor = System.Drawing.Color.Transparent; - this.panel1.Cursor = System.Windows.Forms.Cursors.SizeNWSE; - this.panel1.Location = new System.Drawing.Point(335, 595); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(5, 5); - this.panel1.TabIndex = 150; - // - // imgbxClose - // - this.imgbxClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.imgbxClose.BackColor = System.Drawing.Color.Transparent; - this.imgbxClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.imgbxClose.ErrorImage = null; - this.imgbxClose.ImageHover = global::AppLauncher.Properties.Resources16.close2; - this.imgbxClose.Image = null; - this.imgbxClose.InitialImage = null; - this.imgbxClose.Location = new System.Drawing.Point(308, 4); - this.imgbxClose.Name = "imgbxClose"; - this.imgbxClose.ImageNormal = global::AppLauncher.Properties.Resources16.close; - this.imgbxClose.Size = new System.Drawing.Size(24, 24); - this.imgbxClose.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.imgbxClose.TabIndex = 145; - this.imgbxClose.TabStop = false; - // - // area1 - // - this.area1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.area1.BackColor = System.Drawing.Color.Transparent; - this.area1.Cursor = System.Windows.Forms.Cursors.SizeNS; - this.area1.Location = new System.Drawing.Point(0, 595); - this.area1.Name = "area1"; - this.area1.Size = new System.Drawing.Size(334, 5); - this.area1.TabIndex = 151; - // - // TDialogForm - // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(249)))), ((int)(((byte)(250))))); - this.ClientSize = new System.Drawing.Size(340, 600); - this.Controls.Add(this.area1); - this.Controls.Add(this.panel1); - this.Controls.Add(this.imgbxClose); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.MinimumSize = new System.Drawing.Size(40, 0); - this.Name = "TDialogForm"; - ((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - protected internal Forms.TImageBox imgbxClose; - protected internal System.Windows.Forms.Panel panel1; - protected internal System.Windows.Forms.Panel area1; - } -} \ No newline at end of file diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TDialogForm.cs b/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TDialogForm.cs deleted file mode 100644 index d85c999..0000000 --- a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TDialogForm.cs +++ /dev/null @@ -1,136 +0,0 @@ -namespace RyzStudio.Windows.ThemedForms -{ - using System; - using System.ComponentModel; - using System.Drawing; - using System.Windows.Forms; - - public partial class TDialogForm : System.Windows.Forms.Form - { - protected readonly Color borderColour = Color.FromArgb(77, 84, 100); - protected readonly int borderWidth = 1; - - protected readonly Color backColour = Color.FromArgb(254, 254, 254); - - protected readonly Color titleBarColour = Color.FromArgb(152, 175, 206); - protected readonly Color titleBarForeColour = Color.White; - protected readonly Font titleBarFont = new Font("Segoe UI", 8.25F, FontStyle.Bold, GraphicsUnit.Point, 0); - protected readonly int titleBarHeight = 32; - - private bool isDragging = false; - private Point startPosition = new Point(); - - protected bool isBusy = false; - - public TDialogForm() : base() - { - this.InitializeComponent(); - - this.FormBorderStyle = FormBorderStyle.None; - this.ShowInTaskbar = false; - this.TopMost = true; - - imgbxClose.Click += pictureBox3_Click; - - this.BackColor = backColour; - this.Padding = new Padding(0); - } - - protected override void OnClosing(CancelEventArgs e) - { - base.OnClosing(e); - - if (this.IsBusy) - { - e.Cancel = true; - } - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - - if (e.Button == MouseButtons.Left) - { - isDragging = true; - startPosition = e.Location; - } - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - - if (isDragging) - { - int x = (this.Location.X + (e.Location.X - startPosition.X)); - int y = (this.Location.Y + (e.Location.Y - startPosition.Y)); - - this.Location = new Point(x, y); - } - } - - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - - isDragging = false; - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - Graphics g = e.Graphics; - Rectangle area = new Rectangle(this.DisplayRectangle.X, this.DisplayRectangle.Y, (this.DisplayRectangle.Width - borderWidth), (this.DisplayRectangle.Height - borderWidth)); - - // border - g.DrawRectangle(new Pen(borderColour, borderWidth), area); - g.DrawLine(new Pen(borderColour, 1), this.DisplayRectangle.X, (titleBarHeight + 1), this.DisplayRectangle.Width, (titleBarHeight + 1)); - - area.Inflate((-1 * borderWidth), (-1 * borderWidth)); - - g.FillRectangle(new SolidBrush(titleBarColour), area.X, area.Y, (area.Width + area.X), titleBarHeight); - - TextRenderer.DrawText(g, this.Title, titleBarFont, new Point(12, 11), titleBarForeColour); - - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - - this.Invalidate(); - } - - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] - public override Color BackColor { get => base.BackColor; set => base.BackColor = value; } - - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] - public new FormBorderStyle FormBorderStyle { get => base.FormBorderStyle; set => base.FormBorderStyle = value; } - - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] - public new Padding Padding { get => base.Padding; set => base.Padding = value; } - - [Category("Appearance"), Browsable(true)] - public string Title { get; set; } - - protected virtual bool IsBusy { get => isBusy; set => isBusy = value; } - - private void pictureBox3_Click(object sender, System.EventArgs e) - { - MouseEventArgs mouseEvent = (MouseEventArgs)e; - if (mouseEvent != null) - { - if (mouseEvent.Button != MouseButtons.Left) - { - return; - } - } - - this.Close(); - } - - - } -} \ No newline at end of file diff --git a/FizzyLauncher.csproj b/FizzyLauncher.csproj index 39bc8d3..511af66 100644 --- a/FizzyLauncher.csproj +++ b/FizzyLauncher.csproj @@ -1,171 +1,91 @@ - - - + + - Debug - AnyCPU - {66C1C75C-3612-4D23-B937-C3DE0D653292} WinExe - AppLauncher - fizzylauncher - v4.8 - 512 - false - true - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - none - true - bin\Release\ - TRACE - prompt - 4 - false - - + net5.0-windows + true true - - favicon.ico + false + fizzylauncher + Ray Lam + Hi, I'm Ray + Fizzy Launcher + Ray Lam + 0.2.1.055 + 0.2.1.055 + 0.2.1.055 + + + bin\Debug\ + + + + none + false + + - - packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - - - - - - - - - - - + + + + + + + + + + + + + - - - - Form - - - MainForm.cs - - - - - - True + + + + + + + + + + + + + + + + + + True - Resources.resx - - - Form - - - Form - - - Form - - - Form - - - Form - - - Form - - - UserControl - - - TTilePanelLayout.cs - - - UserControl - - - TTilePanel.cs - - - MainForm.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - - - AddTileForm.cs - - - EditGroupForm.cs - - - AddListTileForm.cs - - - EditListTileForm.cs - - - OptionsForm.cs - - - EditTileForm.cs - - - TTilePanelLayout.cs - - - TTilePanel.cs - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - True - Settings.settings - True + AppResource.resx + + + UserControl + + + True + True + UIResource.resx + - + + ResXFileCodeGenerator + AppResource.Designer.cs + + + TFolderTextBox.resx + + + ResXFileCodeGenerator + UIResource.Designer.cs + - - - - - - - - - - - - - - {d9a49347-583f-41b4-afe1-63ec80bbdb38} - FizzyLauncher.UI - - - - + \ No newline at end of file diff --git a/FizzyLauncher.csproj.user b/FizzyLauncher.csproj.user deleted file mode 100644 index 6cbe588..0000000 --- a/FizzyLauncher.csproj.user +++ /dev/null @@ -1,6 +0,0 @@ - - - - ProjectFiles - - \ No newline at end of file diff --git a/FizzyLauncher.sln b/FizzyLauncher.sln new file mode 100644 index 0000000..aafd02f --- /dev/null +++ b/FizzyLauncher.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31410.357 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FizzyLauncher", "FizzyLauncher.csproj", "{4833FB27-0817-4720-A54B-180369B0C374}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4833FB27-0817-4720-A54B-180369B0C374}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4833FB27-0817-4720-A54B-180369B0C374}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4833FB27-0817-4720-A54B-180369B0C374}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4833FB27-0817-4720-A54B-180369B0C374}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {CB4C1DB0-19FE-4AA0-9621-D66FAC4CF7C5} + EndGlobalSection +EndGlobal diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index b088587..92961d9 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -1,4 +1,4 @@ -namespace AppLauncher +namespace FizzyLauncher { partial class MainForm { @@ -30,198 +30,39 @@ { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); - this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem10 = new System.Windows.Forms.ToolStripSeparator(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem12 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem11 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem9 = new System.Windows.Forms.ToolStripMenuItem(); - this.optionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.viewHelpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components); this.exitToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem13 = new System.Windows.Forms.ToolStripSeparator(); + this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem14 = new System.Windows.Forms.ToolStripSeparator(); + this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem15 = new System.Windows.Forms.ToolStripSeparator(); + this.exitToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.showBigIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.enableAnimationsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.alwaysOnTopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.viewHelpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem16 = new System.Windows.Forms.ToolStripSeparator(); + this.aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.panel1 = new System.Windows.Forms.Panel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); - this.contextMenuStrip1.SuspendLayout(); this.contextMenuStrip2.SuspendLayout(); + this.menuStrip1.SuspendLayout(); this.panel1.SuspendLayout(); this.SuspendLayout(); // - // contextMenuStrip1 - // - this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripMenuItem4, - this.toolStripMenuItem3, - this.toolStripMenuItem9, - this.helpToolStripMenuItem}); - this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(102, 92); - this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening); - // - // toolStripMenuItem4 - // - this.toolStripMenuItem4.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripMenuItem5, - this.toolStripMenuItem7, - this.toolStripSeparator2, - this.toolStripMenuItem8, - this.toolStripSeparator3, - this.toolStripMenuItem6, - this.toolStripMenuItem2, - this.toolStripMenuItem10, - this.exitToolStripMenuItem}); - this.toolStripMenuItem4.Name = "toolStripMenuItem4"; - this.toolStripMenuItem4.Size = new System.Drawing.Size(101, 22); - this.toolStripMenuItem4.Text = "&File"; - // - // toolStripMenuItem5 - // - this.toolStripMenuItem5.Name = "toolStripMenuItem5"; - this.toolStripMenuItem5.Size = new System.Drawing.Size(123, 22); - this.toolStripMenuItem5.Text = "&New"; - this.toolStripMenuItem5.Click += new System.EventHandler(this.toolStripMenuItem5_Click); - // - // toolStripMenuItem7 - // - this.toolStripMenuItem7.Name = "toolStripMenuItem7"; - this.toolStripMenuItem7.Size = new System.Drawing.Size(123, 22); - this.toolStripMenuItem7.Text = "&Open"; - this.toolStripMenuItem7.Click += new System.EventHandler(this.toolStripMenuItem7_Click); - // - // toolStripSeparator2 - // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(120, 6); - // - // toolStripMenuItem8 - // - this.toolStripMenuItem8.Name = "toolStripMenuItem8"; - this.toolStripMenuItem8.Size = new System.Drawing.Size(123, 22); - this.toolStripMenuItem8.Text = "&Close"; - this.toolStripMenuItem8.Click += new System.EventHandler(this.toolStripMenuItem8_Click); - // - // toolStripSeparator3 - // - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(120, 6); - // - // toolStripMenuItem6 - // - this.toolStripMenuItem6.Name = "toolStripMenuItem6"; - this.toolStripMenuItem6.Size = new System.Drawing.Size(123, 22); - this.toolStripMenuItem6.Text = "&Save"; - this.toolStripMenuItem6.Click += new System.EventHandler(this.toolStripMenuItem6_Click); - // - // toolStripMenuItem2 - // - this.toolStripMenuItem2.Name = "toolStripMenuItem2"; - this.toolStripMenuItem2.Size = new System.Drawing.Size(123, 22); - this.toolStripMenuItem2.Text = "Save &As..."; - this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click); - // - // toolStripMenuItem10 - // - this.toolStripMenuItem10.Name = "toolStripMenuItem10"; - this.toolStripMenuItem10.Size = new System.Drawing.Size(120, 6); - // - // exitToolStripMenuItem - // - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(123, 22); - this.exitToolStripMenuItem.Text = "E&xit"; - this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); - // - // toolStripMenuItem3 - // - this.toolStripMenuItem3.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripMenuItem12, - this.toolStripMenuItem11, - this.toolStripMenuItem1}); - this.toolStripMenuItem3.Name = "toolStripMenuItem3"; - this.toolStripMenuItem3.Size = new System.Drawing.Size(101, 22); - this.toolStripMenuItem3.Text = "&View"; - // - // toolStripMenuItem12 - // - this.toolStripMenuItem12.Name = "toolStripMenuItem12"; - this.toolStripMenuItem12.Size = new System.Drawing.Size(222, 22); - this.toolStripMenuItem12.Text = "Enable &Big Icons (In Folders)"; - this.toolStripMenuItem12.Click += new System.EventHandler(this.toolStripMenuItem12_Click); - // - // toolStripMenuItem11 - // - this.toolStripMenuItem11.Name = "toolStripMenuItem11"; - this.toolStripMenuItem11.Size = new System.Drawing.Size(222, 22); - this.toolStripMenuItem11.Text = "Enable &Animation"; - this.toolStripMenuItem11.Click += new System.EventHandler(this.toolStripMenuItem11_Click); - // - // toolStripMenuItem1 - // - this.toolStripMenuItem1.Name = "toolStripMenuItem1"; - this.toolStripMenuItem1.Size = new System.Drawing.Size(222, 22); - this.toolStripMenuItem1.Text = "Always On &Top"; - this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click); - // - // toolStripMenuItem9 - // - this.toolStripMenuItem9.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.optionToolStripMenuItem}); - this.toolStripMenuItem9.Name = "toolStripMenuItem9"; - this.toolStripMenuItem9.Size = new System.Drawing.Size(101, 22); - this.toolStripMenuItem9.Text = "&Tools"; - // - // optionToolStripMenuItem - // - this.optionToolStripMenuItem.Name = "optionToolStripMenuItem"; - this.optionToolStripMenuItem.Size = new System.Drawing.Size(116, 22); - this.optionToolStripMenuItem.Text = "&Options"; - this.optionToolStripMenuItem.Click += new System.EventHandler(this.optionToolStripMenuItem_Click); - // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.viewHelpToolStripMenuItem, - this.toolStripSeparator1, - this.aboutToolStripMenuItem}); - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(101, 22); - this.helpToolStripMenuItem.Text = "&Help"; - // - // viewHelpToolStripMenuItem - // - this.viewHelpToolStripMenuItem.Name = "viewHelpToolStripMenuItem"; - this.viewHelpToolStripMenuItem.Size = new System.Drawing.Size(127, 22); - this.viewHelpToolStripMenuItem.Text = "&View Help"; - this.viewHelpToolStripMenuItem.Click += new System.EventHandler(this.viewHelpToolStripMenuItem_Click); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(124, 6); - // - // aboutToolStripMenuItem - // - this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(127, 22); - this.aboutToolStripMenuItem.Text = "&About"; - this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); - // // saveFileDialog1 // this.saveFileDialog1.Filter = "Session files|*.jsonfig"; @@ -254,19 +95,185 @@ this.exitToolStripMenuItem1.Text = "E&xit"; this.exitToolStripMenuItem1.Click += new System.EventHandler(this.exitToolStripMenuItem1_Click); // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.viewToolStripMenuItem, + this.toolsToolStripMenuItem, + this.helpToolStripMenuItem1}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(633, 24); + this.menuStrip1.TabIndex = 2; + this.menuStrip1.MenuActivate += new System.EventHandler(this.menuStrip1_MenuActivate); + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newToolStripMenuItem, + this.openToolStripMenuItem, + this.toolStripMenuItem13, + this.closeToolStripMenuItem, + this.toolStripMenuItem14, + this.saveToolStripMenuItem, + this.saveAsToolStripMenuItem, + this.toolStripMenuItem15, + this.exitToolStripMenuItem2}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "&File"; + // + // newToolStripMenuItem + // + this.newToolStripMenuItem.Image = global::FizzyLauncher.UIResource.file2; + this.newToolStripMenuItem.Name = "newToolStripMenuItem"; + this.newToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.newToolStripMenuItem.Text = "&New"; + this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); + // + // openToolStripMenuItem + // + this.openToolStripMenuItem.Image = global::FizzyLauncher.UIResource.folder2; + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.openToolStripMenuItem.Text = "&Open"; + this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + // + // toolStripMenuItem13 + // + this.toolStripMenuItem13.Name = "toolStripMenuItem13"; + this.toolStripMenuItem13.Size = new System.Drawing.Size(177, 6); + // + // closeToolStripMenuItem + // + this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; + this.closeToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.closeToolStripMenuItem.Text = "&Close"; + this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); + // + // toolStripMenuItem14 + // + this.toolStripMenuItem14.Name = "toolStripMenuItem14"; + this.toolStripMenuItem14.Size = new System.Drawing.Size(177, 6); + // + // saveToolStripMenuItem + // + this.saveToolStripMenuItem.Image = global::FizzyLauncher.UIResource.disk2; + this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; + this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.saveToolStripMenuItem.Text = "&Save"; + this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); + // + // saveAsToolStripMenuItem + // + this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.saveAsToolStripMenuItem.Text = "Save &As..."; + this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); + // + // toolStripMenuItem15 + // + this.toolStripMenuItem15.Name = "toolStripMenuItem15"; + this.toolStripMenuItem15.Size = new System.Drawing.Size(177, 6); + // + // exitToolStripMenuItem2 + // + this.exitToolStripMenuItem2.Name = "exitToolStripMenuItem2"; + this.exitToolStripMenuItem2.Size = new System.Drawing.Size(180, 22); + this.exitToolStripMenuItem2.Text = "E&xit"; + this.exitToolStripMenuItem2.Click += new System.EventHandler(this.exitToolStripMenuItem2_Click); + // + // viewToolStripMenuItem + // + this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.showBigIconsToolStripMenuItem, + this.enableAnimationsToolStripMenuItem, + this.alwaysOnTopToolStripMenuItem}); + this.viewToolStripMenuItem.Name = "viewToolStripMenuItem"; + this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20); + this.viewToolStripMenuItem.Text = "&View"; + // + // showBigIconsToolStripMenuItem + // + this.showBigIconsToolStripMenuItem.Name = "showBigIconsToolStripMenuItem"; + this.showBigIconsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.showBigIconsToolStripMenuItem.Text = "Show &Big Icons"; + this.showBigIconsToolStripMenuItem.Click += new System.EventHandler(this.showBigIconsToolStripMenuItem_Click); + // + // enableAnimationsToolStripMenuItem + // + this.enableAnimationsToolStripMenuItem.Name = "enableAnimationsToolStripMenuItem"; + this.enableAnimationsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.enableAnimationsToolStripMenuItem.Text = "Enable &Animations"; + this.enableAnimationsToolStripMenuItem.Click += new System.EventHandler(this.enableAnimationsToolStripMenuItem_Click); + // + // alwaysOnTopToolStripMenuItem + // + this.alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem"; + this.alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.alwaysOnTopToolStripMenuItem.Text = "Always On &Top"; + this.alwaysOnTopToolStripMenuItem.Click += new System.EventHandler(this.alwaysOnTopToolStripMenuItem_Click); + // + // toolsToolStripMenuItem + // + this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.optionsToolStripMenuItem}); + this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; + this.toolsToolStripMenuItem.Size = new System.Drawing.Size(46, 20); + this.toolsToolStripMenuItem.Text = "&Tools"; + // + // optionsToolStripMenuItem + // + this.optionsToolStripMenuItem.Image = global::FizzyLauncher.UIResource.cog2; + this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + this.optionsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.optionsToolStripMenuItem.Text = "&Options"; + this.optionsToolStripMenuItem.Click += new System.EventHandler(this.optionsToolStripMenuItem_Click); + // + // helpToolStripMenuItem1 + // + this.helpToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.viewHelpToolStripMenuItem1, + this.toolStripMenuItem16, + this.aboutToolStripMenuItem1}); + this.helpToolStripMenuItem1.Name = "helpToolStripMenuItem1"; + this.helpToolStripMenuItem1.Size = new System.Drawing.Size(44, 20); + this.helpToolStripMenuItem1.Text = "&Help"; + // + // viewHelpToolStripMenuItem1 + // + this.viewHelpToolStripMenuItem1.Image = global::FizzyLauncher.UIResource.help2; + this.viewHelpToolStripMenuItem1.Name = "viewHelpToolStripMenuItem1"; + this.viewHelpToolStripMenuItem1.Size = new System.Drawing.Size(180, 22); + this.viewHelpToolStripMenuItem1.Text = "&View Help"; + this.viewHelpToolStripMenuItem1.Click += new System.EventHandler(this.viewHelpToolStripMenuItem1_Click); + // + // toolStripMenuItem16 + // + this.toolStripMenuItem16.Name = "toolStripMenuItem16"; + this.toolStripMenuItem16.Size = new System.Drawing.Size(177, 6); + // + // aboutToolStripMenuItem1 + // + this.aboutToolStripMenuItem1.Name = "aboutToolStripMenuItem1"; + this.aboutToolStripMenuItem1.Size = new System.Drawing.Size(180, 22); + this.aboutToolStripMenuItem1.Text = "&About"; + this.aboutToolStripMenuItem1.Click += new System.EventHandler(this.aboutToolStripMenuItem1_Click); + // // panel1 // - this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); this.panel1.AutoScroll = true; this.panel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.panel1.BackColor = System.Drawing.Color.Transparent; this.panel1.Controls.Add(this.flowLayoutPanel1); - this.panel1.Location = new System.Drawing.Point(12, 34); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(0, 24); + this.panel1.Margin = new System.Windows.Forms.Padding(0); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(620, 363); - this.panel1.TabIndex = 0; + this.panel1.Padding = new System.Windows.Forms.Padding(10, 10, 10, 20); + this.panel1.Size = new System.Drawing.Size(633, 376); + this.panel1.TabIndex = 3; // // flowLayoutPanel1 // @@ -274,63 +281,71 @@ this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.flowLayoutPanel1.BackColor = System.Drawing.Color.Transparent; this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; - this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.flowLayoutPanel1.Location = new System.Drawing.Point(10, 10); + this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 20); - this.flowLayoutPanel1.Size = new System.Drawing.Size(0, 30); + this.flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(0, 0, 0, 20); + this.flowLayoutPanel1.Size = new System.Drawing.Size(0, 20); this.flowLayoutPanel1.TabIndex = 29; this.flowLayoutPanel1.WrapContents = false; // // MainForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(250)))), ((int)(((byte)(250))))); this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.ClientSize = new System.Drawing.Size(633, 400); this.Controls.Add(this.panel1); + this.Controls.Add(this.menuStrip1); + this.DoubleBuffered = true; + this.ForeColor = System.Drawing.SystemColors.ControlText; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MainMenuStrip = this.menuStrip1; + this.MaximizeBox = false; + this.MinimizeBox = false; this.MinimumSize = new System.Drawing.Size(420, 280); this.Name = "MainForm"; - this.Text = "Launcher"; - this.TitleContextMenuStrip = this.contextMenuStrip1; - this.contextMenuStrip1.ResumeLayout(false); + this.Text = "Fizzy Launcher"; this.contextMenuStrip2.ResumeLayout(false); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; - private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3; - private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; - private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem4; - private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; private System.Windows.Forms.SaveFileDialog saveFileDialog1; - private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5; - private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem6; - private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem7; private System.Windows.Forms.OpenFileDialog openFileDialog1; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; - private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem8; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; - private System.Windows.Forms.ToolStripSeparator toolStripMenuItem10; - private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem9; - private System.Windows.Forms.ToolStripMenuItem optionToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem viewHelpToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.NotifyIcon notifyIcon1; private System.Windows.Forms.ContextMenuStrip contextMenuStrip2; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem1; - private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem11; - private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem12; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem1; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem13; + private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem14; + private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem15; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem showBigIconsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem enableAnimationsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem alwaysOnTopToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem viewHelpToolStripMenuItem1; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem16; + private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem1; } } diff --git a/MainForm.cs b/MainForm.cs index 7b76ac4..cd9b259 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -1,6 +1,6 @@ -using AppLauncher.Models; -using AppLauncher.Windows.Forms; -using Newtonsoft.Json; +using FizzyLauncher.Models; +using FizzyLauncher.Text.Json; +using FizzyLauncher.Windows.Forms; using RyzStudio.Windows.Forms; using System; using System.Collections.Generic; @@ -8,12 +8,13 @@ using System.ComponentModel; using System.Drawing; using System.IO; using System.Runtime.InteropServices; +using System.Text.Json; using System.Threading.Tasks; using System.Windows.Forms; -namespace AppLauncher +namespace FizzyLauncher { - public partial class MainForm : TForm + public partial class MainForm : Form { [DllImport("user32.dll")] protected static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vk); @@ -30,8 +31,10 @@ namespace AppLauncher protected OptionsForm optionsForm = null; protected string sessionFilename = null; + protected bool isBusy = false; protected bool requestExit = false; + public MainForm() : base() { InitializeComponent(); @@ -39,25 +42,23 @@ namespace AppLauncher notifyIcon1.Text = Application.ProductName; this.StartPosition = FormStartPosition.WindowsDefaultBounds; - - appIcon = Properties.Resources.app_icon; - - enableMaximise = false; - //enableMaximiseMenu = false; - closeOnMinimise = true; + this.Visible = false; } protected override void OnLoad(EventArgs e) { - ThreadControl.SetVisible(this, false); - base.OnLoad(e); + + ThreadControl.SetVisible(this, false); + ThreadControl.SetSize(this, this.MinimumSize); } protected async override void OnShown(EventArgs e) { base.OnShown(e); + ThreadControl.SetVisible(this, false); + string jsonfigFilename = Path.ChangeExtension(Application.ExecutablePath, "jsonfig"); if (File.Exists(jsonfigFilename)) { @@ -66,7 +67,7 @@ namespace AppLauncher else { this.CurrentSession = new LauncherSession(); - ThreadControl.SetSize(this, this.MinimumSize); + ThreadControl.SetVisible(this, true); } } @@ -152,138 +153,9 @@ namespace AppLauncher base.WndProc(ref m); } + public LauncherSession CurrentSession { get; set; } = null; - private void toolStripMenuItem5_Click(object sender, EventArgs e) - { - if (string.IsNullOrWhiteSpace(sessionFilename)) - { - newSession(); - } - else - { - DialogResult dr = MessageBox.Show("Save existing session?", "New session", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); - if (dr == DialogResult.Yes) - { - bool rv = saveFile(sessionFilename, false); - if (rv) - { - newSession(); - - sessionFilename = null; - } - } - else if (dr == DialogResult.No) - { - newSession(); - - sessionFilename = null; - } - else if (dr == DialogResult.Cancel) - { - return; - } - } - } - - private async void toolStripMenuItem7_Click(object sender, EventArgs e) - { - if (string.IsNullOrWhiteSpace(sessionFilename)) - { - if (openFileDialog1.ShowDialog() == DialogResult.OK) - { - await loadFile(openFileDialog1.FileName); - } - } - else - { - DialogResult dr = MessageBox.Show("Save existing session?", "Open session", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); - if (dr == DialogResult.Yes) - { - bool rv = saveFile(sessionFilename, false); - if (rv) - { - if (openFileDialog1.ShowDialog() == DialogResult.OK) - { - await loadFile(openFileDialog1.FileName); - } - } - } - else if (dr == DialogResult.No) - { - if (openFileDialog1.ShowDialog() == DialogResult.OK) - { - await loadFile(openFileDialog1.FileName); - } - } - else if (dr == DialogResult.Cancel) - { - return; - } - } - } - - private void toolStripMenuItem8_Click(object sender, EventArgs e) - { - if (string.IsNullOrWhiteSpace(sessionFilename)) - { - flowLayoutPanel1.Controls.Clear(); - } - else - { - DialogResult dr = MessageBox.Show("Save existing session?", "Close session", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); - if (dr == DialogResult.Yes) - { - bool rv = saveFile(sessionFilename, false); - if (rv) - { - flowLayoutPanel1.Controls.Clear(); - - sessionFilename = null; - } - } - else if (dr == DialogResult.No) - { - flowLayoutPanel1.Controls.Clear(); - - sessionFilename = null; - } - else if (dr == DialogResult.Cancel) - { - return; - } - } - } - - private void toolStripMenuItem6_Click(object sender, EventArgs e) - { - if (string.IsNullOrWhiteSpace(sessionFilename)) - { - saveAsFile(); - } - else - { - saveFile(sessionFilename, true); - } - } - - private void toolStripMenuItem2_Click(object sender, EventArgs e) => saveAsFile(); - - private void toolStripMenuItem1_Click(object sender, EventArgs e) => this.TopMost = !this.TopMost; - - private void exitToolStripMenuItem_Click(object sender, EventArgs e) - { - requestExit = true; - this.Close(); - } - - private void optionToolStripMenuItem_Click(object sender, EventArgs e) - { - if (optionsForm == null) optionsForm = new OptionsForm(this); - optionsForm.ShowDialog(); - - invalidateHotKey(); - } protected async Task collapseWindow(int width, int increment = 6) { @@ -348,6 +220,20 @@ namespace AppLauncher } } + + protected void newSession() + { + flowLayoutPanel1.Controls.Clear(); + flowLayoutPanel1.Controls.Add(new TilePanelLayout(new TileGroupModel() + { + Title = "New Group", + IsExpanded = true, + GridSize = new Size(6, 1) + })); + + InvalidateWidth(6); + } + protected async Task loadFile(string filename) { await Task.Run(() => @@ -387,48 +273,54 @@ namespace AppLauncher } // load options - this.CurrentSession = JsonConvert.DeserializeObject(sourceCode); + var options = new JsonSerializerOptions(); + options.Converters.Add(new JsonPointConverter()); + options.Converters.Add(new JsonSizeConverter()); + + try + { + this.CurrentSession = JsonSerializer.Deserialize(sourceCode, options); + } + catch (Exception exc) + { + MessageBox.Show("Unable to read session", "Load session"); + return; + } + if (this.CurrentSession == null) { this.CurrentSession = new LauncherSession(); } // load tiles - int maxWidth = 0; + int maxTileWidth = 0; ThreadControl.Clear(flowLayoutPanel1); if (this.CurrentSession.Groups != null) { foreach (TileGroupModel item in this.CurrentSession.Groups) { - TTilePanelLayout panel = new TTilePanelLayout(item); + maxTileWidth = Math.Max(maxTileWidth, item.GridSize.Width); - maxWidth = Math.Max(maxWidth, panel.Width); + TilePanelLayout panel = new TilePanelLayout(item); ThreadControl.Add(flowLayoutPanel1, panel); } } - // ui - ThreadControl.SetSize(this, (maxWidth + SystemInformation.VerticalScrollBarWidth + 20 + flowLayoutPanel1.Left), this.CurrentSession.DefaultHeight); + // resize + InvalidateSize(maxTileWidth); + + // reposition if (!this.CurrentSession.StartPosition.IsEmpty) ThreadControl.SetLocation(this, this.CurrentSession.StartPosition); // ThreadControl.SetTopMost(this, this.CurrentSession.AlwaysOnTop); ThreadControl.SetVisible(this, true); - ThreadControl.SetChecked(toolStripMenuItem11, this.CurrentSession.EnableAnimation); - ThreadControl.SetChecked(toolStripMenuItem12, this.CurrentSession.EnableBigIconInFolder); + ThreadControl.SetChecked(enableAnimationsToolStripMenuItem, this.CurrentSession.EnableAnimation); + ThreadControl.SetChecked(showBigIconsToolStripMenuItem, this.CurrentSession.EnableBigIconInFolder); - if (this.InvokeRequired) - { - this.Invoke(new MethodInvoker(() => { - this.Focus(); - })); - } - else - { - this.Focus(); - } + ThreadControl.SetFocus(this); // hotkey invalidateHotKey(); @@ -436,25 +328,6 @@ namespace AppLauncher }); } - protected void newSession() - { - int maxWidth = 0; - flowLayoutPanel1.Controls.Clear(); - - TTilePanelLayout panel = new TTilePanelLayout(new TileGroupModel() - { - Title = "New Group", - IsExpanded = true, - GridSize = new Size(8, 1) - }); - - maxWidth = Math.Max(maxWidth, panel.Width); - - flowLayoutPanel1.Controls.Add(panel); - - this.Width = maxWidth + SystemInformation.VerticalScrollBarWidth + 20 + flowLayoutPanel1.Left; - } - protected bool saveFile(string filename, bool showNotices = true) { if (isBusy) @@ -488,18 +361,22 @@ namespace AppLauncher this.CurrentSession.Groups = new List(); for (int i = 0; i < flowLayoutPanel1.Controls.Count; i++) { - if (flowLayoutPanel1.Controls[i].GetType() != typeof(TTilePanelLayout)) + if (flowLayoutPanel1.Controls[i].GetType() != typeof(TilePanelLayout)) { continue; } - TTilePanelLayout container = flowLayoutPanel1.Controls[i] as TTilePanelLayout; + TilePanelLayout container = flowLayoutPanel1.Controls[i] as TilePanelLayout; this.CurrentSession.Groups.Add(container.Model); } + var options = new JsonSerializerOptions(); + options.Converters.Add(new JsonPointConverter()); + options.Converters.Add(new JsonSizeConverter()); + try { - File.WriteAllText(filename, JsonConvert.SerializeObject(this.CurrentSession)); + File.WriteAllText(filename, JsonSerializer.Serialize(this.CurrentSession, options)); if (showNotices) { @@ -539,13 +416,196 @@ namespace AppLauncher return false; } - private void contextMenuStrip1_Opening(object sender, System.ComponentModel.CancelEventArgs e) + + protected void InvalidateSize(int columnWidth) { - toolStripMenuItem1.Checked = this.TopMost; - toolStripMenuItem6.Enabled = !string.IsNullOrWhiteSpace(sessionFilename); + int newWidth = TilePanelLayout.CalcWidth(columnWidth); + newWidth += SystemInformation.VerticalScrollBarWidth; + newWidth += flowLayoutPanel1.Padding.Horizontal + flowLayoutPanel1.Margin.Horizontal; + newWidth += panel1.Left + panel1.Padding.Horizontal + panel1.Margin.Horizontal; + newWidth += this.Padding.Horizontal; + + ThreadControl.ClientSize(this, newWidth, this.CurrentSession.DefaultHeight); } - private void viewHelpToolStripMenuItem_Click(object sender, EventArgs e) + protected void InvalidateWidth(int columnWidth) + { + int newWidth = TilePanelLayout.CalcWidth(columnWidth); + newWidth += SystemInformation.VerticalScrollBarWidth; + newWidth += panel1.Left + panel1.Padding.Horizontal + this.Padding.Horizontal + flowLayoutPanel1.Padding.Horizontal + flowLayoutPanel1.Left; + + ThreadControl.SetClientWidth(this, newWidth); + } + + + #region main menu + + private void newToolStripMenuItem_Click(object sender, EventArgs e) + { + if (string.IsNullOrWhiteSpace(sessionFilename)) + { + newSession(); + } + else + { + DialogResult dr = MessageBox.Show("Save existing session?", "New session", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (dr == DialogResult.Yes) + { + bool rv = saveFile(sessionFilename, false); + if (rv) + { + newSession(); + + sessionFilename = null; + } + } + else if (dr == DialogResult.No) + { + newSession(); + + sessionFilename = null; + } + else if (dr == DialogResult.Cancel) + { + return; + } + } + } + + private async void openToolStripMenuItem_Click(object sender, EventArgs e) + { + if (string.IsNullOrWhiteSpace(sessionFilename)) + { + if (openFileDialog1.ShowDialog() == DialogResult.OK) + { + await loadFile(openFileDialog1.FileName); + } + } + else + { + DialogResult dr = MessageBox.Show("Save existing session?", "Open session", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (dr == DialogResult.Yes) + { + bool rv = saveFile(sessionFilename, false); + if (rv) + { + if (openFileDialog1.ShowDialog() == DialogResult.OK) + { + await loadFile(openFileDialog1.FileName); + } + } + } + else if (dr == DialogResult.No) + { + if (openFileDialog1.ShowDialog() == DialogResult.OK) + { + await loadFile(openFileDialog1.FileName); + } + } + else if (dr == DialogResult.Cancel) + { + return; + } + } + } + + private void closeToolStripMenuItem_Click(object sender, EventArgs e) + { + if (string.IsNullOrWhiteSpace(sessionFilename)) + { + flowLayoutPanel1.Controls.Clear(); + } + else + { + DialogResult dr = MessageBox.Show("Save existing session?", "Close session", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (dr == DialogResult.Yes) + { + bool rv = saveFile(sessionFilename, false); + if (rv) + { + flowLayoutPanel1.Controls.Clear(); + + sessionFilename = null; + } + } + else if (dr == DialogResult.No) + { + flowLayoutPanel1.Controls.Clear(); + + sessionFilename = null; + } + else if (dr == DialogResult.Cancel) + { + return; + } + } + } + + private void saveToolStripMenuItem_Click(object sender, EventArgs e) + { + if (string.IsNullOrWhiteSpace(sessionFilename)) + { + saveAsFile(); + } + else + { + saveFile(sessionFilename, true); + } + } + + private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) + { + saveAsFile(); + } + + private void exitToolStripMenuItem2_Click(object sender, EventArgs e) + { + requestExit = true; + + this.Close(); + } + + + private void showBigIconsToolStripMenuItem_Click(object sender, EventArgs e) + { + if (this.CurrentSession == null) + { + return; + } + + this.CurrentSession.EnableBigIconInFolder = !this.CurrentSession.EnableBigIconInFolder; + + showBigIconsToolStripMenuItem.Checked = this.CurrentSession.EnableBigIconInFolder; + } + + private void enableAnimationsToolStripMenuItem_Click(object sender, EventArgs e) + { + if (this.CurrentSession == null) + { + return; + } + + this.CurrentSession.EnableAnimation = !this.CurrentSession.EnableAnimation; + + enableAnimationsToolStripMenuItem.Checked = this.CurrentSession.EnableAnimation; + } + + private void alwaysOnTopToolStripMenuItem_Click(object sender, EventArgs e) + { + this.TopMost = !this.TopMost; + } + + + private void optionsToolStripMenuItem_Click(object sender, EventArgs e) + { + if (optionsForm == null) optionsForm = new OptionsForm(this); + optionsForm.ShowDialog(); + + invalidateHotKey(); + } + + + private void viewHelpToolStripMenuItem1_Click(object sender, EventArgs e) { try { @@ -557,7 +617,22 @@ namespace AppLauncher } } - private void aboutToolStripMenuItem_Click(object sender, EventArgs e) => MessageBox.Show(Application.ProductName + " v" + Application.ProductVersion, "About", MessageBoxButtons.OK, MessageBoxIcon.Information); + private void aboutToolStripMenuItem1_Click(object sender, EventArgs e) + { + MessageBox.Show(Application.ProductName + " v" + Application.ProductVersion, "About", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + + + private void menuStrip1_MenuActivate(object sender, EventArgs e) + { + alwaysOnTopToolStripMenuItem.Checked = this.TopMost; + saveAsToolStripMenuItem.Enabled = !string.IsNullOrWhiteSpace(sessionFilename); + } + + + #endregion + + #region notification icon private void notifyIcon1_MouseClick(object sender, MouseEventArgs e) { @@ -570,26 +645,13 @@ namespace AppLauncher private void exitToolStripMenuItem1_Click(object sender, EventArgs e) { requestExit = true; + this.Close(); } - private void toolStripMenuItem11_Click(object sender, EventArgs e) - { - if (this.CurrentSession == null) return; - this.CurrentSession.EnableAnimation = !this.CurrentSession.EnableAnimation; + #endregion - toolStripMenuItem11.Checked = this.CurrentSession.EnableAnimation; - } - - private void toolStripMenuItem12_Click(object sender, EventArgs e) - { - if (this.CurrentSession == null) return; - - this.CurrentSession.EnableBigIconInFolder = !this.CurrentSession.EnableBigIconInFolder; - - toolStripMenuItem12.Checked = this.CurrentSession.EnableBigIconInFolder; - } } } \ No newline at end of file diff --git a/MainForm.resx b/MainForm.resx index 12b1ad5..04386e6 100644 --- a/MainForm.resx +++ b/MainForm.resx @@ -1,64 +1,4 @@ - - - + @@ -117,9 +57,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - 172, 17 @@ -430,6 +367,9 @@ rEGAAKxBgAGsQYADrEHgB6xB/B+sQQ== + + 716, 17 + AAABAAQAMDAAAAEAIACoJQAARgAAACAgAAABACAAqBAAAO4lAAAYGAAAAQAgAIgJAACWNgAAEBAAAAEA diff --git a/Models/LauncherSession.cs b/Models/LauncherSession.cs index e007df4..784b2d8 100644 --- a/Models/LauncherSession.cs +++ b/Models/LauncherSession.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Drawing; -namespace AppLauncher.Models +namespace FizzyLauncher.Models { public class LauncherSession { @@ -35,6 +35,7 @@ namespace AppLauncher.Models public bool HideOnClick { get; set; } = false; public AutoSaveOption AutoSave { get; set; } = AutoSaveOption.Prompt; public List Groups { get; set; } = new List(); + public Point StartPosition { get; set; } = Point.Empty; } diff --git a/Models/TileGroupModel.cs b/Models/TileGroupModel.cs index ab8974a..6f69481 100644 --- a/Models/TileGroupModel.cs +++ b/Models/TileGroupModel.cs @@ -1,14 +1,21 @@ -using System.Collections.Generic; +using FizzyLauncher.Text.Json; +using System.Collections.Generic; using System.Drawing; +using System.Text.Json.Serialization; -namespace AppLauncher.Models +namespace FizzyLauncher.Models { public class TileGroupModel { public string Title { get; set; } + public bool IsExpanded { get; set; } = false; + public bool IsExclusive { get; set; } = false; + public List Items { get; set; } = new List(); - public Size GridSize = new Size(0, 0); + + [JsonConverter(typeof(JsonSizeConverter))] + public Size GridSize { get; set; } = new Size(0, 0); } } \ No newline at end of file diff --git a/Models/TileModel.cs b/Models/TileModel.cs index ba7aa02..9e47756 100644 --- a/Models/TileModel.cs +++ b/Models/TileModel.cs @@ -1,21 +1,31 @@ -using System; +using FizzyLauncher.Text.Json; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; +using System.Text.Json.Serialization; -namespace AppLauncher.Models +namespace FizzyLauncher.Models { public class TileModel { public string Title { get; set; } + public string ProcessFilename { get; set; } + public string ProcessArgument { get; set; } + public string ProcessWorkingDirectory { get; set; } + public ProcessWindowStyle ProcessWindowStyle { get; set; } = ProcessWindowStyle.Normal; + public bool ProcessAsAdmin { get; set; } = false; + + [JsonConverter(typeof(JsonPointConverter))] public Point Position { get; set; } public bool IsGroup { get; set; } = false; + public List Items { get; set; } = new List(); public override string ToString() => this.Title ?? string.Empty; diff --git a/OptionsForm.cs b/OptionsForm.cs new file mode 100644 index 0000000..29aff71 --- /dev/null +++ b/OptionsForm.cs @@ -0,0 +1,279 @@ +using FizzyLauncher.Models; +using RyzStudio.Windows.ThemedForms; +using System; + +namespace FizzyLauncher +{ + public class OptionsForm : TDialogForm + { + private System.Windows.Forms.Label label1; + private TButton button1; + private TYesNoPickerBox pickerBox2; + private System.Windows.Forms.Label label6; + private TYesNoPickerBox pickerBox3; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private TPickerBox pickerBox1; + private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1; + private TKeyCodeTextBox textBox1; + + + public OptionsForm(MainForm parent) : base() + { + InitializeComponent(); + + parentForm = parent; + + pickerBox1.ComboBox.Items.Clear(); + foreach (string item in Enum.GetNames(typeof(LauncherSession.AutoSaveOption))) + { + pickerBox1.ComboBox.Items.Add(item); + } + + if (pickerBox1.ComboBox.Items.Count > 0) pickerBox1.ComboBox.SelectedIndex = 0; + + } + + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OptionsForm)); + RyzStudio.Windows.ThemedForms.TKeyCodeTextBox.Results results1 = new RyzStudio.Windows.ThemedForms.TKeyCodeTextBox.Results(); + this.label1 = new System.Windows.Forms.Label(); + this.button1 = new RyzStudio.Windows.ThemedForms.TButton(); + this.pickerBox2 = new RyzStudio.Windows.ThemedForms.TYesNoPickerBox(); + this.label6 = new System.Windows.Forms.Label(); + this.pickerBox3 = new RyzStudio.Windows.ThemedForms.TYesNoPickerBox(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.pickerBox1 = new RyzStudio.Windows.ThemedForms.TPickerBox(); + this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); + this.textBox1 = new RyzStudio.Windows.ThemedForms.TKeyCodeTextBox(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.BackColor = System.Drawing.Color.Transparent; + this.label1.ForeColor = System.Drawing.SystemColors.ControlText; + this.label1.Location = new System.Drawing.Point(10, 21); + this.label1.Margin = new System.Windows.Forms.Padding(0); + this.label1.Name = "label1"; + this.label1.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); + this.label1.Size = new System.Drawing.Size(107, 34); + this.label1.TabIndex = 153; + this.label1.Text = "Show/Hide Hotkey"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button1.BackColor = System.Drawing.Color.Transparent; + this.button1.DefaultImage = null; + this.button1.DownImage = null; + this.button1.IsSelected = false; + this.button1.LabelText = "&Save"; + this.button1.Location = new System.Drawing.Point(241, 469); + this.button1.Margin = new System.Windows.Forms.Padding(10); + this.button1.Name = "button1"; + this.button1.OverImage = null; + this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.button1.Size = new System.Drawing.Size(128, 32); + this.button1.TabIndex = 173; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // pickerBox2 + // + this.pickerBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.pickerBox2.BackColor = System.Drawing.Color.Transparent; + this.pickerBox2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.pickerBox2.Location = new System.Drawing.Point(285, 103); + this.pickerBox2.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); + this.pickerBox2.Name = "pickerBox2"; + this.pickerBox2.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); + this.pickerBox2.Size = new System.Drawing.Size(84, 34); + this.pickerBox2.SubmitButton = null; + this.pickerBox2.TabIndex = 183; + this.pickerBox2.Value = true; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.BackColor = System.Drawing.Color.Transparent; + this.label6.ForeColor = System.Drawing.SystemColors.ControlText; + this.label6.Location = new System.Drawing.Point(10, 103); + this.label6.Margin = new System.Windows.Forms.Padding(0); + this.label6.Name = "label6"; + this.label6.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); + this.label6.Size = new System.Drawing.Size(83, 34); + this.label6.TabIndex = 182; + this.label6.Text = "Hide On Close"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // pickerBox3 + // + this.pickerBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.pickerBox3.BackColor = System.Drawing.Color.Transparent; + this.pickerBox3.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.pickerBox3.Location = new System.Drawing.Point(285, 144); + this.pickerBox3.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); + this.pickerBox3.Name = "pickerBox3"; + this.pickerBox3.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); + this.pickerBox3.Size = new System.Drawing.Size(84, 34); + this.pickerBox3.SubmitButton = null; + this.pickerBox3.TabIndex = 185; + this.pickerBox3.Value = true; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.BackColor = System.Drawing.Color.Transparent; + this.label7.ForeColor = System.Drawing.SystemColors.ControlText; + this.label7.Location = new System.Drawing.Point(10, 144); + this.label7.Margin = new System.Windows.Forms.Padding(0); + this.label7.Name = "label7"; + this.label7.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); + this.label7.Size = new System.Drawing.Size(95, 34); + this.label7.TabIndex = 184; + this.label7.Text = "Hide On Execute"; + this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.BackColor = System.Drawing.Color.Transparent; + this.label8.ForeColor = System.Drawing.SystemColors.ControlText; + this.label8.Location = new System.Drawing.Point(10, 62); + this.label8.Margin = new System.Windows.Forms.Padding(0); + this.label8.Name = "label8"; + this.label8.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); + this.label8.Size = new System.Drawing.Size(60, 34); + this.label8.TabIndex = 186; + this.label8.Text = "Auto Save"; + this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // pickerBox1 + // + this.pickerBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.pickerBox1.BackColor = System.Drawing.Color.Transparent; + this.pickerBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.pickerBox1.Location = new System.Drawing.Point(285, 62); + this.pickerBox1.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); + this.pickerBox1.Name = "pickerBox1"; + this.pickerBox1.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); + this.pickerBox1.Size = new System.Drawing.Size(84, 34); + this.pickerBox1.SubmitButton = null; + this.pickerBox1.TabIndex = 187; + // + // tHorizontalSeparator1 + // + this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0); + this.tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0); + this.tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent; + this.tHorizontalSeparator1.Location = new System.Drawing.Point(10, 437); + this.tHorizontalSeparator1.Margin = new System.Windows.Forms.Padding(10, 0, 10, 0); + this.tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); + this.tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22); + this.tHorizontalSeparator1.Name = "tHorizontalSeparator1"; + this.tHorizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); + this.tHorizontalSeparator1.Size = new System.Drawing.Size(364, 22); + this.tHorizontalSeparator1.TabIndex = 188; + // + // textBox1 + // + this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBox1.BackColor = System.Drawing.Color.Transparent; + this.textBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.textBox1.HighlightImage = ((System.Drawing.Image)(resources.GetObject("textBox1.HighlightImage"))); + results1.IsAlt = false; + results1.IsCtrl = false; + results1.IsShift = false; + results1.Key = System.Windows.Forms.Keys.None; + this.textBox1.KeyCodeResults = results1; + this.textBox1.Location = new System.Drawing.Point(192, 20); + this.textBox1.Margin = new System.Windows.Forms.Padding(10, 3, 3, 3); + this.textBox1.Name = "textBox1"; + this.textBox1.NormalImage = ((System.Drawing.Image)(resources.GetObject("textBox1.NormalImage"))); + this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); + this.textBox1.Size = new System.Drawing.Size(177, 35); + this.textBox1.SubmitButton = null; + this.textBox1.TabIndex = 189; + this.textBox1.UseSystemPasswordChar = false; + // + // OptionsForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(384, 521); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.tHorizontalSeparator1); + this.Controls.Add(this.pickerBox1); + this.Controls.Add(this.label8); + this.Controls.Add(this.pickerBox3); + this.Controls.Add(this.label7); + this.Controls.Add(this.pickerBox2); + this.Controls.Add(this.label6); + this.Controls.Add(this.button1); + this.Controls.Add(this.label1); + this.MinimumSize = new System.Drawing.Size(400, 560); + this.Name = "OptionsForm"; + this.Text = "Options"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + protected override void OnShown(EventArgs e) + { + base.OnShown(e); + + if (parentForm == null) + { + return; + } + + if (parentForm.CurrentSession == null) + { + return; + } + + // hotkey + if (parentForm.CurrentSession.HotKey != null) + { + textBox1.UpdateKeyCode(parentForm.CurrentSession.HotKey.IsCtrl, parentForm.CurrentSession.HotKey.IsAlt, parentForm.CurrentSession.HotKey.IsShift, parentForm.CurrentSession.HotKey.KeyCode); + } + + pickerBox1.ComboBox.SelectedIndex = (int)parentForm.CurrentSession.AutoSave; + pickerBox2.Value = parentForm.CurrentSession.HideOnClose; + pickerBox3.Value = parentForm.CurrentSession.HideOnClick; + } + + + public MainForm parentForm { get; set; } = null; + + + private void button1_Click(object sender, EventArgs e) + { + if (parentForm != null) + { + if (parentForm.CurrentSession == null) parentForm.CurrentSession = new LauncherSession(); + if (parentForm.CurrentSession.HotKey == null) parentForm.CurrentSession.HotKey = new LauncherSession.HotKeyOptions(); + + parentForm.CurrentSession.HotKey.IsCtrl = textBox1.KeyCodeResults.IsCtrl; + parentForm.CurrentSession.HotKey.IsAlt = textBox1.KeyCodeResults.IsAlt; + parentForm.CurrentSession.HotKey.IsShift = textBox1.KeyCodeResults.IsShift; + parentForm.CurrentSession.HotKey.Key = textBox1.KeyCodeResults.KeyCode; + + parentForm.CurrentSession.AutoSave = (LauncherSession.AutoSaveOption)pickerBox1.ComboBox.SelectedIndex; + parentForm.CurrentSession.HideOnClose = pickerBox2.Value; + parentForm.CurrentSession.HideOnClick = pickerBox3.Value; + + } + + this.Close(); + } + + } +} \ No newline at end of file diff --git a/OptionsForm.resx b/OptionsForm.resx new file mode 100644 index 0000000..e3d054b --- /dev/null +++ b/OptionsForm.resx @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAYAAAAmlE46AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vQAADr0BR/uQrQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAClSURBVDhP7dI/ + DgFBGIbxSVTKjcRx3MLqXYCOjkocQcMF3MAZOIKaE5AthOexf2QnbJQKb/JLJvO9XzLFhCgtbHDBveB5 + DWcfM8ANC0wKnr1LUUsbHXSxxBlJxDtnduy6E04on/Utd0IPOxwxxBT9iHfO7Nh155kV9vmxMXbsVvkv + vvIji4f82Bg7tcUxrpih/NyxOeyMUMVPu0WGd39TzuzQDeEB5/ZKvTSyulEAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAYAAAAmlE46AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vQAADr0BR/uQrQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADTSURBVDhP7ZI7 + CsJQEEUfWFmK4HLchdpnA9ppp5W4BBtdQNyBC0ilRf6VdVyBwUL03JdXxC/YWThwmDcz94YJjKmH7/uN + OI7XaZqekiS5Cr1hpZmTPQemAeILeU4eC/dWr+9kVQRB0MzzvB2GYQfBAsExiqJWHfU0k0ZaeQyNAuxa + X1CYLMu6/MOW4kD2YAK9B9TznGYrj12XVZY0drb4ENJI68q/sR4/YoS9K9+GNHdGLmIEJV+cku1xP4Jh + Ri7JQ2erDp3mBs7w6jaFZht74MaYGwmLbkeRGexGAAAAAElFTkSuQmCC + + + \ No newline at end of file diff --git a/Program.cs b/Program.cs index 49753de..71f4564 100644 --- a/Program.cs +++ b/Program.cs @@ -1,31 +1,23 @@ -using System; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; using System.Windows.Forms; -namespace AppLauncher +namespace FizzyLauncher { static class Program { - const string applicationID = "f31c9f65-4047-41e4-ac85-dbe11d12ee46"; - /// - /// The main entry point for the application. + /// The main entry point for the application. /// [STAThread] static void Main() { - System.Threading.Mutex mutex = new System.Threading.Mutex(false, applicationID); - if (mutex.WaitOne(TimeSpan.Zero)) - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); - - mutex.ReleaseMutex(); - } - - mutex.Close(); - mutex.Dispose(); - mutex = null; + Application.SetHighDpiMode(HighDpiMode.SystemAware); + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); } } } diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs deleted file mode 100644 index 91add18..0000000 --- a/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Fizzy Launcher")] -[assembly: AssemblyDescription("Application and shortcut launcher")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Hi, I'm Ray")] -[assembly: AssemblyProduct("Fizzy Launcher")] -[assembly: AssemblyCopyright("Copyright © Ray Lam 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("66c1c75c-3612-4d23-b937-c3de0d653292")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("0.1.2.016")] diff --git a/Properties/PublishProfiles/Release x64.pubxml b/Properties/PublishProfiles/Release x64.pubxml new file mode 100644 index 0000000..23a6044 --- /dev/null +++ b/Properties/PublishProfiles/Release x64.pubxml @@ -0,0 +1,17 @@ + + + + + Release + Any CPU + bin\Release\64\ + FileSystem + net5.0-windows + win-x64 + false + True + False + + \ No newline at end of file diff --git a/Properties/PublishProfiles/Release x86.pubxml b/Properties/PublishProfiles/Release x86.pubxml new file mode 100644 index 0000000..56c7547 --- /dev/null +++ b/Properties/PublishProfiles/Release x86.pubxml @@ -0,0 +1,17 @@ + + + + + Release + Any CPU + bin\Release\86\ + FileSystem + net5.0-windows + win-x86 + false + True + False + + \ No newline at end of file diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs deleted file mode 100644 index 85a6f63..0000000 --- a/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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 AppLauncher.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/Properties/Settings.settings b/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/FizzyLauncher.UI/Resources/16/arrow_down.png b/Resources/UI/arrow_down.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/arrow_down.png rename to Resources/UI/arrow_down.png diff --git a/FizzyLauncher.UI/Resources/16/arrow_down2.png b/Resources/UI/arrow_down2.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/arrow_down2.png rename to Resources/UI/arrow_down2.png diff --git a/FizzyLauncher.UI/Resources/16/arrow_up.png b/Resources/UI/arrow_up.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/arrow_up.png rename to Resources/UI/arrow_up.png diff --git a/FizzyLauncher.UI/Resources/16/arrow_up2.png b/Resources/UI/arrow_up2.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/arrow_up2.png rename to Resources/UI/arrow_up2.png diff --git a/FizzyLauncher.UI/Resources/16/close.png b/Resources/UI/close.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/close.png rename to Resources/UI/close.png diff --git a/FizzyLauncher.UI/Resources/16/close2.png b/Resources/UI/close2.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/close2.png rename to Resources/UI/close2.png diff --git a/Resources/UI/cog.png b/Resources/UI/cog.png new file mode 100644 index 0000000..7a63c8f Binary files /dev/null and b/Resources/UI/cog.png differ diff --git a/Resources/UI/cog2.png b/Resources/UI/cog2.png new file mode 100644 index 0000000..d40221f Binary files /dev/null and b/Resources/UI/cog2.png differ diff --git a/Resources/UI/disk.png b/Resources/UI/disk.png new file mode 100644 index 0000000..7355b96 Binary files /dev/null and b/Resources/UI/disk.png differ diff --git a/Resources/UI/disk2.png b/Resources/UI/disk2.png new file mode 100644 index 0000000..29b59a4 Binary files /dev/null and b/Resources/UI/disk2.png differ diff --git a/FizzyLauncher.UI/Resources/16/edit.png b/Resources/UI/edit.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/edit.png rename to Resources/UI/edit.png diff --git a/FizzyLauncher.UI/Resources/16/edit2.png b/Resources/UI/edit2.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/edit2.png rename to Resources/UI/edit2.png diff --git a/FizzyLauncher.UI/Resources/16/file.png b/Resources/UI/file.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/file.png rename to Resources/UI/file.png diff --git a/FizzyLauncher.UI/Resources/16/file2.png b/Resources/UI/file2.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/file2.png rename to Resources/UI/file2.png diff --git a/FizzyLauncher.UI/Resources/16/folder.png b/Resources/UI/folder.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/folder.png rename to Resources/UI/folder.png diff --git a/FizzyLauncher.UI/Resources/16/folder2.png b/Resources/UI/folder2.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/folder2.png rename to Resources/UI/folder2.png diff --git a/Resources/UI/help.png b/Resources/UI/help.png new file mode 100644 index 0000000..88b4864 Binary files /dev/null and b/Resources/UI/help.png differ diff --git a/Resources/UI/help2.png b/Resources/UI/help2.png new file mode 100644 index 0000000..ae6856d Binary files /dev/null and b/Resources/UI/help2.png differ diff --git a/Resources/UI/icons.svg b/Resources/UI/icons.svg new file mode 100644 index 0000000..998bbb6 --- /dev/null +++ b/Resources/UI/icons.svg @@ -0,0 +1,168 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FizzyLauncher.UI/Resources/16/minus.png b/Resources/UI/minus.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/minus.png rename to Resources/UI/minus.png diff --git a/FizzyLauncher.UI/Resources/16/minus2.png b/Resources/UI/minus2.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/minus2.png rename to Resources/UI/minus2.png diff --git a/FizzyLauncher.UI/Resources/16/plus.png b/Resources/UI/plus.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/plus.png rename to Resources/UI/plus.png diff --git a/FizzyLauncher.UI/Resources/16/plus2.png b/Resources/UI/plus2.png similarity index 100% rename from FizzyLauncher.UI/Resources/16/plus2.png rename to Resources/UI/plus2.png diff --git a/Resources/UI/trash.png b/Resources/UI/trash.png new file mode 100644 index 0000000..55e6552 Binary files /dev/null and b/Resources/UI/trash.png differ diff --git a/Resources/UI/trash2.png b/Resources/UI/trash2.png new file mode 100644 index 0000000..1ae8d43 Binary files /dev/null and b/Resources/UI/trash2.png differ diff --git a/Resources/app_icon.png b/Resources/app_icon.png deleted file mode 100644 index ad67f18..0000000 Binary files a/Resources/app_icon.png and /dev/null differ diff --git a/Resources/app_icon_32.png b/Resources/app_icon_32.png deleted file mode 100644 index 51e5f0d..0000000 Binary files a/Resources/app_icon_32.png and /dev/null differ diff --git a/Resources/raw/icon-set.svg b/Resources/raw/icon-set.svg deleted file mode 100644 index d7d223a..0000000 --- a/Resources/raw/icon-set.svg +++ /dev/null @@ -1,942 +0,0 @@ - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FizzyLauncher.UI/RyzStudio/Data/SQLite/SQLiteDatabase.cs b/RyzStudio/Data/SQLite/SQLiteDatabase.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Data/SQLite/SQLiteDatabase.cs rename to RyzStudio/Data/SQLite/SQLiteDatabase.cs diff --git a/FizzyLauncher.UI/RyzStudio/Drawing/Rectangoid.cs b/RyzStudio/Drawing/Rectangoid.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Drawing/Rectangoid.cs rename to RyzStudio/Drawing/Rectangoid.cs diff --git a/FizzyLauncher.UI/RyzStudio/IO/FileType.cs b/RyzStudio/IO/FileType.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/IO/FileType.cs rename to RyzStudio/IO/FileType.cs diff --git a/FizzyLauncher.UI/RyzStudio/IO/SessionFileFormatBase.cs b/RyzStudio/IO/SessionFileFormatBase.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/IO/SessionFileFormatBase.cs rename to RyzStudio/IO/SessionFileFormatBase.cs diff --git a/FizzyLauncher.UI/RyzStudio/IO/SharpZipLib.cs b/RyzStudio/IO/SharpZipLib.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/IO/SharpZipLib.cs rename to RyzStudio/IO/SharpZipLib.cs diff --git a/FizzyLauncher.UI/RyzStudio/Net/HttpWeb.cs b/RyzStudio/Net/HttpWeb.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Net/HttpWeb.cs rename to RyzStudio/Net/HttpWeb.cs diff --git a/FizzyLauncher.UI/RyzStudio/Windows/Forms/StackLayoutPanel.cs b/RyzStudio/Windows/Forms/StackLayoutPanel.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/Forms/StackLayoutPanel.cs rename to RyzStudio/Windows/Forms/StackLayoutPanel.cs diff --git a/FizzyLauncher.UI/RyzStudio/Windows/Forms/TFlatButton.cs b/RyzStudio/Windows/Forms/TFlatButton.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/Forms/TFlatButton.cs rename to RyzStudio/Windows/Forms/TFlatButton.cs diff --git a/RyzStudio/Windows/Forms/TForm.cs b/RyzStudio/Windows/Forms/TForm.cs new file mode 100644 index 0000000..58ed7dc --- /dev/null +++ b/RyzStudio/Windows/Forms/TForm.cs @@ -0,0 +1,434 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +//using Resources = AppLauncher.Properties.Resources; + +namespace RyzStudio.Windows.Forms +{ + public class TForm : Form + { + //protected readonly Color borderColour = Color.FromArgb(200, 200, 200); + //protected readonly int borderWidth = 1; + + //protected readonly int resizeBorderWidth = 4; + + protected readonly Color backColour = Color.FromArgb(250, 250, 250); + + //protected readonly Color titleBackColour = Color.FromArgb(235, 234, 233); + //protected readonly Color titleBorderColour = Color.FromArgb(200, 198, 196); + //protected readonly Color titleColour = Color.FromArgb(102, 102, 102); + //protected readonly int titleBarHeight = 33; + //protected readonly bool showTitleBarLine = true; + //protected Font titleFont = null; + //protected int titleFontTop = 0; + + //protected readonly Size titleBarIconSize = new Size(48, 32); + //protected readonly int titleBarIconMargin = 0; + //protected readonly int titleBarIconMarginRight = 0; + + //protected Image appIcon = null; + //protected const int appIconLeft = 12; + //protected const int appIconRight = 6; + //protected int appIconTop = 0; + + protected bool isDragging = false; + protected Point startPosition = new Point(); + + //protected Point startWindowSize = new Point(); + + //protected bool enableMinimise { get; set; } = true; + //protected bool enableMaximise { get; set; } = true; + //protected bool enableClose { get; set; } = true; + //protected bool closeOnMinimise { get; set; } = false; + + protected bool isBusy = false; + + private IContainer components; + + public TForm() : base() + { + InitializeComponent(); + + //if (!this.DesignMode) + //{ + // this.FormBorderStyle = FormBorderStyle.None; + // this.StartPosition = FormStartPosition.Manual; + //} + + this.AutoScaleMode = AutoScaleMode.Font; + this.BackColor = backColour; + this.FormBorderStyle = FormBorderStyle.Sizable; + this.Padding = new Padding(0); + this.DoubleBuffered = true; + + this.MouseDown += new MouseEventHandler(form_MouseDown); + this.MouseMove += new MouseEventHandler(form_MouseMove); + this.MouseUp += new MouseEventHandler(form_MouseUp); + this.PreviewKeyDown += new PreviewKeyDownEventHandler(form_PreviewKeyDown); + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + this.Text = Application.ProductName; + + //initialiseLoadComponent(); + + //if (appIcon != null) appIconTop = (int)Math.Floor((decimal)(titleBarHeight - appIcon.Height) / 2) + borderWidth; + //titleFont = new Font(this.Font.FontFamily, 10F); + //titleFontTop = (int)Math.Floor((decimal)(titleBarHeight - TextRenderer.MeasureText("#", titleFont).Height) / 2) + borderWidth; + + } + + //protected override void OnMouseClick(MouseEventArgs e) + //{ + // base.OnMouseClick(e); + + // bool isLabel = ((e.Location.X >= 0) && (e.Location.X <= this.Width) && (e.Location.Y >= 0) && (e.Location.Y <= titleBarHeight)); + + // if (e.Button == MouseButtons.Left) + // { + // if (isLabel) + // { + // // do nothing + // } + // else + // { + // // do nothing + // } + // } + // else if (e.Button == MouseButtons.Right) + // { + // if (isLabel) + // { + // if (this.TitleContextMenuStrip != null) + // { + // this.TitleContextMenuStrip.Show(this, e.Location); + // } + // } + // else + // { + // // do nothing + // } + // } + //} + + //protected override void OnPaint(PaintEventArgs e) + //{ + // base.OnPaint(e); + + // Graphics g = e.Graphics; + // Rectangle area = new Rectangle(this.DisplayRectangle.X, this.DisplayRectangle.Y, (this.DisplayRectangle.Width - borderWidth), (this.DisplayRectangle.Height - borderWidth)); + + // // border + // g.DrawRectangle(new Pen(borderColour, borderWidth), area); + + // area.Inflate((-1 * borderWidth), (-1 * borderWidth)); + + //g.FillRectangle(new SolidBrush(titleBackColour), area.X, area.Y, (area.Width + area.X), titleBarHeight); + + //if (showTitleBarLine) g.DrawLine(new Pen(titleBorderColour, 1), area.X, titleBarHeight, (area.Width + area.X), titleBarHeight); + + //if (!DesignMode) + //{ + // if (appIcon != null) g.DrawImageUnscaled(appIcon, appIconLeft, appIconTop); + + // int iconPosX = borderWidth + appIconLeft + appIconRight + ((appIcon == null) ? 0 : appIcon.Width); + // TextRenderer.DrawText(g, this.Text, titleFont, new Point(iconPosX, titleFontTop), titleColour); + //} + //} + + protected override void OnResize(EventArgs e) + { + base.OnResize(e); + + this.Invalidate(); + } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override Color BackColor { get => base.BackColor; set => base.BackColor = backColour; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new FormBorderStyle FormBorderStyle { get => base.FormBorderStyle; set => base.FormBorderStyle = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new Padding Padding { get => base.Padding; set => base.Padding = value; } + + [Category("Appearance")] + public ContextMenuStrip TitleContextMenuStrip { get; set; } = null; + + //[Browsable(false)] + //public Image AppIcon { get; set; } = null; + + //[Browsable(false)] + //public bool IsMaximiseEnabled { get; set; } = false; + + //protected Point DefaultLocation + //{ + // get + // { + // Point newPosition = new Point(Cursor.Position.X, Cursor.Position.Y); + // newPosition.X -= (this.Width / 2); + // newPosition.Y -= (this.Height / 2); + + // newPosition.X = Math.Max(newPosition.X, Screen.PrimaryScreen.WorkingArea.Left); + // newPosition.Y = Math.Max(newPosition.Y, Screen.PrimaryScreen.WorkingArea.Top); + + // return newPosition; + // } + //} + + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TForm)); + this.SuspendLayout(); + // + // AForm + // + this.Name = "AForm"; + this.ResumeLayout(false); + } + + private void form_MouseDown(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + isDragging = true; + startPosition = e.Location; + //startWindowSize = new Point(this.Width, this.Height); + } + } + + private void form_MouseMove(object sender, MouseEventArgs e) + { + if (isDragging) + { + int x = (this.Location.X + (e.Location.X - startPosition.X)); + int y = (this.Location.Y + (e.Location.Y - startPosition.Y)); + + //this.Location = validateFormLocation(x, y); + this.Location = new Point(x, y); + } + } + + private void form_MouseUp(object sender, MouseEventArgs e) + { + isDragging = false; + } + + private void form_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) + { + if (e.KeyCode == Keys.Escape) + { + Application.Exit(); + } + } + + //protected virtual void initialiseLoadComponent() + //{ + // if (DesignMode) return; + + // // close + // TImageBox closeBox = generateToolbarImageBox(); + // closeBox.Image = closeBox.ImageNormal = (enableClose) ? Resources.titlebar_close : Resources.titlebar_blank; + // closeBox.ImageHover = (enableClose) ? Resources.titlebar_close3 : Resources.titlebar_blank; + // closeBox.ImageSelected = Resources.titlebar_close3; + // closeBox.MouseClick += delegate (object sender, MouseEventArgs e) + // { + // if (e.Button == MouseButtons.Left) + // { + // if (enableClose) + // { + // this.Close(); + // } + // } + // }; + // closeBox.Left = this.DisplayRectangle.Width - closeBox.Width - (titleBarIconMarginRight + borderWidth); + + // this.Controls.Add(closeBox); + + // // maximise + // TImageBox maximiseBox = generateToolbarImageBox(); + // maximiseBox.Image = maximiseBox.ImageNormal = (enableMaximise) ? Resources.titlebar_maximise : Resources.titlebar_blank; + // maximiseBox.ImageHover = (enableMaximise) ? Resources.titlebar_maximise5 : Resources.titlebar_blank; + // maximiseBox.ImageSelected = Resources.titlebar_maximise3; + // maximiseBox.MouseClick += delegate (object sender, MouseEventArgs e) + // { + // if (!(sender is TImageBox)) return; + + // TImageBox imageBox2 = (sender as TImageBox); + + // if (imageBox2 == null) return; + + // if (e.Button == MouseButtons.Left) + // { + // if (enableMaximise) + // { + // if (this.WindowState == FormWindowState.Maximized) + // { + // this.WindowState = FormWindowState.Normal; + // imageBox2.Image = imageBox2.ImageNormal = Resources.titlebar_maximise; + // } + // else + // { + // this.WindowState = FormWindowState.Maximized; + // imageBox2.Image = imageBox2.ImageNormal = Resources.titlebar_maximise5; + // } + // } + // } + // else if (e.Button == MouseButtons.Right) + // { + // this.TopMost = !this.TopMost; + + // if (this.TopMost) + // { + // imageBox2.Image = imageBox2.ImageNormal = Resources.titlebar_maximise3; + // imageBox2.ImageHover = (enableMaximise) ? Resources.titlebar_maximise5 : Resources.titlebar_maximise3; + // } + // else + // { + // imageBox2.Image = imageBox2.ImageNormal = (enableMaximise) ? Resources.titlebar_maximise : Resources.titlebar_blank; + // imageBox2.ImageHover = (enableMaximise) ? Resources.titlebar_maximise5 : Resources.titlebar_blank; + // } + // } + // }; + // maximiseBox.Left = closeBox.Left - maximiseBox.Width - titleBarIconMargin; + + // this.Controls.Add(maximiseBox); + + // // minimise + // TImageBox minimiseBox = generateToolbarImageBox(); + // minimiseBox.Image = minimiseBox.ImageNormal = (enableMinimise) ? Resources.titlebar_minimise : Resources.titlebar_blank; + // minimiseBox.ImageHover = (enableMinimise) ? Resources.titlebar_minimise5 : Resources.titlebar_blank; + // //minimiseBox.ImageSelected = null; + // minimiseBox.MouseClick += delegate (object sender, MouseEventArgs e) + // { + // if (!enableMinimise) return; + // if (e.Button != MouseButtons.Left) return; + + // if (closeOnMinimise) + // { + // this.Close(); + // } + // else + // { + // this.WindowState = FormWindowState.Minimized; + // } + // }; + // minimiseBox.Left = maximiseBox.Left - minimiseBox.Width - titleBarIconMargin; + + // this.Controls.Add(minimiseBox); + + // // resize + // UserControl uc1 = new UserControl() + // { + // Anchor = (AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right), + // Height = resizeBorderWidth, + // Width = this.DisplayRectangle.Width - resizeBorderWidth, + // Left = 0, + // Top = this.DisplayRectangle.Height - resizeBorderWidth, + // BackColor = Color.Transparent, + // Cursor = Cursors.SizeNS + // }; + // uc1.MouseDown += form_MouseDown; + // uc1.MouseUp += form_MouseUp; + // uc1.MouseMove += delegate (object sender, MouseEventArgs e) + // { + // if (isDragging) + // { + // this.Size = new Size(startWindowSize.X, e.Y - startPosition.Y + this.Height); + // } + // }; + // uc1.BringToFront(); + + // this.Controls.Add(uc1); + + // UserControl uc2 = new UserControl() + // { + // Anchor = (AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom), + // Height = this.DisplayRectangle.Height - resizeBorderWidth, + // Width = resizeBorderWidth, + // Left = this.DisplayRectangle.Width - resizeBorderWidth, + // Top = 0, + // BackColor = Color.Transparent, + // Cursor = Cursors.SizeWE + // }; + // uc2.MouseDown += form_MouseDown; + // uc2.MouseUp += form_MouseUp; + // uc2.MouseMove += delegate (object sender, MouseEventArgs e) + // { + // if (isDragging) + // { + // this.Size = new Size(e.X - startPosition.X + this.Width, startWindowSize.Y); + // } + // }; + // uc2.BringToFront(); + + // this.Controls.Add(uc2); + + // UserControl uc3 = new UserControl() + // { + // Anchor = (AnchorStyles.Bottom | AnchorStyles.Right), + // Height = resizeBorderWidth, + // Width = resizeBorderWidth, + // Left = this.DisplayRectangle.Width - resizeBorderWidth, + // Top = this.DisplayRectangle.Height - resizeBorderWidth, + // BackColor = Color.Transparent, + // Cursor = Cursors.SizeNWSE + // }; + // uc3.MouseDown += form_MouseDown; + // uc3.MouseUp += form_MouseUp; + // uc3.MouseMove += delegate (object sender, MouseEventArgs e) + // { + // if (isDragging) + // { + // this.Size = new Size((e.X - startPosition.X + this.Width), (e.Y - startPosition.Y + this.Height)); + // } + // }; + // uc3.BringToFront(); + + // this.Controls.Add(uc3); + //} + + //protected TImageBox generateToolbarImageBox() + //{ + // TImageBox imageBox = new TImageBox(); + // //imageBox.BackColor = Color.Transparent; + // imageBox.BackColorHover = imageBox.BackColorSelected = Color.FromArgb(220, 220, 220); + // imageBox.BackgroundImageLayout = ImageLayout.Center; + // imageBox.ErrorImage = null; + // //imageBox.Image = Resources.close; + // //imageBox.ImageHover = Resources.close2; + // //imageBox.ImageNormal = Resources.close; + // imageBox.ImageSelected = null; + // imageBox.IsSelected = false; + // //closeBox.Location = new System.Drawing.Point(169, 12); + // imageBox.Size = titleBarIconSize; + // imageBox.SizeMode = PictureBoxSizeMode.CenterImage; + // //imageBox.MouseClick += new MouseEventHandler(closeBox_MouseClick); + // //imageBox.Left = this.DisplayRectangle.Width - imageBox.Width - 17; + // imageBox.Top = (int)Math.Floor((decimal) (titleBarHeight - titleBarIconSize.Height) / 2) + borderWidth; + // imageBox.Anchor = (AnchorStyles.Top | AnchorStyles.Right); + // imageBox.Padding = new Padding(0); + + // return imageBox; + //} + + //private void exitToolStripMenuItem_Click(object sender, EventArgs e) => this.Close(); + + //private void notifyIcon1_MouseClick(object sender, MouseEventArgs e) + //{ + // if (e.Button == MouseButtons.Left) + // { + // this.Visible = !this.Visible; + // } + + // //notifyIcon1.Visible = !this.Visible; + //} + + + } +} \ No newline at end of file diff --git a/FizzyLauncher.UI/RyzStudio/Windows/Forms/TForm.resx b/RyzStudio/Windows/Forms/TForm.resx similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/Forms/TForm.resx rename to RyzStudio/Windows/Forms/TForm.resx diff --git a/FizzyLauncher.UI/RyzStudio/Windows/Forms/THorizontalSeparator.Designer.cs b/RyzStudio/Windows/Forms/THorizontalSeparator.Designer.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/Forms/THorizontalSeparator.Designer.cs rename to RyzStudio/Windows/Forms/THorizontalSeparator.Designer.cs diff --git a/RyzStudio/Windows/Forms/THorizontalSeparator.cs b/RyzStudio/Windows/Forms/THorizontalSeparator.cs new file mode 100644 index 0000000..1be87f2 --- /dev/null +++ b/RyzStudio/Windows/Forms/THorizontalSeparator.cs @@ -0,0 +1,101 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace RyzStudio.Windows.Forms +{ + public partial class THorizontalSeparator : System.Windows.Forms.UserControl + { + public THorizontalSeparator() + { + InitializeComponent(); + + this.BackColor = Color.Transparent; + this.Margin = new Padding(10, 0, 10, 0); + this.MaximumSize = new Size(SystemInformation.VirtualScreen.Width, 22); + this.MinimumSize = new Size(0, 22); + this.Padding = new Padding(0, 10, 0, 10); + } + + protected override void OnPaintBackground(PaintEventArgs e) + { + base.OnPaintBackground(e); + + Graphics g = e.Graphics; + + g.FillRectangle(new SolidBrush(Color.FromArgb(213, 223, 229)), new Rectangle(this.DisplayRectangle.Left, 11, this.DisplayRectangle.Width, 1)); + g.FillRectangle(new SolidBrush(Color.FromArgb(249, 251, 253)), new Rectangle(this.DisplayRectangle.Left, 12, this.DisplayRectangle.Width, 1)); + } + + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override Image BackgroundImage { get => base.BackgroundImage; set => base.BackgroundImage = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override ImageLayout BackgroundImageLayout { get => base.BackgroundImageLayout; set => base.BackgroundImageLayout = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new BorderStyle BorderStyle { get => base.BorderStyle; set => base.BorderStyle = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override Cursor Cursor { get => base.Cursor; set => base.Cursor = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override Font Font { get => base.Font; set => base.Font = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override Color BackColor { get => base.BackColor; set => base.BackColor = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override Color ForeColor { get => base.ForeColor; set => base.ForeColor = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override RightToLeft RightToLeft { get => base.RightToLeft; set => base.RightToLeft = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new bool UseWaitCursor { get => base.UseWaitCursor; set => base.UseWaitCursor = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override bool AllowDrop { get => base.AllowDrop; set => base.AllowDrop = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override AutoValidate AutoValidate { get => base.AutoValidate; set => base.AutoValidate = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override ContextMenuStrip ContextMenuStrip { get => base.ContextMenuStrip; set => base.ContextMenuStrip = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new ImeMode ImeMode { get => base.ImeMode; set => base.ImeMode = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override bool AutoScroll { get => base.AutoScroll; set => base.AutoScroll = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new Size AutoScrollMargin { get => base.AutoScrollMargin; set => base.AutoScrollMargin = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new Size AutoScrollMinSize { get => base.AutoScrollMinSize; set => base.AutoScrollMinSize = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override bool AutoSize { get => base.AutoSize; set => base.AutoSize = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new AutoSizeMode AutoSizeMode { get => base.AutoSizeMode; set => base.AutoSizeMode = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override Size MaximumSize { get => base.MaximumSize; set => base.MaximumSize = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override Size MinimumSize { get => base.MinimumSize; set => base.MinimumSize = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new Padding Margin { get => base.Margin; set => base.Margin = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new Padding Padding { get => base.Padding; set => base.Padding = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new DockStyle Dock { get => base.Dock; set => base.Dock = value; } + + } +} diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TButton.resx b/RyzStudio/Windows/Forms/THorizontalSeparator.resx similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TButton.resx rename to RyzStudio/Windows/Forms/THorizontalSeparator.resx diff --git a/FizzyLauncher.UI/RyzStudio/Windows/Forms/TImageBox.cs b/RyzStudio/Windows/Forms/TImageBox.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/Forms/TImageBox.cs rename to RyzStudio/Windows/Forms/TImageBox.cs diff --git a/FizzyLauncher.UI/RyzStudio/Windows/Forms/PanelBook.cs b/RyzStudio/Windows/Forms/TPanelBook.cs similarity index 97% rename from FizzyLauncher.UI/RyzStudio/Windows/Forms/PanelBook.cs rename to RyzStudio/Windows/Forms/TPanelBook.cs index c6755c8..eae6a0f 100644 --- a/FizzyLauncher.UI/RyzStudio/Windows/Forms/PanelBook.cs +++ b/RyzStudio/Windows/Forms/TPanelBook.cs @@ -7,18 +7,18 @@ using System.Windows.Forms; [ToolboxItem(true)] - public class PanelBook : UserControl + public class TPanelBook : UserControl { public class PanelCollection : CollectionBase { - protected PanelBook panelBook = null; + protected TPanelBook panelBook = null; - public PanelCollection(PanelBook parentPanelBook) : base() + public PanelCollection(TPanelBook parentPanelBook) : base() { panelBook = parentPanelBook; } - public PanelBook Parent => panelBook; + public TPanelBook Parent => panelBook; public Panel this[int index] { get => (Panel)List[index]; set => List[index] = value; } @@ -70,7 +70,7 @@ protected PanelCollection panelCollection = null; - public PanelBook() + public TPanelBook() { InitializeComponent(); diff --git a/FizzyLauncher.UI/RyzStudio/Windows/Forms/TUserControl.cs b/RyzStudio/Windows/Forms/TUserControl.cs similarity index 61% rename from FizzyLauncher.UI/RyzStudio/Windows/Forms/TUserControl.cs rename to RyzStudio/Windows/Forms/TUserControl.cs index 8bb38d6..8a22585 100644 --- a/FizzyLauncher.UI/RyzStudio/Windows/Forms/TUserControl.cs +++ b/RyzStudio/Windows/Forms/TUserControl.cs @@ -4,7 +4,7 @@ using System.Windows.Forms; namespace RyzStudio.Windows.Forms { - public class TUserControl : System.Windows.Forms.UserControl + public class TUserControl : UserControl { public TUserControl() : base() @@ -12,61 +12,61 @@ namespace RyzStudio.Windows.Forms } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Image BackgroundImage { get => base.BackgroundImage; set => base.BackgroundImage = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override ImageLayout BackgroundImageLayout { get => base.BackgroundImageLayout; set => base.BackgroundImageLayout = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public new BorderStyle BorderStyle { get => base.BorderStyle; set => base.BorderStyle = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Cursor Cursor { get => base.Cursor; set => base.Cursor = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Font Font { get => base.Font; set => base.Font = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Color ForeColor { get => base.ForeColor; set => base.ForeColor = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override RightToLeft RightToLeft { get => base.RightToLeft; set => base.RightToLeft = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public new bool UseWaitCursor { get => base.UseWaitCursor; set => base.UseWaitCursor = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override bool AllowDrop { get => base.AllowDrop; set => base.AllowDrop = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override AutoValidate AutoValidate { get => base.AutoValidate; set => base.AutoValidate = value; } - //[Browsable(false)] + //[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] //public override ContextMenuStrip ContextMenuStrip { get => base.ContextMenuStrip; set => base.ContextMenuStrip = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public new ImeMode ImeMode { get => base.ImeMode; set => base.ImeMode = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override bool AutoScroll { get => base.AutoScroll; set => base.AutoScroll = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public new Size AutoScrollMargin { get => base.AutoScrollMargin; set => base.AutoScrollMargin = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public new Size AutoScrollMinSize { get => base.AutoScrollMinSize; set => base.AutoScrollMinSize = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override bool AutoSize { get => base.AutoSize; set => base.AutoSize = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public new AutoSizeMode AutoSizeMode { get => base.AutoSizeMode; set => base.AutoSizeMode = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Size MaximumSize { get => base.MaximumSize; set => base.MaximumSize = value; } - [Browsable(false)] + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public override Size MinimumSize { get => base.MinimumSize; set => base.MinimumSize = value; } } diff --git a/FizzyLauncher.UI/RyzStudio/Windows/Forms/ThreadControl.cs b/RyzStudio/Windows/Forms/ThreadControl.cs similarity index 88% rename from FizzyLauncher.UI/RyzStudio/Windows/Forms/ThreadControl.cs rename to RyzStudio/Windows/Forms/ThreadControl.cs index 4c9c89e..49220fb 100644 --- a/FizzyLauncher.UI/RyzStudio/Windows/Forms/ThreadControl.cs +++ b/RyzStudio/Windows/Forms/ThreadControl.cs @@ -320,6 +320,21 @@ namespace RyzStudio.Windows.Forms } } + public static void SetFocus(Control control) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => + { + control.Focus(); + })); + } + else + { + control.Focus(); + } + } + public static int GetValue(NumericUpDown sender) { int rv = 0; @@ -384,6 +399,22 @@ namespace RyzStudio.Windows.Forms } } + public static void ClientSize(Control control, int width, int height) => ClientSize(control, new Size(width, height)); + + public static void ClientSize(Control control, Size value) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.ClientSize = value; + })); + } + else + { + control.ClientSize = value; + } + } + public static void SetSize(Control control, int width, int height) => SetSize(control, new Size(width, height)); public static void SetSize(Control control, Size value) @@ -479,15 +510,15 @@ namespace RyzStudio.Windows.Forms control.Invoke(new MethodInvoker(() => { if (value) { - control.ShowInTaskbar = value; - control.Opacity = 100; + //control.ShowInTaskbar = value; + //control.Opacity = 100; control.Visible = value; } else { control.Visible = value; - control.ShowInTaskbar = value; - control.Opacity = 0; + //control.ShowInTaskbar = value; + //control.Opacity = 0; } })); } @@ -495,15 +526,15 @@ namespace RyzStudio.Windows.Forms { if (value) { - control.ShowInTaskbar = value; - control.Opacity = 100; + //control.ShowInTaskbar = value; + //control.Opacity = 100; control.Visible = value; } else { control.Visible = value; - control.ShowInTaskbar = value; - control.Opacity = 0; + //control.ShowInTaskbar = value; + //control.Opacity = 0; } } } @@ -522,5 +553,19 @@ namespace RyzStudio.Windows.Forms } } + public static void SetClientWidth(Control control, int value) + { + if (control.InvokeRequired) + { + control.Invoke(new MethodInvoker(() => { + control.ClientSize = new Size(value, control.ClientSize.Height); + })); + } + else + { + control.ClientSize = new Size(value, control.ClientSize.Height); + } + } + } } \ No newline at end of file diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/BorderlessForm.Designer.cs b/RyzStudio/Windows/ThemedForms/BorderlessForm.Designer.cs similarity index 91% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/BorderlessForm.Designer.cs rename to RyzStudio/Windows/ThemedForms/BorderlessForm.Designer.cs index 04e71d5..d39ad3c 100644 --- a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/BorderlessForm.Designer.cs +++ b/RyzStudio/Windows/ThemedForms/BorderlessForm.Designer.cs @@ -1,4 +1,6 @@ -namespace RyzStudio.Windows.ThemedForms +using RyzStudio.Windows.Forms; + +namespace RyzStudio.Windows.ThemedForms { partial class BorderlessForm { @@ -32,10 +34,10 @@ this.label1 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.area1 = new System.Windows.Forms.Panel(); - this.pictureBox4 = new RyzStudio.Windows.Forms.ImageBox(); - this.pictureBox2 = new RyzStudio.Windows.Forms.ImageBox(); - this.pictureBox1 = new RyzStudio.Windows.Forms.ImageBox(); - this.pictureBox3 = new RyzStudio.Windows.Forms.ImageBox(); + this.pictureBox4 = new RyzStudio.Windows.Forms.TImageBox(); + this.pictureBox2 = new RyzStudio.Windows.Forms.TImageBox(); + this.pictureBox1 = new RyzStudio.Windows.Forms.TImageBox(); + this.pictureBox3 = new RyzStudio.Windows.Forms.TImageBox(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); @@ -94,7 +96,7 @@ this.pictureBox4.BackColor = System.Drawing.Color.Transparent; this.pictureBox4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.pictureBox4.ErrorImage = null; - this.pictureBox4.HighlightImage = global::hiim.dply.Properties.Resources.form20_menu2; + this.pictureBox4.ImageHover = global::hiim.dply.Properties.Resources.form20_menu2; this.pictureBox4.Image = global::hiim.dply.Properties.Resources.form20_menu; this.pictureBox4.InitialImage = null; this.pictureBox4.Location = new System.Drawing.Point(460, 11); @@ -111,7 +113,7 @@ this.pictureBox2.BackColor = System.Drawing.Color.Transparent; this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.pictureBox2.ErrorImage = null; - this.pictureBox2.HighlightImage = global::hiim.dply.Properties.Resources.form20_maximise2; + this.pictureBox2.ImageHover = global::hiim.dply.Properties.Resources.form20_maximise2; this.pictureBox2.Image = global::hiim.dply.Properties.Resources.form20_maximise; this.pictureBox2.InitialImage = null; this.pictureBox2.Location = new System.Drawing.Point(528, 11); @@ -128,7 +130,7 @@ this.pictureBox1.BackColor = System.Drawing.Color.Transparent; this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.pictureBox1.ErrorImage = null; - this.pictureBox1.HighlightImage = global::hiim.dply.Properties.Resources.form20_minimise2; + this.pictureBox1.ImageHover = global::hiim.dply.Properties.Resources.form20_minimise2; this.pictureBox1.Image = global::hiim.dply.Properties.Resources.form20_minimise; this.pictureBox1.InitialImage = null; this.pictureBox1.Location = new System.Drawing.Point(494, 11); @@ -145,7 +147,7 @@ this.pictureBox3.BackColor = System.Drawing.Color.Transparent; this.pictureBox3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.pictureBox3.ErrorImage = null; - this.pictureBox3.HighlightImage = global::hiim.dply.Properties.Resources.form20_close2; + this.pictureBox3.ImageHover = global::hiim.dply.Properties.Resources.form20_close2; this.pictureBox3.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image"))); this.pictureBox3.InitialImage = null; this.pictureBox3.Location = new System.Drawing.Point(562, 11); @@ -180,11 +182,11 @@ #endregion - protected internal Forms.ImageBox pictureBox2; - protected internal Forms.ImageBox pictureBox1; - protected internal Forms.ImageBox pictureBox3; + protected internal TImageBox pictureBox2; + protected internal TImageBox pictureBox1; + protected internal TImageBox pictureBox3; protected internal System.Windows.Forms.Label label1; - protected internal Forms.ImageBox pictureBox4; + protected internal TImageBox pictureBox4; protected internal System.Windows.Forms.Panel panel1; protected internal System.Windows.Forms.Panel area1; } diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/BorderlessForm.cs b/RyzStudio/Windows/ThemedForms/BorderlessForm.cs similarity index 99% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/BorderlessForm.cs rename to RyzStudio/Windows/ThemedForms/BorderlessForm.cs index c5e4efe..840d970 100644 --- a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/BorderlessForm.cs +++ b/RyzStudio/Windows/ThemedForms/BorderlessForm.cs @@ -5,7 +5,6 @@ using System.Drawing; using System.Drawing.Design; using System.Windows.Forms; - using Resources = hiim.dply.Properties.Resources; public partial class BorderlessForm : System.Windows.Forms.Form { diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/BorderlessForm.resx b/RyzStudio/Windows/ThemedForms/BorderlessForm.resx similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/BorderlessForm.resx rename to RyzStudio/Windows/ThemedForms/BorderlessForm.resx diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/BorderlessToolForm.Designer.cs b/RyzStudio/Windows/ThemedForms/BorderlessToolForm.Designer.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/BorderlessToolForm.Designer.cs rename to RyzStudio/Windows/ThemedForms/BorderlessToolForm.Designer.cs diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/BorderlessToolForm.cs b/RyzStudio/Windows/ThemedForms/BorderlessToolForm.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/BorderlessToolForm.cs rename to RyzStudio/Windows/ThemedForms/BorderlessToolForm.cs diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/BorderlessToolForm.resx b/RyzStudio/Windows/ThemedForms/BorderlessToolForm.resx similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/BorderlessToolForm.resx rename to RyzStudio/Windows/ThemedForms/BorderlessToolForm.resx diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TPickerBox.cs b/RyzStudio/Windows/ThemedForms/PickerBox/TPickerBox.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TPickerBox.cs rename to RyzStudio/Windows/ThemedForms/PickerBox/TPickerBox.cs diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TPickerBox.designer.cs b/RyzStudio/Windows/ThemedForms/PickerBox/TPickerBox.designer.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TPickerBox.designer.cs rename to RyzStudio/Windows/ThemedForms/PickerBox/TPickerBox.designer.cs diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TPickerBox.resx b/RyzStudio/Windows/ThemedForms/PickerBox/TPickerBox.resx similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TPickerBox.resx rename to RyzStudio/Windows/ThemedForms/PickerBox/TPickerBox.resx diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TYesNoPickerBox.cs b/RyzStudio/Windows/ThemedForms/PickerBox/TYesNoPickerBox.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TYesNoPickerBox.cs rename to RyzStudio/Windows/ThemedForms/PickerBox/TYesNoPickerBox.cs diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TButton.cs b/RyzStudio/Windows/ThemedForms/TButton.cs similarity index 74% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TButton.cs rename to RyzStudio/Windows/ThemedForms/TButton.cs index 7bd7916..b6e4d93 100644 --- a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TButton.cs +++ b/RyzStudio/Windows/ThemedForms/TButton.cs @@ -3,6 +3,7 @@ using System; using System.ComponentModel; using System.Drawing; + using System.Windows.Forms; public partial class TButton : RyzStudio.Windows.ThemedForms.TUserControl { @@ -27,13 +28,34 @@ { InitializeComponent(); + this.Margin = new Padding(10); + + this.StyleDefault = new ButtonStyle() + { + BackColour = Color.White, + PenColour = Color.Black, + ForeImage = this.DefaultImage + }; + this.StyleDown = new ButtonStyle() + { + BackColour = Color.FromArgb(0, 183, 209), + PenColour = Color.Black, + ForeImage = this.DownImage + }; + this.StyleOver = new ButtonStyle() + { + BackColour = Color.FromArgb(108, 101, 196), + PenColour = Color.White, + ForeImage = this.OverImage + }; + this.StyleSelected = new ButtonStyle() + { + BackColour = Color.FromArgb(51, 51, 51), + PenColour = Color.White, + ForeImage = this.OverImage + }; + label1.ImageAlign = ContentAlignment.MiddleCenter; - - this.StyleDefault = new ButtonStyle() { BackColour = Color.White, PenColour = Color.Black, ForeImage = this.DefaultImage }; - this.StyleDown = new ButtonStyle() { BackColour = Color.FromArgb(0, 183, 209), PenColour = Color.Black, ForeImage = this.DownImage }; - this.StyleOver = new ButtonStyle() { BackColour = Color.FromArgb(108, 101, 196), PenColour = Color.White, ForeImage = this.OverImage }; - this.StyleSelected = new ButtonStyle() { BackColour = Color.FromArgb(51, 51, 51), PenColour = Color.White, ForeImage = this.OverImage }; - label1.Click += delegate { this.OnClick(null); }; label1.MouseEnter += delegate { this.VisualState = ButtonState.Hover; }; label1.MouseLeave += delegate { this.VisualState = ButtonState.Idle; }; @@ -48,6 +70,14 @@ this.VisualState = ButtonState.Idle; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new Padding Margin { get => base.Margin; set => base.Margin = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new Padding Padding { get => base.Padding; set => base.Padding = value; } + + protected ButtonState VisualState { get { return controlState; } diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TButton.designer.cs b/RyzStudio/Windows/ThemedForms/TButton.designer.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TButton.designer.cs rename to RyzStudio/Windows/ThemedForms/TButton.designer.cs diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TButtonTextBox.resx b/RyzStudio/Windows/ThemedForms/TButton.resx similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TButtonTextBox.resx rename to RyzStudio/Windows/ThemedForms/TButton.resx diff --git a/RyzStudio/Windows/ThemedForms/TDialogForm.Designer.cs b/RyzStudio/Windows/ThemedForms/TDialogForm.Designer.cs new file mode 100644 index 0000000..0133a0e --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/TDialogForm.Designer.cs @@ -0,0 +1,47 @@ +namespace RyzStudio.Windows.ThemedForms +{ + partial class TDialogForm + { + /// + /// 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 Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // TDialogForm + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(249)))), ((int)(((byte)(250))))); + this.ClientSize = new System.Drawing.Size(340, 600); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.MinimumSize = new System.Drawing.Size(40, 0); + this.Name = "TDialogForm"; + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/RyzStudio/Windows/ThemedForms/TDialogForm.cs b/RyzStudio/Windows/ThemedForms/TDialogForm.cs new file mode 100644 index 0000000..05dc0e4 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/TDialogForm.cs @@ -0,0 +1,117 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace RyzStudio.Windows.ThemedForms +{ + public partial class TDialogForm : Form + { + public TDialogForm() + { + this.InitializeComponent(); + + this.BackColor = Color.FromArgb(254, 254, 254); + this.FormBorderStyle = FormBorderStyle.Sizable; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Padding = new Padding(5, 10, 5, 10); + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = FormStartPosition.CenterParent; + this.TopMost = true; + this.SizeGripStyle = SizeGripStyle.Hide; + this.AutoScaleMode = AutoScaleMode.Font; + } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override Color BackColor { get => base.BackColor; set => base.BackColor = value; } + + [Browsable(false)] + public override Image BackgroundImage { get => base.BackgroundImage; set => base.BackgroundImage = value; } + + [Browsable(false)] + public override ImageLayout BackgroundImageLayout { get => base.BackgroundImageLayout; set => base.BackgroundImageLayout = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new FormBorderStyle FormBorderStyle { get => base.FormBorderStyle; set => base.FormBorderStyle = value; } + + //[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + //public override Size MaximumSize { get => base.MaximumSize; set => base.MaximumSize = value; } + + //[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + //public override Size MinimumSize { get => base.MinimumSize; set => base.MinimumSize = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new Padding Padding { get => base.Padding; set => base.Padding = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new bool ShowIcon { get => base.ShowIcon; set => base.ShowIcon = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new bool ShowInTaskbar { get => base.ShowInTaskbar; set => base.ShowInTaskbar = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new FormStartPosition StartPosition { get => base.StartPosition; set => base.StartPosition = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new bool TopMost { get => base.TopMost; set => base.TopMost = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override Cursor Cursor { get => base.Cursor; set => base.Cursor = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override RightToLeft RightToLeft { get => base.RightToLeft; set => base.RightToLeft = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override bool RightToLeftLayout { get => base.RightToLeftLayout; set => base.RightToLeftLayout = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new bool UseWaitCursor { get => base.UseWaitCursor; set => base.UseWaitCursor = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new ImeMode ImeMode { get => base.ImeMode; set => base.ImeMode = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public override bool AutoSize { get => base.AutoSize; set => base.AutoSize = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new AutoSizeMode AutoSizeMode { get => base.AutoSizeMode; set => base.AutoSizeMode = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new bool MinimizeBox { get => base.MinimizeBox; set => base.MinimizeBox = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new bool MaximizeBox { get => base.MaximizeBox; set => base.MaximizeBox = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new bool ControlBox { get => base.ControlBox; set => base.ControlBox = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new bool HelpButton { get => base.HelpButton; set => base.HelpButton = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new MenuStrip MainMenuStrip { get => base.MainMenuStrip; set => base.MainMenuStrip = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new SizeGripStyle SizeGripStyle { get => base.SizeGripStyle; set => base.SizeGripStyle = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new AutoScaleMode AutoScaleMode { get => base.AutoScaleMode; set => base.AutoScaleMode = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new bool AutoScroll { get => base.AutoScroll; set => base.AutoScroll = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new Size AutoScrollMargin { get => base.AutoScrollMargin; set => base.AutoScrollMargin = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new Size AutoScrollMinSize { get => base.AutoScrollMinSize; set => base.AutoScrollMinSize = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new Point AutoScrollOffset { get => base.AutoScrollOffset; set => base.AutoScrollOffset = value; } + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new FormWindowState WindowState { get => base.WindowState; set => base.WindowState = value; } + + } +} \ No newline at end of file diff --git a/RyzStudio/Windows/ThemedForms/TDialogForm.resx b/RyzStudio/Windows/ThemedForms/TDialogForm.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/TDialogForm.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TListBox.cs b/RyzStudio/Windows/ThemedForms/TListBox.cs similarity index 96% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TListBox.cs rename to RyzStudio/Windows/ThemedForms/TListBox.cs index ed785eb..2ddc41b 100644 --- a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TListBox.cs +++ b/RyzStudio/Windows/ThemedForms/TListBox.cs @@ -1,11 +1,12 @@ -namespace RyzStudio.Windows.ThemedForms -{ - using RyzStudio.Drawing; - using System; - using System.ComponentModel; - using System.Drawing; - using System.Windows.Forms; +using RyzStudio.Drawing; +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using UIResource = FizzyLauncher.UIResource; +namespace RyzStudio.Windows.ThemedForms +{ public partial class TListBox : RyzStudio.Windows.ThemedForms.TUserControl { protected readonly Padding textboxPadding = new Padding(6, 2, 4, 2); diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TListBox.designer.cs b/RyzStudio/Windows/ThemedForms/TListBox.designer.cs similarity index 87% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TListBox.designer.cs rename to RyzStudio/Windows/ThemedForms/TListBox.designer.cs index 81bff0f..469e7b0 100644 --- a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TListBox.designer.cs +++ b/RyzStudio/Windows/ThemedForms/TListBox.designer.cs @@ -60,12 +60,12 @@ this.imageBox5.BackColor = System.Drawing.Color.Transparent; this.imageBox5.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.imageBox5.ErrorImage = null; - this.imageBox5.ImageHover = global::AppLauncher.Properties.Resources16.edit2; - this.imageBox5.Image = global::AppLauncher.Properties.Resources16.edit; + this.imageBox5.ImageHover = global::FizzyLauncher.UIResource.edit2; + this.imageBox5.Image = global::FizzyLauncher.UIResource.edit; this.imageBox5.InitialImage = null; this.imageBox5.Location = new System.Drawing.Point(52, 94); this.imageBox5.Name = "imageBox5"; - this.imageBox5.ImageNormal = global::AppLauncher.Properties.Resources16.edit; + this.imageBox5.ImageNormal = global::FizzyLauncher.UIResource.edit; this.imageBox5.Size = new System.Drawing.Size(18, 25); this.imageBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; this.imageBox5.TabIndex = 6; @@ -79,12 +79,12 @@ this.imageBox4.BackColor = System.Drawing.Color.Transparent; this.imageBox4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.imageBox4.ErrorImage = null; - this.imageBox4.ImageHover = global::AppLauncher.Properties.Resources16.arrow_down2; - this.imageBox4.Image = global::AppLauncher.Properties.Resources16.arrow_down; + this.imageBox4.ImageHover = global::FizzyLauncher.UIResource.arrow_down2; + this.imageBox4.Image = global::FizzyLauncher.UIResource.arrow_down; this.imageBox4.InitialImage = null; this.imageBox4.Location = new System.Drawing.Point(100, 94); this.imageBox4.Name = "imageBox4"; - this.imageBox4.ImageNormal = global::AppLauncher.Properties.Resources16.arrow_down; + this.imageBox4.ImageNormal = global::FizzyLauncher.UIResource.arrow_down; this.imageBox4.Size = new System.Drawing.Size(18, 25); this.imageBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; this.imageBox4.TabIndex = 5; @@ -98,12 +98,12 @@ this.imageBox3.BackColor = System.Drawing.Color.Transparent; this.imageBox3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.imageBox3.ErrorImage = null; - this.imageBox3.ImageHover = global::AppLauncher.Properties.Resources16.arrow_up2; - this.imageBox3.Image = global::AppLauncher.Properties.Resources16.arrow_up; + this.imageBox3.ImageHover = global::FizzyLauncher.UIResource.arrow_up2; + this.imageBox3.Image = global::FizzyLauncher.UIResource.arrow_up; this.imageBox3.InitialImage = null; this.imageBox3.Location = new System.Drawing.Point(76, 94); this.imageBox3.Name = "imageBox3"; - this.imageBox3.ImageNormal = global::AppLauncher.Properties.Resources16.arrow_up; + this.imageBox3.ImageNormal = global::FizzyLauncher.UIResource.arrow_up; this.imageBox3.Size = new System.Drawing.Size(18, 25); this.imageBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; this.imageBox3.TabIndex = 4; @@ -117,12 +117,12 @@ this.imageBox2.BackColor = System.Drawing.Color.Transparent; this.imageBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.imageBox2.ErrorImage = null; - this.imageBox2.ImageHover = global::AppLauncher.Properties.Resources16.minus2; - this.imageBox2.Image = global::AppLauncher.Properties.Resources16.minus; + this.imageBox2.ImageHover = global::FizzyLauncher.UIResource.minus2; + this.imageBox2.Image = global::FizzyLauncher.UIResource.minus; this.imageBox2.InitialImage = null; this.imageBox2.Location = new System.Drawing.Point(28, 94); this.imageBox2.Name = "imageBox2"; - this.imageBox2.ImageNormal = global::AppLauncher.Properties.Resources16.minus; + this.imageBox2.ImageNormal = global::FizzyLauncher.UIResource.minus; this.imageBox2.Size = new System.Drawing.Size(18, 25); this.imageBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; this.imageBox2.TabIndex = 3; @@ -136,12 +136,12 @@ this.imageBox1.BackColor = System.Drawing.Color.Transparent; this.imageBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.imageBox1.ErrorImage = null; - this.imageBox1.ImageHover = global::AppLauncher.Properties.Resources16.plus2; - this.imageBox1.Image = global::AppLauncher.Properties.Resources16.plus; + this.imageBox1.ImageHover = global::FizzyLauncher.UIResource.plus2; + this.imageBox1.Image = global::FizzyLauncher.UIResource.plus; this.imageBox1.InitialImage = null; this.imageBox1.Location = new System.Drawing.Point(4, 94); this.imageBox1.Name = "imageBox1"; - this.imageBox1.ImageNormal = global::AppLauncher.Properties.Resources16.plus; + this.imageBox1.ImageNormal = global::FizzyLauncher.UIResource.plus; this.imageBox1.Size = new System.Drawing.Size(18, 25); this.imageBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; this.imageBox1.TabIndex = 2; diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TListBox.resx b/RyzStudio/Windows/ThemedForms/TListBox.resx similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TListBox.resx rename to RyzStudio/Windows/ThemedForms/TListBox.resx diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TUserControl.cs b/RyzStudio/Windows/ThemedForms/TUserControl.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TUserControl.cs rename to RyzStudio/Windows/ThemedForms/TUserControl.cs diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TUserControl.designer.cs b/RyzStudio/Windows/ThemedForms/TUserControl.designer.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TUserControl.designer.cs rename to RyzStudio/Windows/ThemedForms/TUserControl.designer.cs diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TButtonTextBox.cs b/RyzStudio/Windows/ThemedForms/TextBox/TButtonTextBox.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TButtonTextBox.cs rename to RyzStudio/Windows/ThemedForms/TextBox/TButtonTextBox.cs diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TButtonTextBox.designer.cs b/RyzStudio/Windows/ThemedForms/TextBox/TButtonTextBox.designer.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TButtonTextBox.designer.cs rename to RyzStudio/Windows/ThemedForms/TextBox/TButtonTextBox.designer.cs diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TTextBox.resx b/RyzStudio/Windows/ThemedForms/TextBox/TButtonTextBox.resx similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TTextBox.resx rename to RyzStudio/Windows/ThemedForms/TextBox/TButtonTextBox.resx diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TDialogForm.resx b/RyzStudio/Windows/ThemedForms/TextBox/TFolderTextBox - Copy.resx similarity index 94% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TDialogForm.resx rename to RyzStudio/Windows/ThemedForms/TextBox/TFolderTextBox - Copy.resx index 6e0c1de..1af7de1 100644 --- a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TDialogForm.resx +++ b/RyzStudio/Windows/ThemedForms/TextBox/TFolderTextBox - Copy.resx @@ -117,10 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True - - - True - \ No newline at end of file diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TFolderTextBox.cs b/RyzStudio/Windows/ThemedForms/TextBox/TFolderTextBox.cs similarity index 87% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TFolderTextBox.cs rename to RyzStudio/Windows/ThemedForms/TextBox/TFolderTextBox.cs index 0c2b9ae..341b480 100644 --- a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TFolderTextBox.cs +++ b/RyzStudio/Windows/ThemedForms/TextBox/TFolderTextBox.cs @@ -1,7 +1,7 @@ using System; using System.IO; using System.Windows.Forms; -using Resources = AppLauncher.Properties.Resources16; +using UIResources = FizzyLauncher.UIResource; namespace RyzStudio.Windows.ThemedForms { @@ -9,8 +9,8 @@ namespace RyzStudio.Windows.ThemedForms { public TFolderTextBox() : base() { - this.NormalImage = Resources.folder; - this.HighlightImage = Resources.folder2; + this.NormalImage = UIResources.folder; + this.HighlightImage = UIResources.folder2; this.Text = string.Empty; } diff --git a/Windows/Forms/Tile/TTilePanel.resx b/RyzStudio/Windows/ThemedForms/TextBox/TFolderTextBox.resx similarity index 93% rename from Windows/Forms/Tile/TTilePanel.resx rename to RyzStudio/Windows/ThemedForms/TextBox/TFolderTextBox.resx index 955aa4f..1af7de1 100644 --- a/Windows/Forms/Tile/TTilePanel.resx +++ b/RyzStudio/Windows/ThemedForms/TextBox/TFolderTextBox.resx @@ -117,10 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - - - 172, 17 - \ No newline at end of file diff --git a/RyzStudio/Windows/ThemedForms/TextBox/TKeyCodeTextBox.cs b/RyzStudio/Windows/ThemedForms/TextBox/TKeyCodeTextBox.cs new file mode 100644 index 0000000..08e9f2f --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/TextBox/TKeyCodeTextBox.cs @@ -0,0 +1,92 @@ +using System; +using System.Text; +using System.Windows.Forms; +using UIResources = FizzyLauncher.UIResource; + +namespace RyzStudio.Windows.ThemedForms +{ + public class TKeyCodeTextBox : TButtonTextBox + { + public class Results + { + public bool IsCtrl { get; set; } = false; + public bool IsAlt { get; set; } = false; + public bool IsShift { get; set; } = false; + public Keys Key { get; set; } = Keys.None; + + public int ModifierCode => ((this.IsAlt ? 1 : 0) + (this.IsCtrl ? 2 : 0) + (this.IsShift ? 4 : 0)); + + public int KeyCode => (int)this.Key; + + public string DisplayText + { + get + { + StringBuilder sb = new StringBuilder(); + + if (this.IsCtrl) sb.Append("Ctrl+"); + if (this.IsShift) sb.Append("Shift+"); + if (this.IsAlt) sb.Append("Alt+"); + + sb.Append(this.Key.ToString()); + + return sb.ToString(); + } + } + + public void Clear() + { + this.IsCtrl = false; + this.IsAlt = false; + this.IsShift = false; + this.Key = Keys.None; + } + } + + + public Results KeyCodeResults { get; set; } = new Results(); + + + public TKeyCodeTextBox() : base() + { + this.NormalImage = UIResources.trash; + this.HighlightImage = UIResources.trash2; + this.Text = string.Empty; + + this.InnerTextBox.ReadOnly = true; + this.InnerTextBox.PreviewKeyDown += textBox1_PreviewKeyDown; + } + + private void textBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) + { + if (e.KeyCode == Keys.ControlKey) return; + if (e.KeyCode == Keys.ShiftKey) return; + if (e.KeyCode == Keys.Menu) return; + + this.KeyCodeResults.IsCtrl = e.Control; + this.KeyCodeResults.IsAlt = e.Alt; + this.KeyCodeResults.IsShift = e.Shift; + this.KeyCodeResults.Key = e.KeyCode; + + this.Text = this.KeyCodeResults.DisplayText; + } + + protected override void imageBox1_Click(object sender, EventArgs e) + { + this.KeyCodeResults.Clear(); + + this.Text = this.KeyCodeResults.DisplayText; + } + + public void UpdateKeyCode(bool isCtrl, bool isAlt, bool isShift, Keys key) + { + this.KeyCodeResults.IsCtrl = isCtrl; + this.KeyCodeResults.IsAlt = isAlt; + this.KeyCodeResults.IsShift = isShift; + this.KeyCodeResults.Key = key; + + this.Text = this.KeyCodeResults.DisplayText; + } + + } +} diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TOpenFileTextBox.cs b/RyzStudio/Windows/ThemedForms/TextBox/TOpenFileTextBox.cs similarity index 87% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TOpenFileTextBox.cs rename to RyzStudio/Windows/ThemedForms/TextBox/TOpenFileTextBox.cs index 16a0d11..0fb3daa 100644 --- a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TOpenFileTextBox.cs +++ b/RyzStudio/Windows/ThemedForms/TextBox/TOpenFileTextBox.cs @@ -1,7 +1,7 @@ using System; using System.IO; using System.Windows.Forms; -using Resources = AppLauncher.Properties.Resources16; +using UIResources = FizzyLauncher.UIResource; namespace RyzStudio.Windows.ThemedForms { @@ -9,8 +9,8 @@ namespace RyzStudio.Windows.ThemedForms { public TOpenFileTextBox() : base() { - this.NormalImage = Resources.file; - this.HighlightImage = Resources.file2; + this.NormalImage = UIResources.file; + this.HighlightImage = UIResources.file2; this.Text = string.Empty; } diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TTextBox.cs b/RyzStudio/Windows/ThemedForms/TextBox/TTextBox.cs similarity index 94% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TTextBox.cs rename to RyzStudio/Windows/ThemedForms/TextBox/TTextBox.cs index 48a68d8..be72ccd 100644 --- a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TTextBox.cs +++ b/RyzStudio/Windows/ThemedForms/TextBox/TTextBox.cs @@ -1,15 +1,16 @@ -namespace RyzStudio.Windows.ThemedForms -{ - using RyzStudio.Drawing; - using System; - using System.ComponentModel; - using System.Drawing; - using System.Windows.Forms; +using RyzStudio.Drawing; +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +namespace RyzStudio.Windows.ThemedForms +{ public partial class TTextBox : RyzStudio.Windows.ThemedForms.TUserControl { protected readonly Padding textboxPadding = new Padding(6, 6, 6, 6); + public TTextBox() : base() { InitializeComponent(); @@ -28,6 +29,8 @@ int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding; this.Height = textBox1.Height + (b + textboxPadding.Top) + ((b - 1) + textboxPadding.Bottom); + + this.Invalidate(); } protected override void OnGotFocus(EventArgs e) @@ -92,5 +95,6 @@ g.FillPath(new SolidBrush(style.BackColour), area.ToGraphicsPath()); g.DrawPath(new Pen(new SolidBrush(style.BorderColour), style.BorderWidth), area.ToGraphicsPath()); } + } } \ No newline at end of file diff --git a/FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TTextBox.designer.cs b/RyzStudio/Windows/ThemedForms/TextBox/TTextBox.designer.cs similarity index 100% rename from FizzyLauncher.UI/RyzStudio/Windows/ThemedForms/TTextBox.designer.cs rename to RyzStudio/Windows/ThemedForms/TextBox/TTextBox.designer.cs diff --git a/Windows/Forms/OptionsForm.resx b/RyzStudio/Windows/ThemedForms/TextBox/TTextBox.resx similarity index 87% rename from Windows/Forms/OptionsForm.resx rename to RyzStudio/Windows/ThemedForms/TextBox/TTextBox.resx index 3747e00..1af7de1 100644 --- a/Windows/Forms/OptionsForm.resx +++ b/RyzStudio/Windows/ThemedForms/TextBox/TTextBox.resx @@ -117,15 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS4xYyqcSwAAANlJREFUOE+lU1sO - gjAQrHgRY6KemQ+VT9NrgAfgfRA+SawzdTAk2lhkkgm7s7vTAq0py/LUNM0dHEEXSfYWfd8fDQIOD23b - nvFMY6jeAcxpMFIwC1HX9YWzNOCWUunR4AxnvxpUVbV3zm2UGsbUlHoEDfBhdsgf4BWDCcmYGmtqCxtw - NeQcoJ6JjGn43hXy8CvIxDeIGbREZY+pHjLgtqeVHf7SzVq7VdmDM6x9GGj1/19h9UckVv3GWMwNRh5L - 6dGYH+UCHCTQ9SfV+7pMvJIIaLL0Oudd1x2eUQ8MyeAeq0cAAAAASUVORK5CYII= - - \ No newline at end of file diff --git a/Text/Json/JsonPointConverter.cs b/Text/Json/JsonPointConverter.cs new file mode 100644 index 0000000..e787cdc --- /dev/null +++ b/Text/Json/JsonPointConverter.cs @@ -0,0 +1,40 @@ +using System; +using System.Drawing; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace FizzyLauncher.Text.Json +{ + public class JsonPointConverter : JsonConverter + { + public override Point Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + Point rs = new Point(0, 0); + + if (reader.TokenType == JsonTokenType.String) + { + string[] parts = reader.GetString().Split(','); + if (parts.Length != 2) + { + return rs; + } + + int x = 0; + int y = 0; + + if (!int.TryParse(parts[0].Trim(), out x)) x = 0; + if (!int.TryParse(parts[1].Trim(), out y)) y = 0; + + return new Point(x, y); + } + + return rs; + } + + public override void Write(Utf8JsonWriter writer, Point value, JsonSerializerOptions options) + { + writer.WriteStringValue(string.Format("{0}, {1}", value.X.ToString(), value.Y.ToString())); + } + + } +} diff --git a/Text/Json/JsonSizeConverter.cs b/Text/Json/JsonSizeConverter.cs new file mode 100644 index 0000000..eb763fa --- /dev/null +++ b/Text/Json/JsonSizeConverter.cs @@ -0,0 +1,40 @@ +using System; +using System.Drawing; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace FizzyLauncher.Text.Json +{ + public class JsonSizeConverter : JsonConverter + { + public override Size Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + Size rs = new Size(0, 0); + + if (reader.TokenType == JsonTokenType.String) + { + string[] parts = reader.GetString().Split(','); + if (parts.Length != 2) + { + return rs; + } + + int w = 0; + int h = 0; + + if (!int.TryParse(parts[0].Trim(), out w)) w = 0; + if (!int.TryParse(parts[1].Trim(), out h)) h = 0; + + return new Size(w, h); + } + + return rs; + } + + public override void Write(Utf8JsonWriter writer, Size value, JsonSerializerOptions options) + { + writer.WriteStringValue(string.Format("{0}, {1}", value.Width.ToString(), value.Height.ToString())); + } + + } +} diff --git a/FizzyLauncher.UI/Properties/Resources16.Designer.cs b/UIResource.Designer.cs similarity index 73% rename from FizzyLauncher.UI/Properties/Resources16.Designer.cs rename to UIResource.Designer.cs index a48b080..90f6194 100644 --- a/FizzyLauncher.UI/Properties/Resources16.Designer.cs +++ b/UIResource.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace AppLauncher.Properties { +namespace FizzyLauncher { using System; @@ -22,14 +22,14 @@ namespace AppLauncher.Properties { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources16 { + internal class UIResource { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources16() { + internal UIResource() { } /// @@ -39,7 +39,7 @@ namespace AppLauncher.Properties { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AppLauncher.Properties.Resources16", typeof(Resources16).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FizzyLauncher.UIResource", typeof(UIResource).Assembly); resourceMan = temp; } return resourceMan; @@ -120,6 +120,46 @@ namespace AppLauncher.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap cog { + get { + object obj = ResourceManager.GetObject("cog", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap cog2 { + get { + object obj = ResourceManager.GetObject("cog2", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap disk { + get { + object obj = ResourceManager.GetObject("disk", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap disk2 { + get { + object obj = ResourceManager.GetObject("disk2", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -180,6 +220,26 @@ namespace AppLauncher.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap help { + get { + object obj = ResourceManager.GetObject("help", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap help2 { + get { + object obj = ResourceManager.GetObject("help2", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -219,5 +279,25 @@ namespace AppLauncher.Properties { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap trash { + get { + object obj = ResourceManager.GetObject("trash", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap trash2 { + get { + object obj = ResourceManager.GetObject("trash2", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/FizzyLauncher.UI/Properties/Resources16.resx b/UIResource.resx similarity index 65% rename from FizzyLauncher.UI/Properties/Resources16.resx rename to UIResource.resx index 78ba89b..03adecf 100644 --- a/FizzyLauncher.UI/Properties/Resources16.resx +++ b/UIResource.resx @@ -112,58 +112,82 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + - ..\Resources\16\arrow_down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\arrow_down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\16\arrow_down2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\arrow_down2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\16\arrow_up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\arrow_up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\16\arrow_up2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\arrow_up2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\16\close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\16\close2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\close2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\UI\cog.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\UI\cog2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\UI\disk.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\UI\disk2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\16\edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\16\edit2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\edit2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\16\file.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\file.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\16\file2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\file2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\16\folder.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\folder.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\16\folder2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\folder2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\UI\help.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\UI\help2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\16\minus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\minus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\16\minus2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\minus2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\16\plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\16\plus2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Resources\UI\plus2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\UI\trash.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\UI\trash2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/Windows/Forms/Tile/EditGroupForm.cs b/Windows/Forms/EditGroupForm.cs similarity index 63% rename from Windows/Forms/Tile/EditGroupForm.cs rename to Windows/Forms/EditGroupForm.cs index 0929250..c3108d9 100644 --- a/Windows/Forms/Tile/EditGroupForm.cs +++ b/Windows/Forms/EditGroupForm.cs @@ -1,18 +1,19 @@ -using AppLauncher.Models; +using FizzyLauncher.Models; using RyzStudio.Windows.ThemedForms; using System; -namespace AppLauncher.Windows.Forms +namespace FizzyLauncher.Windows.Forms { public class EditGroupForm : TDialogForm { - public static void ShowDialog(TTilePanelLayout control) + public static void ShowDialog(TilePanelLayout control) { EditGroupForm form = new EditGroupForm(); form.TilePanelLayout = control; form.ShowDialog(); } + private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label1; private TButton button1; @@ -20,7 +21,6 @@ namespace AppLauncher.Windows.Forms private RyzStudio.Windows.Forms.THorizontalSeparator horizontalSeparator2; private TTextBox textBox1; - public TTilePanelLayout TilePanelLayout { get; set; } = null; public EditGroupForm() : base() { @@ -33,131 +33,117 @@ namespace AppLauncher.Windows.Forms private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditGroupForm)); this.textBox1 = new RyzStudio.Windows.ThemedForms.TTextBox(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.button1 = new RyzStudio.Windows.ThemedForms.TButton(); this.pickerBox1 = new RyzStudio.Windows.ThemedForms.TPickerBox(); this.horizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - ((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit(); this.SuspendLayout(); - // - // imgbxClose - // - this.imgbxClose.Image = ((System.Drawing.Image)(resources.GetObject("imgbxClose.Image"))); - this.imgbxClose.Location = new System.Drawing.Point(367, 5); - // - // panel1 - // - this.panel1.Location = new System.Drawing.Point(394, 474); - // - // area1 - // - this.area1.Location = new System.Drawing.Point(1, 474); - this.area1.Size = new System.Drawing.Size(392, 5); - // + // // textBox1 - // - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox1.BackColor = System.Drawing.Color.Transparent; - this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.textBox1.Location = new System.Drawing.Point(159, 50); + this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.textBox1.Location = new System.Drawing.Point(192, 20); this.textBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); this.textBox1.Name = "textBox1"; this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); - this.textBox1.Size = new System.Drawing.Size(220, 32); + this.textBox1.Size = new System.Drawing.Size(177, 35); this.textBox1.SubmitButton = null; this.textBox1.TabIndex = 152; this.textBox1.UseSystemPasswordChar = false; - // + // // label2 - // + // + this.label2.AutoSize = true; this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label2.Location = new System.Drawing.Point(18, 91); + this.label2.ForeColor = System.Drawing.SystemColors.ControlText; + this.label2.Location = new System.Drawing.Point(10, 62); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(131, 32); + this.label2.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); + this.label2.Size = new System.Drawing.Size(119, 34); this.label2.TabIndex = 155; this.label2.Text = "Show Only Expanded"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // label1 - // + // + this.label1.AutoSize = true; this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label1.Location = new System.Drawing.Point(18, 50); + this.label1.ForeColor = System.Drawing.SystemColors.ControlText; + this.label1.Location = new System.Drawing.Point(10, 21); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(131, 32); + this.label1.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); + this.label1.Size = new System.Drawing.Size(29, 34); this.label1.TabIndex = 153; this.label1.Text = "Title"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // button1 - // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.button1.BackColor = System.Drawing.Color.Transparent; this.button1.DefaultImage = null; this.button1.DownImage = null; this.button1.IsSelected = false; - this.button1.LabelText = "&Save"; - this.button1.Location = new System.Drawing.Point(251, 427); + this.button1.LabelText = "&OK"; + this.button1.Location = new System.Drawing.Point(241, 469); + this.button1.Margin = new System.Windows.Forms.Padding(10); this.button1.Name = "button1"; this.button1.OverImage = null; this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); this.button1.Size = new System.Drawing.Size(128, 32); this.button1.TabIndex = 173; this.button1.Click += new System.EventHandler(this.button1_Click); - // + // // pickerBox1 - // - this.pickerBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + // + this.pickerBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.pickerBox1.BackColor = System.Drawing.Color.Transparent; - this.pickerBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.pickerBox1.Location = new System.Drawing.Point(239, 91); + this.pickerBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.pickerBox1.Location = new System.Drawing.Point(285, 62); this.pickerBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); this.pickerBox1.Name = "pickerBox1"; this.pickerBox1.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.pickerBox1.Size = new System.Drawing.Size(140, 32); + this.pickerBox1.Size = new System.Drawing.Size(84, 34); this.pickerBox1.SubmitButton = null; this.pickerBox1.TabIndex = 174; - // + // // horizontalSeparator2 - // - this.horizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.horizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.horizontalSeparator2.Location = new System.Drawing.Point(10, 133); + this.horizontalSeparator2.AutoScrollMargin = new System.Drawing.Size(0, 0); + this.horizontalSeparator2.AutoScrollMinSize = new System.Drawing.Size(0, 0); + this.horizontalSeparator2.BackColor = System.Drawing.Color.Transparent; + this.horizontalSeparator2.Location = new System.Drawing.Point(10, 437); + this.horizontalSeparator2.Margin = new System.Windows.Forms.Padding(10, 0, 10, 0); this.horizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2); + this.horizontalSeparator2.MinimumSize = new System.Drawing.Size(0, 22); this.horizontalSeparator2.Name = "horizontalSeparator2"; - this.horizontalSeparator2.Size = new System.Drawing.Size(380, 2); + this.horizontalSeparator2.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); + this.horizontalSeparator2.Size = new System.Drawing.Size(364, 22); this.horizontalSeparator2.TabIndex = 182; - // + // // EditGroupForm - // - this.ClientSize = new System.Drawing.Size(400, 480); + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.ClientSize = new System.Drawing.Size(384, 521); this.Controls.Add(this.horizontalSeparator2); this.Controls.Add(this.pickerBox1); this.Controls.Add(this.button1); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Controls.Add(this.textBox1); + this.MinimumSize = new System.Drawing.Size(400, 560); this.Name = "EditGroupForm"; this.Text = "Edit Group"; - this.Title = "Edit Group"; - this.Controls.SetChildIndex(this.imgbxClose, 0); - this.Controls.SetChildIndex(this.panel1, 0); - this.Controls.SetChildIndex(this.area1, 0); - this.Controls.SetChildIndex(this.textBox1, 0); - this.Controls.SetChildIndex(this.label1, 0); - this.Controls.SetChildIndex(this.label2, 0); - this.Controls.SetChildIndex(this.button1, 0); - this.Controls.SetChildIndex(this.pickerBox1, 0); - this.Controls.SetChildIndex(this.horizontalSeparator2, 0); - ((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).EndInit(); this.ResumeLayout(false); + this.PerformLayout(); } @@ -172,6 +158,10 @@ namespace AppLauncher.Windows.Forms } } + + public TilePanelLayout TilePanelLayout { get; set; } = null; + + private void button1_Click(object sender, EventArgs e) { TileGroupModel model = this.TilePanelLayout.Model; diff --git a/Windows/Forms/EditGroupForm.resx b/Windows/Forms/EditGroupForm.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/Windows/Forms/EditGroupForm.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 diff --git a/Windows/Forms/Tile/AddListTileForm.cs b/Windows/Forms/EditTileFolderForm.cs similarity index 57% rename from Windows/Forms/Tile/AddListTileForm.cs rename to Windows/Forms/EditTileFolderForm.cs index 2229333..a16b75e 100644 --- a/Windows/Forms/Tile/AddListTileForm.cs +++ b/Windows/Forms/EditTileFolderForm.cs @@ -1,4 +1,4 @@ -using AppLauncher.Models; +using FizzyLauncher.Models; using RyzStudio.Windows.ThemedForms; using System; using System.Diagnostics; @@ -7,18 +7,26 @@ using System.IO; using System.Linq; using System.Windows.Forms; -namespace AppLauncher.Windows.Forms +namespace FizzyLauncher.Windows.Forms { - public class AddListTileForm : TDialogForm + public class EditTileFolderForm : TDialogForm { - public static void ShowDialog(TTilePanelLayout control, Point coord) + public static void ShowAddDialog(TilePanelLayout control, Point coord) { - AddListTileForm form = new AddListTileForm(); + EditTileFolderForm form = new EditTileFolderForm(DialogModeType.Add); form.TilePanelLayout = control; form.AimCoord = coord; form.ShowDialog(); } + public static void ShowEditDialog(TilePanel control) + { + EditTileFolderForm form = new EditTileFolderForm(DialogModeType.Edit); + form.TilePanel = control; + form.ShowDialog(); + } + + private System.Windows.Forms.Label label1; private TButton button1; private RyzStudio.Windows.Forms.THorizontalSeparator horizontalSeparator2; @@ -27,17 +35,26 @@ namespace AppLauncher.Windows.Forms private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1; private System.Windows.Forms.Label label2; - public TTilePanelLayout TilePanelLayout { get; set; } = null; - public Point AimCoord { get; set; } = new Point(-1, -1); - public AddListTileForm() : base() + public enum DialogModeType + { + Add = 0, + Edit + } + + + protected DialogModeType dialogMode = DialogModeType.Add; + + + public EditTileFolderForm(DialogModeType dialogMode) : base() { InitializeComponent(); + + this.DialogMode = dialogMode; } private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddListTileForm)); this.textBox1 = new RyzStudio.Windows.ThemedForms.TTextBox(); this.label1 = new System.Windows.Forms.Label(); this.button1 = new RyzStudio.Windows.ThemedForms.TButton(); @@ -45,59 +62,47 @@ namespace AppLauncher.Windows.Forms this.listBox1 = new RyzStudio.Windows.ThemedForms.TListBox(); this.label2 = new System.Windows.Forms.Label(); this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - ((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit(); this.SuspendLayout(); // - // imgbxClose - // - this.imgbxClose.Image = ((System.Drawing.Image)(resources.GetObject("imgbxClose.Image"))); - this.imgbxClose.Location = new System.Drawing.Point(367, 5); - // - // panel1 - // - this.panel1.Location = new System.Drawing.Point(394, 474); - // - // area1 - // - this.area1.Location = new System.Drawing.Point(1, 474); - this.area1.Size = new System.Drawing.Size(392, 5); - // // textBox1 // this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox1.BackColor = System.Drawing.Color.Transparent; - this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.textBox1.Location = new System.Drawing.Point(159, 50); + this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.textBox1.Location = new System.Drawing.Point(192, 20); this.textBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); this.textBox1.Name = "textBox1"; this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); - this.textBox1.Size = new System.Drawing.Size(220, 32); + this.textBox1.Size = new System.Drawing.Size(177, 35); this.textBox1.SubmitButton = null; this.textBox1.TabIndex = 152; this.textBox1.UseSystemPasswordChar = false; // // label1 // + this.label1.AutoSize = true; this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label1.Location = new System.Drawing.Point(18, 50); + this.label1.ForeColor = System.Drawing.SystemColors.ControlText; + this.label1.Location = new System.Drawing.Point(10, 21); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(131, 32); + this.label1.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); + this.label1.Size = new System.Drawing.Size(29, 34); this.label1.TabIndex = 153; this.label1.Text = "Title"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // button1 // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.button1.BackColor = System.Drawing.Color.Transparent; this.button1.DefaultImage = null; this.button1.DownImage = null; this.button1.IsSelected = false; - this.button1.LabelText = "&Save"; - this.button1.Location = new System.Drawing.Point(251, 427); + this.button1.LabelText = "&OK"; + this.button1.Location = new System.Drawing.Point(241, 469); + this.button1.Margin = new System.Windows.Forms.Padding(10); this.button1.Name = "button1"; this.button1.OverImage = null; this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); @@ -109,10 +114,16 @@ namespace AppLauncher.Windows.Forms // this.horizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.horizontalSeparator2.Location = new System.Drawing.Point(10, 92); + this.horizontalSeparator2.AutoScrollMargin = new System.Drawing.Size(0, 0); + this.horizontalSeparator2.AutoScrollMinSize = new System.Drawing.Size(0, 0); + this.horizontalSeparator2.BackColor = System.Drawing.Color.Transparent; + this.horizontalSeparator2.Location = new System.Drawing.Point(10, 61); + this.horizontalSeparator2.Margin = new System.Windows.Forms.Padding(10, 0, 10, 0); this.horizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2); + this.horizontalSeparator2.MinimumSize = new System.Drawing.Size(0, 22); this.horizontalSeparator2.Name = "horizontalSeparator2"; - this.horizontalSeparator2.Size = new System.Drawing.Size(380, 2); + this.horizontalSeparator2.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); + this.horizontalSeparator2.Size = new System.Drawing.Size(364, 22); this.horizontalSeparator2.TabIndex = 177; // // listBox1 @@ -122,12 +133,12 @@ namespace AppLauncher.Windows.Forms | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.listBox1.BackColor = System.Drawing.Color.Transparent; - this.listBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.listBox1.Location = new System.Drawing.Point(159, 101); + this.listBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.listBox1.Location = new System.Drawing.Point(109, 87); this.listBox1.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); this.listBox1.Name = "listBox1"; this.listBox1.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.listBox1.Size = new System.Drawing.Size(220, 280); + this.listBox1.Size = new System.Drawing.Size(260, 346); this.listBox1.SubmitButton = null; this.listBox1.TabIndex = 180; this.listBox1.OnAdd += new System.EventHandler(this.listBox1_OnAdd); @@ -137,28 +148,37 @@ namespace AppLauncher.Windows.Forms // // label2 // + this.label2.AutoSize = true; this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label2.Location = new System.Drawing.Point(18, 104); + this.label2.ForeColor = System.Drawing.SystemColors.ControlText; + this.label2.Location = new System.Drawing.Point(8, 87); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(131, 32); + this.label2.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); + this.label2.Size = new System.Drawing.Size(25, 34); this.label2.TabIndex = 181; this.label2.Text = "List"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // tHorizontalSeparator1 // - this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.tHorizontalSeparator1.Location = new System.Drawing.Point(10, 391); + this.tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0); + this.tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0); + this.tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent; + this.tHorizontalSeparator1.Location = new System.Drawing.Point(10, 437); + this.tHorizontalSeparator1.Margin = new System.Windows.Forms.Padding(10, 0, 10, 0); this.tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); + this.tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22); this.tHorizontalSeparator1.Name = "tHorizontalSeparator1"; - this.tHorizontalSeparator1.Size = new System.Drawing.Size(380, 2); + this.tHorizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); + this.tHorizontalSeparator1.Size = new System.Drawing.Size(364, 22); this.tHorizontalSeparator1.TabIndex = 182; // - // AddListTileForm + // AddTileFolderForm // - this.ClientSize = new System.Drawing.Size(400, 480); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.ClientSize = new System.Drawing.Size(384, 521); this.Controls.Add(this.tHorizontalSeparator1); this.Controls.Add(this.label2); this.Controls.Add(this.listBox1); @@ -166,23 +186,70 @@ namespace AppLauncher.Windows.Forms this.Controls.Add(this.button1); this.Controls.Add(this.label1); this.Controls.Add(this.textBox1); - this.Name = "AddListTileForm"; - this.Title = "Add List Tile"; - this.Controls.SetChildIndex(this.imgbxClose, 0); - this.Controls.SetChildIndex(this.panel1, 0); - this.Controls.SetChildIndex(this.area1, 0); - this.Controls.SetChildIndex(this.textBox1, 0); - this.Controls.SetChildIndex(this.label1, 0); - this.Controls.SetChildIndex(this.button1, 0); - this.Controls.SetChildIndex(this.horizontalSeparator2, 0); - this.Controls.SetChildIndex(this.listBox1, 0); - this.Controls.SetChildIndex(this.label2, 0); - this.Controls.SetChildIndex(this.tHorizontalSeparator1, 0); - ((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).EndInit(); + this.MinimumSize = new System.Drawing.Size(400, 560); + this.Name = "AddTileFolderForm"; + this.Text = "Add List Tile"; this.ResumeLayout(false); + this.PerformLayout(); } + protected override void OnShown(EventArgs e) + { + base.OnShown(e); + + if (this.DialogMode == DialogModeType.Edit) + { + listBox1.ListBox.Items.Clear(); + + if (this.TilePanel == null) return; + if (this.TilePanel.ModelInfo == null) return; + + textBox1.Text = this.TilePanel.ModelInfo.Title; + + if (this.TilePanel.ModelInfo.Items != null) + { + foreach (TileModel item in this.TilePanel.ModelInfo.Items) + { + if (item.IsGroup) + { + continue; + } + + listBox1.ListBox.Items.Add(item); + } + } + } + } + + + public TilePanelLayout TilePanelLayout { get; set; } = null; + + public TilePanel TilePanel { get; set; } = null; + + public Point AimCoord { get; set; } = new Point(-1, -1); + + public DialogModeType DialogMode + { + get => dialogMode; + set + { + dialogMode = value; + + switch (dialogMode) + { + case DialogModeType.Add: + this.Text = "Add Tile List"; + break; + case DialogModeType.Edit: + this.Text = "Edit Tile List"; + break; + default: break; + } + } + } + + private void button1_Click(object sender, EventArgs e) { TileModel model = new TileModel() @@ -191,29 +258,52 @@ namespace AppLauncher.Windows.Forms IsGroup = true }; - if (!this.AimCoord.Equals(new Point(-1, -1))) + switch (this.DialogMode) { - model.Position = this.AimCoord; + case DialogModeType.Add: + if (!this.AimCoord.Equals(new Point(-1, -1))) + { + model.Position = this.AimCoord; + } + + model.Items = new System.Collections.Generic.List(); + + foreach (TileModel item in listBox1.ListBox.Items.OfType()) + { + if (item.IsGroup) + { + continue; + } + + model.Items.Add(item); + } + + this.TilePanelLayout.AddTile(model); + + break; + case DialogModeType.Edit: + model.Items = new System.Collections.Generic.List(); + + foreach (TileModel item in listBox1.ListBox.Items.OfType()) + { + if (item.IsGroup) + { + continue; + } + + model.Items.Add(item); + } + + this.TilePanel.LoadInfo(model); + + break; + default: break; } - model.Items = new System.Collections.Generic.List(); - - foreach (TileModel item in listBox1.ListBox.Items.OfType()) - { - if (item.IsGroup) - { - continue; - } - - model.Items.Add(item); - } - - this.TilePanelLayout.AddTile(model); - this.Close(); } - private void listBox1_OnAdd(object sender, EventArgs e) => AddTileForm.ShowDialog(listBox1); + private void listBox1_OnAdd(object sender, EventArgs e) => EditTileForm.ShowAddDialog(listBox1); private void listBox1_OnEdit(object sender, EventArgs e) { @@ -222,7 +312,7 @@ namespace AppLauncher.Windows.Forms return; } - EditTileForm.ShowDialog(listBox1); + EditTileForm.ShowEditDialog(listBox1); } private void listBox1_DragOver(object sender, System.Windows.Forms.DragEventArgs e) diff --git a/Windows/Forms/EditTileFolderForm.resx b/Windows/Forms/EditTileFolderForm.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/Windows/Forms/EditTileFolderForm.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 diff --git a/Windows/Forms/Tile/EditTileForm.cs b/Windows/Forms/EditTileForm.cs similarity index 58% rename from Windows/Forms/Tile/EditTileForm.cs rename to Windows/Forms/EditTileForm.cs index 7b876f0..4c962c7 100644 --- a/Windows/Forms/Tile/EditTileForm.cs +++ b/Windows/Forms/EditTileForm.cs @@ -1,25 +1,42 @@ -using AppLauncher.Models; +using FizzyLauncher.Models; using RyzStudio.Windows.ThemedForms; using System; +using System.Drawing; -namespace AppLauncher.Windows.Forms +namespace FizzyLauncher.Windows.Forms { public class EditTileForm : TDialogForm { - public static void ShowDialog(TTilePanel control) + public static void ShowAddDialog(TilePanelLayout control, Point coord) { - EditTileForm form = new EditTileForm(); + EditTileForm form = new EditTileForm(DialogModeType.Add); + form.TilePanelLayout = control; + form.AimCoord = coord; + form.ShowDialog(); + } + + public static void ShowAddDialog(TListBox control) + { + EditTileForm form = new EditTileForm(DialogModeType.Add); + form.ListBox = control; + form.ShowDialog(); + } + + public static void ShowEditDialog(TilePanel control) + { + EditTileForm form = new EditTileForm(DialogModeType.Edit); form.TilePanel = control; form.ShowDialog(); } - public static void ShowDialog(TListBox control) + public static void ShowEditDialog(TListBox control) { - EditTileForm form = new EditTileForm(); + EditTileForm form = new EditTileForm(DialogModeType.Edit); form.ListBox = control; form.ShowDialog(); } + private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label4; @@ -36,13 +53,23 @@ namespace AppLauncher.Windows.Forms private RyzStudio.Windows.Forms.THorizontalSeparator horizontalSeparator2; private TTextBox textBox1; - public TTilePanel TilePanel { get; set; } = null; - public TListBox ListBox { get; set; } = null; - public EditTileForm() : base() + public enum DialogModeType + { + Add = 0, + Edit + } + + + protected DialogModeType dialogMode = DialogModeType.Add; + + + public EditTileForm(DialogModeType dialogMode) : base() { InitializeComponent(); + this.DialogMode = dialogMode; + pickerBox1.ComboBox.Items.Clear(); pickerBox1.ComboBox.Items.AddRange(new string[] { "Normal", "Hidden", "Minimized", "Maximized" }); if (pickerBox1.ComboBox.Items.Count > 0) pickerBox1.ComboBox.SelectedIndex = 0; @@ -55,9 +82,6 @@ namespace AppLauncher.Windows.Forms private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditTileForm)); - RyzStudio.Windows.ThemedForms.TButton.ButtonStyle buttonStyle1 = new RyzStudio.Windows.ThemedForms.TButton.ButtonStyle(); - RyzStudio.Windows.ThemedForms.TButton.ButtonStyle buttonStyle2 = new RyzStudio.Windows.ThemedForms.TButton.ButtonStyle(); - RyzStudio.Windows.ThemedForms.TButton.ButtonStyle buttonStyle3 = new RyzStudio.Windows.ThemedForms.TButton.ButtonStyle(); this.textBox1 = new RyzStudio.Windows.ThemedForms.TTextBox(); this.label6 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); @@ -73,105 +97,98 @@ namespace AppLauncher.Windows.Forms this.pickerBox2 = new RyzStudio.Windows.ThemedForms.TPickerBox(); this.horizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); this.horizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - ((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit(); this.SuspendLayout(); // - // imgbxClose - // - this.imgbxClose.Image = ((System.Drawing.Image)(resources.GetObject("imgbxClose.Image"))); - this.imgbxClose.Location = new System.Drawing.Point(367, 5); - // - // lblDescription - // - this.Title = "Edit Tile"; - // - // panel1 - // - this.panel1.Location = new System.Drawing.Point(394, 474); - // - // area1 - // - this.area1.Location = new System.Drawing.Point(1, 474); - this.area1.Size = new System.Drawing.Size(392, 5); - // // textBox1 // this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox1.BackColor = System.Drawing.Color.Transparent; - this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.textBox1.Location = new System.Drawing.Point(159, 50); + this.textBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.textBox1.Location = new System.Drawing.Point(192, 20); this.textBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); this.textBox1.Name = "textBox1"; this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); - this.textBox1.Size = new System.Drawing.Size(220, 32); + this.textBox1.Size = new System.Drawing.Size(177, 35); this.textBox1.SubmitButton = null; this.textBox1.TabIndex = 152; this.textBox1.UseSystemPasswordChar = false; // // label6 // + this.label6.AutoSize = true; this.label6.BackColor = System.Drawing.Color.Transparent; - this.label6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label6.Location = new System.Drawing.Point(18, 268); + this.label6.ForeColor = System.Drawing.SystemColors.ControlText; + this.label6.Location = new System.Drawing.Point(10, 250); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(208, 32); + this.label6.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); + this.label6.Size = new System.Drawing.Size(83, 34); this.label6.TabIndex = 163; this.label6.Text = "Run As Admin"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label7 // + this.label7.AutoSize = true; this.label7.BackColor = System.Drawing.Color.Transparent; - this.label7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label7.Location = new System.Drawing.Point(18, 227); + this.label7.ForeColor = System.Drawing.SystemColors.ControlText; + this.label7.Location = new System.Drawing.Point(10, 209); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(208, 32); + this.label7.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); + this.label7.Size = new System.Drawing.Size(79, 34); this.label7.TabIndex = 161; this.label7.Text = "Window Style"; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label4 // + this.label4.AutoSize = true; this.label4.BackColor = System.Drawing.Color.Transparent; - this.label4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label4.Location = new System.Drawing.Point(18, 173); + this.label4.ForeColor = System.Drawing.SystemColors.ControlText; + this.label4.Location = new System.Drawing.Point(10, 144); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(131, 32); + this.label4.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); + this.label4.Size = new System.Drawing.Size(103, 34); this.label4.TabIndex = 159; this.label4.Text = "Working Directory"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label3 // + this.label3.AutoSize = true; this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label3.Location = new System.Drawing.Point(18, 132); + this.label3.ForeColor = System.Drawing.SystemColors.ControlText; + this.label3.Location = new System.Drawing.Point(10, 103); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(131, 32); + this.label3.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); + this.label3.Size = new System.Drawing.Size(61, 34); this.label3.TabIndex = 157; this.label3.Text = "Argument"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label2 // + this.label2.AutoSize = true; this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label2.Location = new System.Drawing.Point(18, 91); + this.label2.ForeColor = System.Drawing.SystemColors.ControlText; + this.label2.Location = new System.Drawing.Point(10, 62); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(131, 32); + this.label2.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); + this.label2.Size = new System.Drawing.Size(55, 34); this.label2.TabIndex = 155; this.label2.Text = "Filename"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label1 // + this.label1.AutoSize = true; this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label1.Location = new System.Drawing.Point(18, 50); + this.label1.ForeColor = System.Drawing.SystemColors.ControlText; + this.label1.Location = new System.Drawing.Point(10, 21); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(131, 32); + this.label1.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); + this.label1.Size = new System.Drawing.Size(29, 34); this.label1.TabIndex = 153; this.label1.Text = "Title"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -182,14 +199,14 @@ namespace AppLauncher.Windows.Forms | System.Windows.Forms.AnchorStyles.Right))); this.textBox2.BackColor = System.Drawing.Color.Transparent; this.textBox2.FileDialog = null; - this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.textBox2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.textBox2.HighlightImage = ((System.Drawing.Image)(resources.GetObject("textBox2.HighlightImage"))); - this.textBox2.Location = new System.Drawing.Point(159, 91); + this.textBox2.Location = new System.Drawing.Point(192, 61); this.textBox2.Margin = new System.Windows.Forms.Padding(10, 3, 3, 3); this.textBox2.Name = "textBox2"; this.textBox2.NormalImage = ((System.Drawing.Image)(resources.GetObject("textBox2.NormalImage"))); this.textBox2.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); - this.textBox2.Size = new System.Drawing.Size(220, 32); + this.textBox2.Size = new System.Drawing.Size(177, 35); this.textBox2.SubmitButton = null; this.textBox2.TabIndex = 170; this.textBox2.UseSystemPasswordChar = false; @@ -199,12 +216,12 @@ namespace AppLauncher.Windows.Forms this.textBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox3.BackColor = System.Drawing.Color.Transparent; - this.textBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.textBox3.Location = new System.Drawing.Point(159, 132); + this.textBox3.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.textBox3.Location = new System.Drawing.Point(192, 102); this.textBox3.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); this.textBox3.Name = "textBox3"; this.textBox3.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); - this.textBox3.Size = new System.Drawing.Size(220, 32); + this.textBox3.Size = new System.Drawing.Size(177, 35); this.textBox3.SubmitButton = null; this.textBox3.TabIndex = 171; this.textBox3.UseSystemPasswordChar = false; @@ -215,26 +232,28 @@ namespace AppLauncher.Windows.Forms | System.Windows.Forms.AnchorStyles.Right))); this.textBox4.BackColor = System.Drawing.Color.Transparent; this.textBox4.FolderDialog = null; - this.textBox4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.textBox4.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.textBox4.HighlightImage = ((System.Drawing.Image)(resources.GetObject("textBox4.HighlightImage"))); - this.textBox4.Location = new System.Drawing.Point(159, 173); + this.textBox4.Location = new System.Drawing.Point(192, 143); this.textBox4.Margin = new System.Windows.Forms.Padding(10, 3, 3, 3); this.textBox4.Name = "textBox4"; this.textBox4.NormalImage = ((System.Drawing.Image)(resources.GetObject("textBox4.NormalImage"))); this.textBox4.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); - this.textBox4.Size = new System.Drawing.Size(220, 32); + this.textBox4.Size = new System.Drawing.Size(177, 35); this.textBox4.SubmitButton = null; this.textBox4.TabIndex = 172; this.textBox4.UseSystemPasswordChar = false; // // button1 // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.button1.BackColor = System.Drawing.Color.Transparent; this.button1.DefaultImage = null; this.button1.DownImage = null; - this.button1.LabelText = "&Save"; - this.button1.Location = new System.Drawing.Point(251, 427); + this.button1.IsSelected = false; + this.button1.LabelText = "&OK"; + this.button1.Location = new System.Drawing.Point(241, 469); + this.button1.Margin = new System.Windows.Forms.Padding(10); this.button1.Name = "button1"; this.button1.OverImage = null; this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); @@ -244,29 +263,27 @@ namespace AppLauncher.Windows.Forms // // pickerBox1 // - this.pickerBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.pickerBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.pickerBox1.BackColor = System.Drawing.Color.Transparent; - this.pickerBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.pickerBox1.Location = new System.Drawing.Point(239, 227); + this.pickerBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.pickerBox1.Location = new System.Drawing.Point(241, 209); this.pickerBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); this.pickerBox1.Name = "pickerBox1"; this.pickerBox1.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.pickerBox1.Size = new System.Drawing.Size(140, 32); + this.pickerBox1.Size = new System.Drawing.Size(128, 34); this.pickerBox1.SubmitButton = null; this.pickerBox1.TabIndex = 174; // // pickerBox2 // - this.pickerBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.pickerBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.pickerBox2.BackColor = System.Drawing.Color.Transparent; - this.pickerBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.pickerBox2.Location = new System.Drawing.Point(239, 268); + this.pickerBox2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.pickerBox2.Location = new System.Drawing.Point(285, 250); this.pickerBox2.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); this.pickerBox2.Name = "pickerBox2"; this.pickerBox2.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.pickerBox2.Size = new System.Drawing.Size(140, 32); + this.pickerBox2.Size = new System.Drawing.Size(84, 34); this.pickerBox2.SubmitButton = null; this.pickerBox2.TabIndex = 175; // @@ -274,25 +291,38 @@ namespace AppLauncher.Windows.Forms // this.horizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.horizontalSeparator1.Location = new System.Drawing.Point(10, 215); + this.horizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0); + this.horizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0); + this.horizontalSeparator1.BackColor = System.Drawing.Color.Transparent; + this.horizontalSeparator1.Location = new System.Drawing.Point(10, 181); + this.horizontalSeparator1.Margin = new System.Windows.Forms.Padding(10, 0, 10, 0); this.horizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); + this.horizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22); this.horizontalSeparator1.Name = "horizontalSeparator1"; - this.horizontalSeparator1.Size = new System.Drawing.Size(380, 2); + this.horizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); + this.horizontalSeparator1.Size = new System.Drawing.Size(364, 22); this.horizontalSeparator1.TabIndex = 176; // // horizontalSeparator2 // - this.horizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.horizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.horizontalSeparator2.Location = new System.Drawing.Point(10, 310); + this.horizontalSeparator2.AutoScrollMargin = new System.Drawing.Size(0, 0); + this.horizontalSeparator2.AutoScrollMinSize = new System.Drawing.Size(0, 0); + this.horizontalSeparator2.BackColor = System.Drawing.Color.Transparent; + this.horizontalSeparator2.Location = new System.Drawing.Point(10, 437); + this.horizontalSeparator2.Margin = new System.Windows.Forms.Padding(10, 0, 10, 0); this.horizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2); + this.horizontalSeparator2.MinimumSize = new System.Drawing.Size(0, 22); this.horizontalSeparator2.Name = "horizontalSeparator2"; - this.horizontalSeparator2.Size = new System.Drawing.Size(380, 2); + this.horizontalSeparator2.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); + this.horizontalSeparator2.Size = new System.Drawing.Size(364, 22); this.horizontalSeparator2.TabIndex = 177; // - // EditTileForm + // AddTileForm // - this.ClientSize = new System.Drawing.Size(400, 480); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.ClientSize = new System.Drawing.Size(384, 521); this.Controls.Add(this.horizontalSeparator2); this.Controls.Add(this.horizontalSeparator1); this.Controls.Add(this.pickerBox2); @@ -308,28 +338,11 @@ namespace AppLauncher.Windows.Forms this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Controls.Add(this.textBox1); - this.Title = "Edit Tile"; - this.Name = "EditTileForm"; - this.Controls.SetChildIndex(this.imgbxClose, 0); - this.Controls.SetChildIndex(this.panel1, 0); - this.Controls.SetChildIndex(this.area1, 0); - this.Controls.SetChildIndex(this.textBox1, 0); - this.Controls.SetChildIndex(this.label1, 0); - this.Controls.SetChildIndex(this.label2, 0); - this.Controls.SetChildIndex(this.label3, 0); - this.Controls.SetChildIndex(this.label4, 0); - this.Controls.SetChildIndex(this.label7, 0); - this.Controls.SetChildIndex(this.label6, 0); - this.Controls.SetChildIndex(this.textBox2, 0); - this.Controls.SetChildIndex(this.textBox3, 0); - this.Controls.SetChildIndex(this.textBox4, 0); - this.Controls.SetChildIndex(this.button1, 0); - this.Controls.SetChildIndex(this.pickerBox1, 0); - this.Controls.SetChildIndex(this.pickerBox2, 0); - this.Controls.SetChildIndex(this.horizontalSeparator1, 0); - this.Controls.SetChildIndex(this.horizontalSeparator2, 0); - ((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).EndInit(); + this.MinimumSize = new System.Drawing.Size(400, 560); + this.Name = "AddTileForm"; + this.Text = "Add Tile"; this.ResumeLayout(false); + this.PerformLayout(); } @@ -337,40 +350,92 @@ namespace AppLauncher.Windows.Forms { base.OnShown(e); - if (this.TilePanel != null) + if (this.DialogMode == DialogModeType.Edit) { - updateModel(this.TilePanel.ModelInfo); - } - else if (this.ListBox != null) - { - if (this.ListBox.ListBox.SelectedItem != null) + if (this.TilePanel != null) { - TileModel model = (this.ListBox.ListBox.SelectedItem as TileModel); - if (model != null) + updateModel(this.TilePanel.ModelInfo); + } + else if (this.ListBox != null) + { + if (this.ListBox.ListBox.SelectedItem != null) { - updateModel(model); + TileModel model = (this.ListBox.ListBox.SelectedItem as TileModel); + if (model != null) + { + updateModel(model); + } } } } } + + public TilePanelLayout TilePanelLayout { get; set; } = null; + + public TilePanel TilePanel { get; set; } = null; + + public TListBox ListBox { get; set; } = null; + + public Point AimCoord { get; set; } = new Point(-1, -1); + + public DialogModeType DialogMode + { + get => dialogMode; + set + { + dialogMode = value; + + switch (dialogMode) + { + case DialogModeType.Add: + this.Text = "Add Tile"; + break; + case DialogModeType.Edit: + this.Text = "Edit Tile"; + break; + default: break; + } + } + } + + private void button1_Click(object sender, EventArgs e) { TileModel model = buildModel(); - if (this.TilePanel != null) + switch (this.DialogMode) { - this.TilePanel.LoadInfo(model); - } - else if (this.ListBox != null) - { - int n = this.ListBox.ListBox.SelectedIndex; - if (n >= 0) - { - this.ListBox.ListBox.Items.RemoveAt(n); - this.ListBox.ListBox.Items.Insert(n, model); - this.ListBox.ListBox.SelectedIndex = n; - } + case DialogModeType.Add: + if (this.TilePanelLayout != null) + { + this.TilePanelLayout.AddTile(model); + } + else if (this.ListBox != null) + { + int n = this.ListBox.ListBox.Items.Add(model); + this.ListBox.ListBox.SelectedIndex = n; + } + + break; + case DialogModeType.Edit: + if (this.TilePanel != null) + { + this.TilePanel.LoadInfo(model); + } + else if (this.ListBox != null) + { + int n = this.ListBox.ListBox.SelectedIndex; + if (n >= 0) + { + this.ListBox.ListBox.Items.RemoveAt(n); + this.ListBox.ListBox.Items.Insert(n, model); + this.ListBox.ListBox.SelectedIndex = n; + } + } + + break; + default: break; } this.Close(); @@ -378,7 +443,7 @@ namespace AppLauncher.Windows.Forms protected TileModel buildModel() { - return new TileModel() + TileModel rs = new TileModel() { Title = textBox1.Text?.Trim(), ProcessFilename = textBox2.Text?.Trim(), @@ -387,6 +452,16 @@ namespace AppLauncher.Windows.Forms ProcessWindowStyle = (System.Diagnostics.ProcessWindowStyle)pickerBox1.ComboBox.SelectedIndex, ProcessAsAdmin = (pickerBox2.ComboBox.SelectedIndex == 1) }; + + if (this.DialogMode == DialogModeType.Add) + { + if (!this.AimCoord.Equals(new Point(-1, -1))) + { + rs.Position = this.AimCoord; + } + } + + return rs; } protected void updateModel(TileModel model) @@ -405,4 +480,4 @@ namespace AppLauncher.Windows.Forms } } -} \ No newline at end of file +} diff --git a/Windows/Forms/Tile/EditTileForm.resx b/Windows/Forms/EditTileForm.resx similarity index 56% rename from Windows/Forms/Tile/EditTileForm.resx rename to Windows/Forms/EditTileForm.resx index e6f3e1a..0fa2bef 100644 --- a/Windows/Forms/Tile/EditTileForm.resx +++ b/Windows/Forms/EditTileForm.resx @@ -1,64 +1,4 @@ - - - + @@ -118,20 +58,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS4xYyqcSwAAANlJREFUOE+lU1sO - gjAQrHgRY6KemQ+VT9NrgAfgfRA+SawzdTAk2lhkkgm7s7vTAq0py/LUNM0dHEEXSfYWfd8fDQIOD23b - nvFMY6jeAcxpMFIwC1HX9YWzNOCWUunR4AxnvxpUVbV3zm2UGsbUlHoEDfBhdsgf4BWDCcmYGmtqCxtw - NeQcoJ6JjGn43hXy8CvIxDeIGbREZY+pHjLgtqeVHf7SzVq7VdmDM6x9GGj1/19h9UckVv3GWMwNRh5L - 6dGYH+UCHCTQ9SfV+7pMvJIIaLL0Oudd1x2eUQ8MyeAeq0cAAAAASUVORK5CYII= - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wgAADsIBFShKgAAAAK9JREFUOE/t0zsKwkAURuGp1BWJK3EhIrgAV+EOLLWwtRQLwQdiIbbiIkwynj+O + vwAADr8BOAVTJAAAAK9JREFUOE/t0zsKwkAURuGp1BWJK3EhIrgAV+EOLLWwtRQLwQdiIbbiIkwynj+O IVwnyhR2XvjyInNIkXHee8f0cEQBPbDOaKEarSvXhsAJO4wirlB4jipiA3phoIvIrLFChhnKiA3o8Ckw RR93LNBODVwwwRL62kNKYIxNzQ1FSsDOEHk08HrYJMw/8KtA06/cCef6KJDZgDbTFrHNZO3x9idqOyui m2+07bvPgHcPXOhtG3D6cUIAAAAASUVORK5CYII= @@ -140,7 +70,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wgAADsIBFShKgAAAAMZJREFUOE/tk7sNwjAQQF3BRohJGAQhMQBTsAElFLSUiAKJTxIXhBZlCILNuyRG + vwAADr8BOAVTJAAAAMZJREFUOE/tk7sNwjAQQF3BRohJGAQhMQBTsAElFLSUiAKJTxIXhBZlCILNuyRG iXEQKeg46fmsO/slhU9Za5XWehiXYcD6JElygZ6qhdwTioVDGo4wDXDjsohXdYkvMDTHVa8R9Hb0tpCz XzqJL5Df/CRYRFE0Yn8nr9M07XcSwBXmXN6QDfncRTCjt6+Rgfla4Adfn3D+ERS4Yht/wY8FxVN2xTac gLP5qyYLAhmmA4SGyeeEoPkSq3EWydsoB4gRDEqBVU/p15ajstHKCgAAAABJRU5ErkJggg== @@ -149,7 +79,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - xAAADsQBlSsOGwAAAJtJREFUOE/t0zEKwkAQheEpvILHSLySlTeJ6AnEzpPYi0ERPIKWKtZKNv9LNS5x + wQAADsEBuJFr7QAAAJtJREFUOE/t0zEKwkAQheEpvILHSLySlTeJ6AnEzpPYi0ERPIKWKtZKNv9LNS5x E6xS+OCDJew8tsgYmeCECsGZo1dKXLBwtnghQ2fe0JDPGHecsW6xwgwjNM8tdIgyxQ0qij2gORV9LejK Bk8dfi3QjGY/C0IISS7/gkEVtP3KfbKEZm0PLZM++IVK0d0rdrAcR8TrnKK7BzPLa7Wb+WX/Nb8PAAAA AElFTkSuQmCC @@ -158,7 +88,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - xAAADsQBlSsOGwAAALZJREFUOE/tkzEKwjAYRjt4BY9hvZKTN1HsCYqbJzGzKBGb9gY6qjgrxvdJK7ZS + wQAADsEBuJFr7QAAALZJREFUOE/tkzEKwjAYRjt4BY9hvZKTN1HsCYqbJzGzKBGb9gY6qjgrxvdJK7ZS Gpwc/ODBnzTvg0AT5Xk+hB3cwVc456ZRSIqi2MAeafbGEq5Zlg3KY+1Bvkkql89Ya/vsnUCZN8FJYWyM 6ekKnsWkdF9hb8S3I6ioyRnkpa0FXcFbwOXrAjlyawXe+06q/At+qoDh41cOCU4iV8OaQY8pUVEgOnuA VcSzjRm2UHvOHeisdc7FDwDnJKIbLgP9AAAAAElFTkSuQmCC diff --git a/Windows/Forms/OptionsForm.cs b/Windows/Forms/OptionsForm.cs deleted file mode 100644 index ff34358..0000000 --- a/Windows/Forms/OptionsForm.cs +++ /dev/null @@ -1,446 +0,0 @@ -using AppLauncher.Models; -using RyzStudio.Windows.ThemedForms; -using System; -using System.Drawing; -using System.Text; - -namespace AppLauncher.Windows.Forms -{ - public class OptionsForm : TDialogForm - { - private System.Windows.Forms.Label label1; - private TButton button1; - private TTextBox textBox1; - private TYesNoPickerBox pickerBox1; - private System.Windows.Forms.Label label2; - private TYesNoPickerBox pickerBox2; - private System.Windows.Forms.Label label3; - private TYesNoPickerBox pickerBox3; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.Label label5; - private RyzStudio.Windows.Forms.THorizontalSeparator horizontalSeparator2; - private TYesNoPickerBox pickerBox4; - private System.Windows.Forms.Label label6; - private TYesNoPickerBox pickerBox5; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.Label label8; - private TPickerBox pickerBox6; - - public MainForm parentForm { get; set; } = null; - protected LauncherSession.HotKeyOptions hotKeyOptions = null; - - public OptionsForm(MainForm parent) : base() - { - InitializeComponent(); - - parentForm = parent; - - textBox1.InnerTextBox.ReadOnly = true; - textBox1.InnerTextBox.BackColor = Color.White; - textBox1.InnerTextBox.KeyUp += textBox1_KeyUp; - - pickerBox6.ComboBox.Items.Clear(); - foreach (string item in Enum.GetNames(typeof(LauncherSession.AutoSaveOption))) - { - pickerBox6.ComboBox.Items.Add(item); - } - - if (pickerBox6.ComboBox.Items.Count > 0) pickerBox6.ComboBox.SelectedIndex = 0; - - } - - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OptionsForm)); - this.textBox1 = new RyzStudio.Windows.ThemedForms.TTextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.button1 = new RyzStudio.Windows.ThemedForms.TButton(); - this.pickerBox1 = new RyzStudio.Windows.ThemedForms.TYesNoPickerBox(); - this.label2 = new System.Windows.Forms.Label(); - this.pickerBox2 = new RyzStudio.Windows.ThemedForms.TYesNoPickerBox(); - this.label3 = new System.Windows.Forms.Label(); - this.pickerBox3 = new RyzStudio.Windows.ThemedForms.TYesNoPickerBox(); - this.label4 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.horizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.pickerBox4 = new RyzStudio.Windows.ThemedForms.TYesNoPickerBox(); - this.label6 = new System.Windows.Forms.Label(); - this.pickerBox5 = new RyzStudio.Windows.ThemedForms.TYesNoPickerBox(); - this.label7 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.pickerBox6 = new RyzStudio.Windows.ThemedForms.TPickerBox(); - ((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit(); - this.SuspendLayout(); - // - // imgbxClose - // - this.imgbxClose.Image = ((System.Drawing.Image)(resources.GetObject("imgbxClose.Image"))); - this.imgbxClose.Location = new System.Drawing.Point(367, 5); - // - // panel1 - // - this.panel1.Location = new System.Drawing.Point(394, 474); - // - // area1 - // - this.area1.Location = new System.Drawing.Point(1, 474); - this.area1.Size = new System.Drawing.Size(392, 5); - // - // textBox1 - // - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox1.BackColor = System.Drawing.Color.Transparent; - this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.textBox1.Location = new System.Drawing.Point(159, 206); - this.textBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); - this.textBox1.Name = "textBox1"; - this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); - this.textBox1.Size = new System.Drawing.Size(220, 32); - this.textBox1.SubmitButton = null; - this.textBox1.TabIndex = 152; - this.textBox1.UseSystemPasswordChar = false; - // - // label1 - // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label1.Location = new System.Drawing.Point(18, 83); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(131, 32); - this.label1.TabIndex = 153; - this.label1.Text = "Use Control"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // button1 - // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.button1.BackColor = System.Drawing.Color.Transparent; - this.button1.DefaultImage = null; - this.button1.DownImage = null; - this.button1.IsSelected = false; - this.button1.LabelText = "&Save"; - this.button1.Location = new System.Drawing.Point(251, 427); - this.button1.Name = "button1"; - this.button1.OverImage = null; - this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.button1.Size = new System.Drawing.Size(128, 32); - this.button1.TabIndex = 173; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // pickerBox1 - // - this.pickerBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox1.BackColor = System.Drawing.Color.Transparent; - this.pickerBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.pickerBox1.Location = new System.Drawing.Point(159, 83); - this.pickerBox1.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); - this.pickerBox1.Name = "pickerBox1"; - this.pickerBox1.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.pickerBox1.Size = new System.Drawing.Size(220, 32); - this.pickerBox1.SubmitButton = null; - this.pickerBox1.TabIndex = 174; - this.pickerBox1.Value = false; - // - // label2 - // - this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.ForeColor = System.Drawing.Color.Black; - this.label2.Location = new System.Drawing.Point(8, 50); - this.label2.Margin = new System.Windows.Forms.Padding(0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(385, 24); - this.label2.TabIndex = 175; - this.label2.Text = "Toggle Hotkey"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // pickerBox2 - // - this.pickerBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox2.BackColor = System.Drawing.Color.Transparent; - this.pickerBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.pickerBox2.Location = new System.Drawing.Point(159, 124); - this.pickerBox2.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); - this.pickerBox2.Name = "pickerBox2"; - this.pickerBox2.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.pickerBox2.Size = new System.Drawing.Size(220, 32); - this.pickerBox2.SubmitButton = null; - this.pickerBox2.TabIndex = 177; - this.pickerBox2.Value = false; - // - // label3 - // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label3.Location = new System.Drawing.Point(18, 124); - this.label3.Margin = new System.Windows.Forms.Padding(0); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(131, 32); - this.label3.TabIndex = 176; - this.label3.Text = "Use Alt"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // pickerBox3 - // - this.pickerBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox3.BackColor = System.Drawing.Color.Transparent; - this.pickerBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.pickerBox3.Location = new System.Drawing.Point(159, 165); - this.pickerBox3.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); - this.pickerBox3.Name = "pickerBox3"; - this.pickerBox3.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.pickerBox3.Size = new System.Drawing.Size(220, 32); - this.pickerBox3.SubmitButton = null; - this.pickerBox3.TabIndex = 179; - this.pickerBox3.Value = false; - // - // label4 - // - this.label4.BackColor = System.Drawing.Color.Transparent; - this.label4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label4.Location = new System.Drawing.Point(18, 165); - this.label4.Margin = new System.Windows.Forms.Padding(0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(131, 32); - this.label4.TabIndex = 178; - this.label4.Text = "Use Shift"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label5 - // - this.label5.BackColor = System.Drawing.Color.Transparent; - this.label5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label5.Location = new System.Drawing.Point(18, 206); - this.label5.Margin = new System.Windows.Forms.Padding(0); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(131, 32); - this.label5.TabIndex = 180; - this.label5.Text = "Key"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // horizontalSeparator2 - // - this.horizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.horizontalSeparator2.Location = new System.Drawing.Point(10, 247); - this.horizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2); - this.horizontalSeparator2.Name = "horizontalSeparator2"; - this.horizontalSeparator2.Size = new System.Drawing.Size(380, 2); - this.horizontalSeparator2.TabIndex = 181; - // - // pickerBox4 - // - this.pickerBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox4.BackColor = System.Drawing.Color.Transparent; - this.pickerBox4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.pickerBox4.Location = new System.Drawing.Point(159, 300); - this.pickerBox4.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); - this.pickerBox4.Name = "pickerBox4"; - this.pickerBox4.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.pickerBox4.Size = new System.Drawing.Size(220, 32); - this.pickerBox4.SubmitButton = null; - this.pickerBox4.TabIndex = 183; - this.pickerBox4.Value = true; - // - // label6 - // - this.label6.BackColor = System.Drawing.Color.Transparent; - this.label6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label6.Location = new System.Drawing.Point(18, 300); - this.label6.Margin = new System.Windows.Forms.Padding(0); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(131, 32); - this.label6.TabIndex = 182; - this.label6.Text = "Hide On Close"; - this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // pickerBox5 - // - this.pickerBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox5.BackColor = System.Drawing.Color.Transparent; - this.pickerBox5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.pickerBox5.Location = new System.Drawing.Point(159, 341); - this.pickerBox5.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); - this.pickerBox5.Name = "pickerBox5"; - this.pickerBox5.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.pickerBox5.Size = new System.Drawing.Size(220, 32); - this.pickerBox5.SubmitButton = null; - this.pickerBox5.TabIndex = 185; - this.pickerBox5.Value = true; - // - // label7 - // - this.label7.BackColor = System.Drawing.Color.Transparent; - this.label7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label7.Location = new System.Drawing.Point(18, 341); - this.label7.Margin = new System.Windows.Forms.Padding(0); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(131, 32); - this.label7.TabIndex = 184; - this.label7.Text = "Hide On Click"; - this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label8 - // - this.label8.BackColor = System.Drawing.Color.Transparent; - this.label8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label8.Location = new System.Drawing.Point(18, 259); - this.label8.Margin = new System.Windows.Forms.Padding(0); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(131, 32); - this.label8.TabIndex = 186; - this.label8.Text = "Auto Save"; - this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // pickerBox6 - // - this.pickerBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox6.BackColor = System.Drawing.Color.Transparent; - this.pickerBox6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.pickerBox6.Location = new System.Drawing.Point(159, 259); - this.pickerBox6.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); - this.pickerBox6.Name = "pickerBox6"; - this.pickerBox6.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.pickerBox6.Size = new System.Drawing.Size(220, 32); - this.pickerBox6.SubmitButton = null; - this.pickerBox6.TabIndex = 187; - // - // OptionsForm - // - this.ClientSize = new System.Drawing.Size(400, 480); - this.Controls.Add(this.pickerBox6); - this.Controls.Add(this.label8); - this.Controls.Add(this.pickerBox5); - this.Controls.Add(this.label7); - this.Controls.Add(this.pickerBox4); - this.Controls.Add(this.label6); - this.Controls.Add(this.horizontalSeparator2); - this.Controls.Add(this.label5); - this.Controls.Add(this.pickerBox3); - this.Controls.Add(this.label4); - this.Controls.Add(this.pickerBox2); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.pickerBox1); - this.Controls.Add(this.button1); - this.Controls.Add(this.label1); - this.Controls.Add(this.textBox1); - this.Name = "OptionsForm"; - this.Title = "Options"; - this.Controls.SetChildIndex(this.imgbxClose, 0); - this.Controls.SetChildIndex(this.panel1, 0); - this.Controls.SetChildIndex(this.area1, 0); - this.Controls.SetChildIndex(this.textBox1, 0); - this.Controls.SetChildIndex(this.label1, 0); - this.Controls.SetChildIndex(this.button1, 0); - this.Controls.SetChildIndex(this.pickerBox1, 0); - this.Controls.SetChildIndex(this.label2, 0); - this.Controls.SetChildIndex(this.label3, 0); - this.Controls.SetChildIndex(this.pickerBox2, 0); - this.Controls.SetChildIndex(this.label4, 0); - this.Controls.SetChildIndex(this.pickerBox3, 0); - this.Controls.SetChildIndex(this.label5, 0); - this.Controls.SetChildIndex(this.horizontalSeparator2, 0); - this.Controls.SetChildIndex(this.label6, 0); - this.Controls.SetChildIndex(this.pickerBox4, 0); - this.Controls.SetChildIndex(this.label7, 0); - this.Controls.SetChildIndex(this.pickerBox5, 0); - this.Controls.SetChildIndex(this.label8, 0); - this.Controls.SetChildIndex(this.pickerBox6, 0); - ((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).EndInit(); - this.ResumeLayout(false); - - } - - protected override void OnShown(EventArgs e) - { - base.OnShown(e); - - if (hotKeyOptions == null) hotKeyOptions = new LauncherSession.HotKeyOptions(); - - if (parentForm == null) - { - return; - } - - if (parentForm.CurrentSession == null) - { - return; - } - - // hotkey - if (parentForm.CurrentSession.HotKey != null) - { - hotKeyOptions.IsCtrl = parentForm.CurrentSession.HotKey.IsCtrl; - hotKeyOptions.IsAlt = parentForm.CurrentSession.HotKey.IsAlt; - hotKeyOptions.IsShift = parentForm.CurrentSession.HotKey.IsShift; - hotKeyOptions.Key = parentForm.CurrentSession.HotKey.Key; - - pickerBox1.Value = hotKeyOptions.IsCtrl; - pickerBox2.Value = hotKeyOptions.IsAlt; - pickerBox3.Value = hotKeyOptions.IsShift; - - textBox1.Text = hotKeyOptions.KeyCode.ToString(); - } - - pickerBox4.Value = parentForm.CurrentSession.HideOnClose; - pickerBox5.Value = parentForm.CurrentSession.HideOnClick; - pickerBox6.ComboBox.SelectedIndex = (int)parentForm.CurrentSession.AutoSave; - - } - - private void button1_Click(object sender, EventArgs e) - { - if (hotKeyOptions == null) hotKeyOptions = new LauncherSession.HotKeyOptions(); - - if (parentForm != null) - { - if (parentForm.CurrentSession == null) parentForm.CurrentSession = new LauncherSession(); - if (parentForm.CurrentSession.HotKey == null) parentForm.CurrentSession.HotKey = new LauncherSession.HotKeyOptions(); - - parentForm.CurrentSession.HotKey.IsCtrl = pickerBox1.Value; - parentForm.CurrentSession.HotKey.IsAlt = pickerBox2.Value; - parentForm.CurrentSession.HotKey.IsShift = pickerBox3.Value; - parentForm.CurrentSession.HotKey.Key = hotKeyOptions.Key; - - parentForm.CurrentSession.HideOnClose = pickerBox4.Value; - parentForm.CurrentSession.HideOnClick = pickerBox5.Value; - parentForm.CurrentSession.AutoSave = (LauncherSession.AutoSaveOption)pickerBox6.ComboBox.SelectedIndex; - - } - - this.Close(); - } - - private void textBox1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) - { - if (e.KeyCode == System.Windows.Forms.Keys.ControlKey) return; - if (e.KeyCode == System.Windows.Forms.Keys.ShiftKey) return; - if (e.KeyCode == System.Windows.Forms.Keys.Menu) return; - - if (hotKeyOptions == null) hotKeyOptions = new LauncherSession.HotKeyOptions(); - //hotKeyOptions.IsCtrl = pickerBox1.Value; - //hotKeyOptions.IsAlt = pickerBox2.Value; - //hotKeyOptions.IsShift = pickerBox3.Value; - hotKeyOptions.Key = (int)e.KeyCode; - - //StringBuilder sb = new StringBuilder(); - //if (hotKeyOptions.IsCtrl) sb = sb.Append("Ctrl + "); - //if (hotKeyOptions.IsAlt) sb = sb.Append("Alt + "); - //if (hotKeyOptions.IsShift) sb = sb.Append("Shift + "); - //sb = sb.Append(e.KeyCode.ToString()); - - //textBox1.Text = sb.ToString(); - textBox1.Text = e.KeyCode.ToString(); - } - - } -} \ No newline at end of file diff --git a/Windows/Forms/Tile/AddListTileForm.resx b/Windows/Forms/Tile/AddListTileForm.resx deleted file mode 100644 index 3747e00..0000000 --- a/Windows/Forms/Tile/AddListTileForm.resx +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS4xYyqcSwAAANlJREFUOE+lU1sO - gjAQrHgRY6KemQ+VT9NrgAfgfRA+SawzdTAk2lhkkgm7s7vTAq0py/LUNM0dHEEXSfYWfd8fDQIOD23b - nvFMY6jeAcxpMFIwC1HX9YWzNOCWUunR4AxnvxpUVbV3zm2UGsbUlHoEDfBhdsgf4BWDCcmYGmtqCxtw - NeQcoJ6JjGn43hXy8CvIxDeIGbREZY+pHjLgtqeVHf7SzVq7VdmDM6x9GGj1/19h9UckVv3GWMwNRh5L - 6dGYH+UCHCTQ9SfV+7pMvJIIaLL0Oudd1x2eUQ8MyeAeq0cAAAAASUVORK5CYII= - - - \ No newline at end of file diff --git a/Windows/Forms/Tile/AddTileForm.cs b/Windows/Forms/Tile/AddTileForm.cs deleted file mode 100644 index a44bf72..0000000 --- a/Windows/Forms/Tile/AddTileForm.cs +++ /dev/null @@ -1,375 +0,0 @@ -using AppLauncher.Models; -using RyzStudio.Windows.ThemedForms; -using System; -using System.Drawing; - -namespace AppLauncher.Windows.Forms -{ - public class AddTileForm : TDialogForm - { - public static void ShowDialog(TTilePanelLayout control, Point coord) - { - AddTileForm form = new AddTileForm(); - form.TilePanelLayout = control; - form.AimCoord = coord; - form.ShowDialog(); - } - - public static void ShowDialog(TListBox control) - { - AddTileForm form = new AddTileForm(); - form.ListBox = control; - form.ShowDialog(); - } - - private System.Windows.Forms.Label label6; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label1; - private TOpenFileTextBox textBox2; - private TTextBox textBox3; - private TFolderTextBox textBox4; - private TButton button1; - private TPickerBox pickerBox1; - private TPickerBox pickerBox2; - private RyzStudio.Windows.Forms.THorizontalSeparator horizontalSeparator1; - private RyzStudio.Windows.Forms.THorizontalSeparator horizontalSeparator2; - private TTextBox textBox1; - - public TTilePanelLayout TilePanelLayout { get; set; } = null; - public Point AimCoord { get; set; } = new Point(-1, -1); - public TListBox ListBox { get; set; } = null; - - public AddTileForm() : base() - { - InitializeComponent(); - - pickerBox1.ComboBox.Items.Clear(); - pickerBox1.ComboBox.Items.AddRange(new string[] { "Normal", "Hidden", "Minimized", "Maximized" }); - if (pickerBox1.ComboBox.Items.Count > 0) pickerBox1.ComboBox.SelectedIndex = 0; - - pickerBox2.ComboBox.Items.Clear(); - pickerBox2.ComboBox.Items.AddRange(new string[] { "No", "Yes" }); - if (pickerBox2.ComboBox.Items.Count > 0) pickerBox2.ComboBox.SelectedIndex = 0; - } - - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddTileForm)); - RyzStudio.Windows.ThemedForms.TButton.ButtonStyle buttonStyle1 = new RyzStudio.Windows.ThemedForms.TButton.ButtonStyle(); - RyzStudio.Windows.ThemedForms.TButton.ButtonStyle buttonStyle2 = new RyzStudio.Windows.ThemedForms.TButton.ButtonStyle(); - RyzStudio.Windows.ThemedForms.TButton.ButtonStyle buttonStyle3 = new RyzStudio.Windows.ThemedForms.TButton.ButtonStyle(); - this.textBox1 = new RyzStudio.Windows.ThemedForms.TTextBox(); - this.label6 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.textBox2 = new RyzStudio.Windows.ThemedForms.TOpenFileTextBox(); - this.textBox3 = new RyzStudio.Windows.ThemedForms.TTextBox(); - this.textBox4 = new RyzStudio.Windows.ThemedForms.TFolderTextBox(); - this.button1 = new RyzStudio.Windows.ThemedForms.TButton(); - this.pickerBox1 = new RyzStudio.Windows.ThemedForms.TPickerBox(); - this.pickerBox2 = new RyzStudio.Windows.ThemedForms.TPickerBox(); - this.horizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.horizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - ((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit(); - this.SuspendLayout(); - // - // imgbxClose - // - this.imgbxClose.Image = ((System.Drawing.Image)(resources.GetObject("imgbxClose.Image"))); - this.imgbxClose.Location = new System.Drawing.Point(367, 5); - // - this.Text = "Add Tile"; - // - // panel1 - // - this.panel1.Location = new System.Drawing.Point(394, 474); - // - // area1 - // - this.area1.Location = new System.Drawing.Point(1, 474); - this.area1.Size = new System.Drawing.Size(392, 5); - // - // textBox1 - // - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox1.BackColor = System.Drawing.Color.Transparent; - this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.textBox1.Location = new System.Drawing.Point(159, 50); - this.textBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); - this.textBox1.Name = "textBox1"; - this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); - this.textBox1.Size = new System.Drawing.Size(220, 32); - this.textBox1.SubmitButton = null; - this.textBox1.TabIndex = 152; - this.textBox1.UseSystemPasswordChar = false; - // - // label6 - // - this.label6.BackColor = System.Drawing.Color.Transparent; - this.label6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label6.Location = new System.Drawing.Point(18, 268); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(208, 32); - this.label6.TabIndex = 163; - this.label6.Text = "Run As Admin"; - this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label7 - // - this.label7.BackColor = System.Drawing.Color.Transparent; - this.label7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label7.Location = new System.Drawing.Point(18, 227); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(208, 32); - this.label7.TabIndex = 161; - this.label7.Text = "Window Style"; - this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label4 - // - this.label4.BackColor = System.Drawing.Color.Transparent; - this.label4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label4.Location = new System.Drawing.Point(18, 173); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(131, 32); - this.label4.TabIndex = 159; - this.label4.Text = "Working Directory"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label3 - // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label3.Location = new System.Drawing.Point(18, 132); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(131, 32); - this.label3.TabIndex = 157; - this.label3.Text = "Argument"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label2 - // - this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label2.Location = new System.Drawing.Point(18, 91); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(131, 32); - this.label2.TabIndex = 155; - this.label2.Text = "Filename"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label1 - // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label1.Location = new System.Drawing.Point(18, 50); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(131, 32); - this.label1.TabIndex = 153; - this.label1.Text = "Title"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // textBox2 - // - this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox2.BackColor = System.Drawing.Color.Transparent; - this.textBox2.FileDialog = null; - this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.textBox2.HighlightImage = ((System.Drawing.Image)(resources.GetObject("textBox2.HighlightImage"))); - this.textBox2.Location = new System.Drawing.Point(159, 91); - this.textBox2.Margin = new System.Windows.Forms.Padding(10, 3, 3, 3); - this.textBox2.Name = "textBox2"; - this.textBox2.NormalImage = ((System.Drawing.Image)(resources.GetObject("textBox2.NormalImage"))); - this.textBox2.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); - this.textBox2.Size = new System.Drawing.Size(220, 32); - this.textBox2.SubmitButton = null; - this.textBox2.TabIndex = 170; - this.textBox2.UseSystemPasswordChar = false; - // - // textBox3 - // - this.textBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox3.BackColor = System.Drawing.Color.Transparent; - this.textBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.textBox3.Location = new System.Drawing.Point(159, 132); - this.textBox3.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); - this.textBox3.Name = "textBox3"; - this.textBox3.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); - this.textBox3.Size = new System.Drawing.Size(220, 32); - this.textBox3.SubmitButton = null; - this.textBox3.TabIndex = 171; - this.textBox3.UseSystemPasswordChar = false; - // - // textBox4 - // - this.textBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox4.BackColor = System.Drawing.Color.Transparent; - this.textBox4.FolderDialog = null; - this.textBox4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.textBox4.HighlightImage = ((System.Drawing.Image)(resources.GetObject("textBox4.HighlightImage"))); - this.textBox4.Location = new System.Drawing.Point(159, 173); - this.textBox4.Margin = new System.Windows.Forms.Padding(10, 3, 3, 3); - this.textBox4.Name = "textBox4"; - this.textBox4.NormalImage = ((System.Drawing.Image)(resources.GetObject("textBox4.NormalImage"))); - this.textBox4.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); - this.textBox4.Size = new System.Drawing.Size(220, 32); - this.textBox4.SubmitButton = null; - this.textBox4.TabIndex = 172; - this.textBox4.UseSystemPasswordChar = false; - // - // button1 - // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.button1.BackColor = System.Drawing.Color.Transparent; - this.button1.DefaultImage = null; - this.button1.DownImage = null; - this.button1.LabelText = "&Save"; - this.button1.Location = new System.Drawing.Point(251, 427); - this.button1.Name = "button1"; - this.button1.OverImage = null; - this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.button1.Size = new System.Drawing.Size(128, 32); - this.button1.TabIndex = 173; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // pickerBox1 - // - this.pickerBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox1.BackColor = System.Drawing.Color.Transparent; - this.pickerBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.pickerBox1.Location = new System.Drawing.Point(239, 227); - this.pickerBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); - this.pickerBox1.Name = "pickerBox1"; - this.pickerBox1.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.pickerBox1.Size = new System.Drawing.Size(140, 32); - this.pickerBox1.SubmitButton = null; - this.pickerBox1.TabIndex = 174; - // - // pickerBox2 - // - this.pickerBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox2.BackColor = System.Drawing.Color.Transparent; - this.pickerBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.pickerBox2.Location = new System.Drawing.Point(239, 268); - this.pickerBox2.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); - this.pickerBox2.Name = "pickerBox2"; - this.pickerBox2.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.pickerBox2.Size = new System.Drawing.Size(140, 32); - this.pickerBox2.SubmitButton = null; - this.pickerBox2.TabIndex = 175; - // - // horizontalSeparator1 - // - this.horizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.horizontalSeparator1.Location = new System.Drawing.Point(10, 215); - this.horizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); - this.horizontalSeparator1.Name = "horizontalSeparator1"; - this.horizontalSeparator1.Size = new System.Drawing.Size(380, 2); - this.horizontalSeparator1.TabIndex = 176; - // - // horizontalSeparator2 - // - this.horizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.horizontalSeparator2.Location = new System.Drawing.Point(10, 310); - this.horizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2); - this.horizontalSeparator2.Name = "horizontalSeparator2"; - this.horizontalSeparator2.Size = new System.Drawing.Size(380, 2); - this.horizontalSeparator2.TabIndex = 177; - // - // AddTileForm - // - this.ClientSize = new System.Drawing.Size(400, 480); - this.Controls.Add(this.horizontalSeparator2); - this.Controls.Add(this.horizontalSeparator1); - this.Controls.Add(this.pickerBox2); - this.Controls.Add(this.pickerBox1); - this.Controls.Add(this.button1); - this.Controls.Add(this.textBox4); - this.Controls.Add(this.textBox3); - this.Controls.Add(this.textBox2); - this.Controls.Add(this.label6); - this.Controls.Add(this.label7); - this.Controls.Add(this.label4); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Controls.Add(this.textBox1); - this.Title = "Add Tile"; - this.Name = "AddTileForm"; - this.Controls.SetChildIndex(this.imgbxClose, 0); - this.Controls.SetChildIndex(this.panel1, 0); - this.Controls.SetChildIndex(this.area1, 0); - this.Controls.SetChildIndex(this.textBox1, 0); - this.Controls.SetChildIndex(this.label1, 0); - this.Controls.SetChildIndex(this.label2, 0); - this.Controls.SetChildIndex(this.label3, 0); - this.Controls.SetChildIndex(this.label4, 0); - this.Controls.SetChildIndex(this.label7, 0); - this.Controls.SetChildIndex(this.label6, 0); - this.Controls.SetChildIndex(this.textBox2, 0); - this.Controls.SetChildIndex(this.textBox3, 0); - this.Controls.SetChildIndex(this.textBox4, 0); - this.Controls.SetChildIndex(this.button1, 0); - this.Controls.SetChildIndex(this.pickerBox1, 0); - this.Controls.SetChildIndex(this.pickerBox2, 0); - this.Controls.SetChildIndex(this.horizontalSeparator1, 0); - this.Controls.SetChildIndex(this.horizontalSeparator2, 0); - ((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).EndInit(); - this.ResumeLayout(false); - - } - - private void button1_Click(object sender, EventArgs e) - { - TileModel model = buildModel(); - - if (this.TilePanelLayout != null) - { - this.TilePanelLayout.AddTile(model); - } - else if (this.ListBox != null) - { - int n = this.ListBox.ListBox.Items.Add(model); - this.ListBox.ListBox.SelectedIndex = n; - } - - this.Close(); - } - - protected TileModel buildModel() - { - TileModel rs = new TileModel() - { - Title = textBox1.Text?.Trim(), - ProcessFilename = textBox2.Text?.Trim(), - ProcessArgument = textBox3.Text?.Trim(), - ProcessWorkingDirectory = textBox4.Text?.Trim(), - ProcessWindowStyle = (System.Diagnostics.ProcessWindowStyle)pickerBox1.ComboBox.SelectedIndex, - ProcessAsAdmin = (pickerBox2.ComboBox.SelectedIndex == 1) - }; - - if (!this.AimCoord.Equals(new Point(-1, -1))) - { - rs.Position = this.AimCoord; - } - - return rs; - } - - } -} diff --git a/Windows/Forms/Tile/AddTileForm.resx b/Windows/Forms/Tile/AddTileForm.resx deleted file mode 100644 index e6f3e1a..0000000 --- a/Windows/Forms/Tile/AddTileForm.resx +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS4xYyqcSwAAANlJREFUOE+lU1sO - gjAQrHgRY6KemQ+VT9NrgAfgfRA+SawzdTAk2lhkkgm7s7vTAq0py/LUNM0dHEEXSfYWfd8fDQIOD23b - nvFMY6jeAcxpMFIwC1HX9YWzNOCWUunR4AxnvxpUVbV3zm2UGsbUlHoEDfBhdsgf4BWDCcmYGmtqCxtw - NeQcoJ6JjGn43hXy8CvIxDeIGbREZY+pHjLgtqeVHf7SzVq7VdmDM6x9GGj1/19h9UckVv3GWMwNRh5L - 6dGYH+UCHCTQ9SfV+7pMvJIIaLL0Oudd1x2eUQ8MyeAeq0cAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wgAADsIBFShKgAAAAK9JREFUOE/t0zsKwkAURuGp1BWJK3EhIrgAV+EOLLWwtRQLwQdiIbbiIkwynj+O - IVwnyhR2XvjyInNIkXHee8f0cEQBPbDOaKEarSvXhsAJO4wirlB4jipiA3phoIvIrLFChhnKiA3o8Ckw - RR93LNBODVwwwRL62kNKYIxNzQ1FSsDOEHk08HrYJMw/8KtA06/cCef6KJDZgDbTFrHNZO3x9idqOyui - m2+07bvPgHcPXOhtG3D6cUIAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wgAADsIBFShKgAAAAMZJREFUOE/tk7sNwjAQQF3BRohJGAQhMQBTsAElFLSUiAKJTxIXhBZlCILNuyRG - iXEQKeg46fmsO/slhU9Za5XWehiXYcD6JElygZ6qhdwTioVDGo4wDXDjsohXdYkvMDTHVa8R9Hb0tpCz - XzqJL5Df/CRYRFE0Yn8nr9M07XcSwBXmXN6QDfncRTCjt6+Rgfla4Adfn3D+ERS4Yht/wY8FxVN2xTac - gLP5qyYLAhmmA4SGyeeEoPkSq3EWydsoB4gRDEqBVU/p15ajstHKCgAAAABJRU5ErkJggg== - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - xAAADsQBlSsOGwAAAJtJREFUOE/t0zEKwkAQheEpvILHSLySlTeJ6AnEzpPYi0ERPIKWKtZKNv9LNS5x - E6xS+OCDJew8tsgYmeCECsGZo1dKXLBwtnghQ2fe0JDPGHecsW6xwgwjNM8tdIgyxQ0qij2gORV9LejK - Bk8dfi3QjGY/C0IISS7/gkEVtP3KfbKEZm0PLZM++IVK0d0rdrAcR8TrnKK7BzPLa7Wb+WX/Nb8PAAAA - AElFTkSuQmCC - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - xAAADsQBlSsOGwAAALZJREFUOE/tkzEKwjAYRjt4BY9hvZKTN1HsCYqbJzGzKBGb9gY6qjgrxvdJK7ZS - Gpwc/ODBnzTvg0AT5Xk+hB3cwVc456ZRSIqi2MAeafbGEq5Zlg3KY+1Bvkkql89Ya/vsnUCZN8FJYWyM - 6ekKnsWkdF9hb8S3I6ioyRnkpa0FXcFbwOXrAjlyawXe+06q/At+qoDh41cOCU4iV8OaQY8pUVEgOnuA - VcSzjRm2UHvOHeisdc7FDwDnJKIbLgP9AAAAAElFTkSuQmCC - - - \ No newline at end of file diff --git a/Windows/Forms/Tile/EditGroupForm.resx b/Windows/Forms/Tile/EditGroupForm.resx deleted file mode 100644 index 3747e00..0000000 --- a/Windows/Forms/Tile/EditGroupForm.resx +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS4xYyqcSwAAANlJREFUOE+lU1sO - gjAQrHgRY6KemQ+VT9NrgAfgfRA+SawzdTAk2lhkkgm7s7vTAq0py/LUNM0dHEEXSfYWfd8fDQIOD23b - nvFMY6jeAcxpMFIwC1HX9YWzNOCWUunR4AxnvxpUVbV3zm2UGsbUlHoEDfBhdsgf4BWDCcmYGmtqCxtw - NeQcoJ6JjGn43hXy8CvIxDeIGbREZY+pHjLgtqeVHf7SzVq7VdmDM6x9GGj1/19h9UckVv3GWMwNRh5L - 6dGYH+UCHCTQ9SfV+7pMvJIIaLL0Oudd1x2eUQ8MyeAeq0cAAAAASUVORK5CYII= - - - \ No newline at end of file diff --git a/Windows/Forms/Tile/EditListTileForm.cs b/Windows/Forms/Tile/EditListTileForm.cs deleted file mode 100644 index d901c45..0000000 --- a/Windows/Forms/Tile/EditListTileForm.cs +++ /dev/null @@ -1,302 +0,0 @@ -using AppLauncher.Models; -using RyzStudio.Windows.ThemedForms; -using System; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Windows.Forms; - -namespace AppLauncher.Windows.Forms -{ - public class EditListTileForm : TDialogForm - { - public static void ShowDialog(TTilePanel control) - { - EditListTileForm form = new EditListTileForm(); - form.TilePanel = control; - form.ShowDialog(); - } - - private System.Windows.Forms.Label label1; - private TButton button1; - private RyzStudio.Windows.Forms.THorizontalSeparator horizontalSeparator2; - private TTextBox textBox1; - private TListBox listBox1; - private System.Windows.Forms.Label label2; - - public TTilePanel TilePanel { get; set; } = null; - - public EditListTileForm() : base() - { - InitializeComponent(); - } - - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditListTileForm)); - RyzStudio.Windows.ThemedForms.TButton.ButtonStyle buttonStyle1 = new RyzStudio.Windows.ThemedForms.TButton.ButtonStyle(); - RyzStudio.Windows.ThemedForms.TButton.ButtonStyle buttonStyle2 = new RyzStudio.Windows.ThemedForms.TButton.ButtonStyle(); - RyzStudio.Windows.ThemedForms.TButton.ButtonStyle buttonStyle3 = new RyzStudio.Windows.ThemedForms.TButton.ButtonStyle(); - this.textBox1 = new RyzStudio.Windows.ThemedForms.TTextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.button1 = new RyzStudio.Windows.ThemedForms.TButton(); - this.horizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.listBox1 = new RyzStudio.Windows.ThemedForms.TListBox(); - this.label2 = new System.Windows.Forms.Label(); - ((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit(); - this.SuspendLayout(); - // - // imgbxClose - // - this.imgbxClose.Image = ((System.Drawing.Image)(resources.GetObject("imgbxClose.Image"))); - this.imgbxClose.Location = new System.Drawing.Point(367, 5); - // - // lblDescription - // - this.Title = "Edit List Tile"; - // - // panel1 - // - this.panel1.Location = new System.Drawing.Point(394, 474); - // - // area1 - // - this.area1.Location = new System.Drawing.Point(1, 474); - this.area1.Size = new System.Drawing.Size(392, 5); - // - // textBox1 - // - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox1.BackColor = System.Drawing.Color.Transparent; - this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.textBox1.Location = new System.Drawing.Point(159, 50); - this.textBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); - this.textBox1.Name = "textBox1"; - this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9); - this.textBox1.Size = new System.Drawing.Size(220, 32); - this.textBox1.SubmitButton = null; - this.textBox1.TabIndex = 152; - this.textBox1.UseSystemPasswordChar = false; - // - // label1 - // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label1.Location = new System.Drawing.Point(18, 50); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(131, 32); - this.label1.TabIndex = 153; - this.label1.Text = "Title"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // button1 - // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.button1.BackColor = System.Drawing.Color.Transparent; - this.button1.DefaultImage = null; - this.button1.DownImage = null; - this.button1.LabelText = "&Save"; - this.button1.Location = new System.Drawing.Point(251, 427); - this.button1.Name = "button1"; - this.button1.OverImage = null; - this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.button1.Size = new System.Drawing.Size(128, 32); - this.button1.TabIndex = 173; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // horizontalSeparator2 - // - this.horizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.horizontalSeparator2.Location = new System.Drawing.Point(10, 92); - this.horizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2); - this.horizontalSeparator2.Name = "horizontalSeparator2"; - this.horizontalSeparator2.Size = new System.Drawing.Size(380, 2); - this.horizontalSeparator2.TabIndex = 177; - // - // listBox1 - // - this.listBox1.AllowDrop = true; - this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.listBox1.BackColor = System.Drawing.Color.Transparent; - this.listBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.listBox1.Location = new System.Drawing.Point(159, 101); - this.listBox1.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); - this.listBox1.Name = "listBox1"; - this.listBox1.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.listBox1.Size = new System.Drawing.Size(220, 280); - this.listBox1.SubmitButton = null; - this.listBox1.TabIndex = 180; - this.listBox1.OnAdd += new System.EventHandler(this.listBox1_OnAdd); - this.listBox1.OnEdit += new System.EventHandler(this.listBox1_OnEdit); - this.listBox1.DragDrop += new System.Windows.Forms.DragEventHandler(this.listBox1_DragDrop); - this.listBox1.DragOver += new System.Windows.Forms.DragEventHandler(this.listBox1_DragOver); - // - // label2 - // - this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104))))); - this.label2.Location = new System.Drawing.Point(18, 104); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(131, 32); - this.label2.TabIndex = 181; - this.label2.Text = "List"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // EditListTileForm - // - this.ClientSize = new System.Drawing.Size(400, 480); - this.Controls.Add(this.label2); - this.Controls.Add(this.listBox1); - this.Controls.Add(this.horizontalSeparator2); - this.Controls.Add(this.button1); - this.Controls.Add(this.label1); - this.Controls.Add(this.textBox1); - this.Title = "Edit List Tile"; - this.Name = "EditListTileForm"; - this.Controls.SetChildIndex(this.imgbxClose, 0); - this.Controls.SetChildIndex(this.panel1, 0); - this.Controls.SetChildIndex(this.area1, 0); - this.Controls.SetChildIndex(this.textBox1, 0); - this.Controls.SetChildIndex(this.label1, 0); - this.Controls.SetChildIndex(this.button1, 0); - this.Controls.SetChildIndex(this.horizontalSeparator2, 0); - this.Controls.SetChildIndex(this.listBox1, 0); - this.Controls.SetChildIndex(this.label2, 0); - ((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).EndInit(); - this.ResumeLayout(false); - - } - - protected override void OnShown(EventArgs e) - { - base.OnShown(e); - - listBox1.ListBox.Items.Clear(); - - if (this.TilePanel == null) return; - if (this.TilePanel.ModelInfo == null) return; - - textBox1.Text = this.TilePanel.ModelInfo.Title; - - if (this.TilePanel.ModelInfo.Items != null) - { - foreach (TileModel item in this.TilePanel.ModelInfo.Items) - { - if (item.IsGroup) - { - continue; - } - - listBox1.ListBox.Items.Add(item); - } - } - } - - private void button1_Click(object sender, EventArgs e) - { - TileModel model = new TileModel() - { - Title = textBox1.Text?.Trim(), - IsGroup = true - }; - - model.Items = new System.Collections.Generic.List(); - - foreach (TileModel item in listBox1.ListBox.Items.OfType()) - { - if (item.IsGroup) - { - continue; - } - - model.Items.Add(item); - } - - this.TilePanel.LoadInfo(model); - - this.Close(); - } - - private void listBox1_OnAdd(object sender, EventArgs e) => AddTileForm.ShowDialog(listBox1); - - private void listBox1_OnEdit(object sender, EventArgs e) - { - if (listBox1.ListBox.Items.Count <= 0) - { - return; - } - - EditTileForm.ShowDialog(listBox1); - } - - private void listBox1_DragOver(object sender, System.Windows.Forms.DragEventArgs e) - { - if (e.Data.GetDataPresent(DataFormats.FileDrop)) - { - e.Effect = DragDropEffects.Link; - } - else - { - e.Effect = DragDropEffects.None; - } - } - - private void listBox1_DragDrop(object sender, DragEventArgs e) - { - string[] fileList = e.Data.GetData(DataFormats.FileDrop) as string[]; - if (fileList == null) - { - return; - } - - if (fileList.Length <= 0) - { - return; - } - - if (string.IsNullOrWhiteSpace(fileList[0])) - { - return; - } - - TileModel model = new TileModel() - { - ProcessFilename = fileList[0], - Title = Path.GetFileName(fileList[0]) - }; - - // exe - if (Path.GetExtension(fileList[0]).Equals(".exe", StringComparison.CurrentCultureIgnoreCase)) - { - if (File.Exists(fileList[0])) - { - try - { - FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(fileList[0]); - if (fvi != null) - { - model.Title = fvi.ProductName; - } - } - catch - { - // do nothing - } - } - - if (string.IsNullOrWhiteSpace(model.Title)) - { - model.Title = Path.GetFileNameWithoutExtension(fileList[0]); - } - } - - listBox1.ListBox.Items.Add(model); - } - - } -} \ No newline at end of file diff --git a/Windows/Forms/Tile/EditListTileForm.resx b/Windows/Forms/Tile/EditListTileForm.resx deleted file mode 100644 index 3747e00..0000000 --- a/Windows/Forms/Tile/EditListTileForm.resx +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS4xYyqcSwAAANlJREFUOE+lU1sO - gjAQrHgRY6KemQ+VT9NrgAfgfRA+SawzdTAk2lhkkgm7s7vTAq0py/LUNM0dHEEXSfYWfd8fDQIOD23b - nvFMY6jeAcxpMFIwC1HX9YWzNOCWUunR4AxnvxpUVbV3zm2UGsbUlHoEDfBhdsgf4BWDCcmYGmtqCxtw - NeQcoJ6JjGn43hXy8CvIxDeIGbREZY+pHjLgtqeVHf7SzVq7VdmDM6x9GGj1/19h9UckVv3GWMwNRh5L - 6dGYH+UCHCTQ9SfV+7pMvJIIaLL0Oudd1x2eUQ8MyeAeq0cAAAAASUVORK5CYII= - - - \ No newline at end of file diff --git a/Windows/Forms/Tile/TTilePanel.Designer.cs b/Windows/Forms/TilePanel.Designer.cs similarity index 51% rename from Windows/Forms/Tile/TTilePanel.Designer.cs rename to Windows/Forms/TilePanel.Designer.cs index 84b30d3..6334cd0 100644 --- a/Windows/Forms/Tile/TTilePanel.Designer.cs +++ b/Windows/Forms/TilePanel.Designer.cs @@ -1,6 +1,6 @@ -namespace AppLauncher.Windows.Forms +namespace FizzyLauncher.Windows.Forms { - partial class TTilePanel + partial class TilePanel { /// /// Required designer variable. @@ -29,31 +29,13 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.label1 = new System.Windows.Forms.Label(); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.contextMenuStrip1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // - // label1 - // - this.label1.AutoEllipsis = true; - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.ContextMenuStrip = this.contextMenuStrip1; - this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(234)))), ((int)(((byte)(234))))); - this.label1.Location = new System.Drawing.Point(0, 47); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(70, 13); - this.label1.TabIndex = 24; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.label1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseClick); - this.label1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseDoubleClick); - // // contextMenuStrip1 // this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -76,46 +58,22 @@ this.removeToolStripMenuItem.Text = "&Remove"; this.removeToolStripMenuItem.Click += new System.EventHandler(this.removeToolStripMenuItem_Click); // - // pictureBox1 + // TTilePanel // - this.pictureBox1.BackColor = System.Drawing.Color.Transparent; - this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.pictureBox1.ContextMenuStrip = this.contextMenuStrip1; - this.pictureBox1.ErrorImage = null; - this.pictureBox1.InitialImage = null; - this.pictureBox1.Location = new System.Drawing.Point(0, 8); - this.pictureBox1.Margin = new System.Windows.Forms.Padding(0); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(70, 38); - this.pictureBox1.TabIndex = 25; - this.pictureBox1.TabStop = false; - this.pictureBox1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseClick); - this.pictureBox1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseDoubleClick); - // - // TilePanel - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.pictureBox1); - this.Controls.Add(this.label1); this.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(234)))), ((int)(((byte)(234))))); - this.Margin = new System.Windows.Forms.Padding(3, 3, 0, 0); - this.MaximumSize = new System.Drawing.Size(70, 70); - this.MinimumSize = new System.Drawing.Size(70, 70); - this.Name = "TilePanel"; - this.Size = new System.Drawing.Size(70, 70); - this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseClick); - this.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseDoubleClick); + this.Margin = new System.Windows.Forms.Padding(4, 3, 0, 0); + this.MaximumSize = new System.Drawing.Size(82, 81); + this.MinimumSize = new System.Drawing.Size(82, 81); + this.Name = "TTilePanel"; + this.Size = new System.Drawing.Size(82, 81); this.contextMenuStrip1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); } #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem; diff --git a/Windows/Forms/Tile/TTilePanel.cs b/Windows/Forms/TilePanel.cs similarity index 74% rename from Windows/Forms/Tile/TTilePanel.cs rename to Windows/Forms/TilePanel.cs index 88ad239..237b67d 100644 --- a/Windows/Forms/Tile/TTilePanel.cs +++ b/Windows/Forms/TilePanel.cs @@ -1,4 +1,4 @@ -using AppLauncher.Models; +using FizzyLauncher.Models; using RyzStudio.Windows.Forms; using System; using System.ComponentModel; @@ -6,38 +6,54 @@ using System.Diagnostics; using System.Drawing; using System.IO; using System.Windows.Forms; +using AppResource = FizzyLauncher.AppResource; -namespace AppLauncher.Windows.Forms +namespace FizzyLauncher.Windows.Forms { - public partial class TTilePanel : TUserControl + public partial class TilePanel : TUserControl { protected bool isDragging = false; protected Point startPosition = new Point(); + protected int imageLeft = 0; + protected int imageTop = 11; + protected int labelMargin = 3; + protected int labelTop = 47; + protected Rectangle labelRectangle = new Rectangle(); + + protected string title = ""; + protected Image icon = null; protected ContextMenuStrip groupContextMenu = null; protected TileModel modelInfo = new TileModel(); - public TTilePanel() : base() + + public TilePanel() : base() { InitializeComponent(); + this.AllowDrop = true; + this.AutoSize = false; this.BackColor = Color.FromArgb(250, 250, 250); this.ContextMenuStrip = contextMenuStrip1; this.DoubleBuffered = true; + this.Font = new Font(this.Font.FontFamily, 8.25F); + this.ForeColor = Color.FromArgb(99, 105, 119); + this.Size = new Size(70, 70); + this.MaximumSize = this.MinimumSize = this.Size; + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + this.AllowDrop = true; - - label1.ForeColor = Color.FromArgb(99, 105, 119); - label1.Font = new Font(this.Font.FontFamily, 8.25F); - - this.MouseDown += panel_MouseDown; - this.MouseUp += panel_MouseUp; - this.MouseMove += panel_MouseMove; - pictureBox1.MouseDown += panel_MouseDown; - pictureBox1.MouseUp += panel_MouseUp; - pictureBox1.MouseMove += panel_MouseMove; - label1.MouseDown += panel_MouseDown; - label1.MouseUp += panel_MouseUp; - label1.MouseMove += panel_MouseMove; + this.AutoSize = false; + this.BackColor = Color.FromArgb(250, 250, 250); + this.ContextMenuStrip = contextMenuStrip1; + this.DoubleBuffered = true; + this.Font = new Font(this.Font.FontFamily, 8.25F); + this.Size = new Size(70, 70); + this.MaximumSize = this.MinimumSize = this.Size; } protected override void OnPaint(PaintEventArgs e) @@ -46,20 +62,57 @@ namespace AppLauncher.Windows.Forms Graphics g = e.Graphics; + + if (this.Image != null) + { + g.DrawImage(this.Image, new Point(imageLeft, imageTop)); + } + + if (!string.IsNullOrWhiteSpace(this.Title)) + { + TextRenderer.DrawText(e.Graphics, this.Title, this.Font, labelRectangle, this.ForeColor, TextFormatFlags.HorizontalCenter | TextFormatFlags.NoPadding | TextFormatFlags.EndEllipsis); + } + g.DrawRectangle(new Pen(Color.FromArgb(204, 206, 218), 1), new Rectangle(this.DisplayRectangle.X, this.DisplayRectangle.Y, (this.DisplayRectangle.Width - 1), (this.DisplayRectangle.Height - 1))); } - [Category("Appearance"), Browsable(true)] - public string Title { get => label1.Text; protected set => label1.Text = value; } + [Category("Tile"), Browsable(true)] + public Image Image + { + get => icon; + protected set + { + icon = value; + + if (icon == null) + { + imageLeft = 0; + } + else + { + imageLeft = (this.Width - icon.Width) / 2; + } + } + } + + [Category("Tile"), Browsable(true)] + public string Title + { + get => title; + protected set + { + title = value; + + labelRectangle = new Rectangle(labelMargin, labelTop, (this.Width - (labelMargin * 2)), (this.Height - labelTop - 1)); + } + } - [Category("Appearance"), Browsable(true)] - public Image Image { get => pictureBox1.BackgroundImage; protected set => pictureBox1.BackgroundImage = value; } [Browsable(false)] public TileModel ModelInfo => modelInfo; - public TTilePanelLayout PanelContainer + public TilePanelLayout PanelContainer { get { @@ -68,12 +121,12 @@ namespace AppLauncher.Windows.Forms return null; } - if (this.Parent.GetType() != typeof(TTilePanelLayout)) + if (this.Parent.GetType() != typeof(TilePanelLayout)) { return null; } - return (TTilePanelLayout)this.Parent; + return (TilePanelLayout)this.Parent; } } @@ -103,6 +156,89 @@ namespace AppLauncher.Windows.Forms e.Effect = (e.Data.GetDataPresent(DataFormats.FileDrop)) ? DragDropEffects.Link : DragDropEffects.None; } + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseUp(e); + + isDragging = false; + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + TilePanelLayout container = this.PanelContainer; + if (container == null) + { + return; + } + + this.BringToFront(); + + if (((e.Button == MouseButtons.Left) && (Control.ModifierKeys == Keys.Control)) || (e.Button == MouseButtons.Right)) + { + isDragging = true; + startPosition = e.Location; + } + } + + protected override void OnMouseClick(MouseEventArgs e) + { + base.OnMouseClick(e); + + if (Control.ModifierKeys == Keys.Control) return; + if (this.ModelInfo == null) return; + + if (e.Button == MouseButtons.Left) + { + if (this.ModelInfo.IsGroup) + { + if (groupContextMenu != null) + { + invalidateGroupMenuSize(); + + groupContextMenu.Show(this, e.Location); + } + } + else + { + OnMouseDoubleClick(e); + } + } + } + + protected override void OnMouseDoubleClick(MouseEventArgs e) + { + base.OnMouseDoubleClick(e); + + if (Control.ModifierKeys == Keys.Control) return; + + if (e.Button == MouseButtons.Left) + { + execute(this.ModelInfo); + } + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + + if (isDragging) + { + TilePanelLayout layoutPanel = this.PanelContainer; + if (layoutPanel == null) + { + return; + } + + int x = (this.Location.X + (e.Location.X - startPosition.X)); + int y = (this.Location.Y + (e.Location.Y - startPosition.Y)); + + layoutPanel.MoveTile(this, x, y); + } + } + + public void DropFileList(string[] fileList) { if (fileList == null) @@ -163,7 +299,7 @@ namespace AppLauncher.Windows.Forms if (this.modelInfo.IsGroup) { - this.Image = Properties.Resources.folder_32; + this.Image = AppResource.folder_32; invalidateGroupMenu(this.modelInfo); } @@ -173,91 +309,17 @@ namespace AppLauncher.Windows.Forms } toolTip1.SetToolTip(this, this.Title); - toolTip1.SetToolTip(pictureBox1, this.Title); - toolTip1.SetToolTip(label1, this.Title); - } - - private void panel_MouseDown(object sender, MouseEventArgs e) - { - TTilePanelLayout container = this.PanelContainer; - if (container == null) - { - return; - } - - this.BringToFront(); - - if (((e.Button == MouseButtons.Left) && (Control.ModifierKeys == Keys.Control)) || (e.Button == MouseButtons.Right)) - { - isDragging = true; - startPosition = e.Location; - } - } - - private void panel_MouseUp(object sender, MouseEventArgs e) - { - isDragging = false; - } - - private void panel_MouseMove(object sender, MouseEventArgs e) - { - if (isDragging) - { - TTilePanelLayout layoutPanel = this.PanelContainer; - if (layoutPanel == null) - { - return; - } - - int x = (this.Location.X + (e.Location.X - startPosition.X)); - int y = (this.Location.Y + (e.Location.Y - startPosition.Y)); - - layoutPanel.MoveTile(this, x, y); - } - } - - private void panel_MouseClick(object sender, MouseEventArgs e) - { - if (Control.ModifierKeys == Keys.Control) return; - if (this.ModelInfo == null) return; - - if (e.Button == MouseButtons.Left) - { - if (this.ModelInfo.IsGroup) - { - if (groupContextMenu != null) - { - invalidateGroupMenuSize(); - - groupContextMenu.Show(this, e.Location); - } - } - else - { - panel_MouseDoubleClick(sender, e); - } - } - } - - private void panel_MouseDoubleClick(object sender, MouseEventArgs e) - { - if (Control.ModifierKeys == Keys.Control) return; - - if (e.Button == MouseButtons.Left) - { - execute(this.ModelInfo); - } } private void editToolStripMenuItem_Click(object sender, EventArgs e) { if (this.ModelInfo.IsGroup) { - EditListTileForm.ShowDialog(this); + EditTileFolderForm.ShowEditDialog(this); } else { - EditTileForm.ShowDialog(this); + EditTileForm.ShowEditDialog(this); } } diff --git a/Windows/Forms/TilePanel.resx b/Windows/Forms/TilePanel.resx new file mode 100644 index 0000000..60ff723 --- /dev/null +++ b/Windows/Forms/TilePanel.resx @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + + 172, 17 + + \ No newline at end of file diff --git a/Windows/Forms/Tile/TTilePanelLayout.Designer.cs b/Windows/Forms/TilePanelLayout.Designer.cs similarity index 98% rename from Windows/Forms/Tile/TTilePanelLayout.Designer.cs rename to Windows/Forms/TilePanelLayout.Designer.cs index 7f5696d..9da7f33 100644 --- a/Windows/Forms/Tile/TTilePanelLayout.Designer.cs +++ b/Windows/Forms/TilePanelLayout.Designer.cs @@ -1,6 +1,6 @@ -namespace AppLauncher.Windows.Forms +namespace FizzyLauncher.Windows.Forms { - partial class TTilePanelLayout + partial class TilePanelLayout { /// /// Required designer variable. @@ -174,7 +174,7 @@ // this.label1.AutoSize = true; this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(99)))), ((int)(((byte)(105)))), ((int)(((byte)(119))))); - this.label1.Image = global::AppLauncher.Properties.Resources.toggle_left_ea_16; + this.label1.Image = global::FizzyLauncher.AppResource.toggle_left_ea_16; this.label1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.label1.Location = new System.Drawing.Point(227, 72); this.label1.Margin = new System.Windows.Forms.Padding(0); diff --git a/Windows/Forms/Tile/TTilePanelLayout.cs b/Windows/Forms/TilePanelLayout.cs similarity index 91% rename from Windows/Forms/Tile/TTilePanelLayout.cs rename to Windows/Forms/TilePanelLayout.cs index e0a0fb6..a975ba2 100644 --- a/Windows/Forms/Tile/TTilePanelLayout.cs +++ b/Windows/Forms/TilePanelLayout.cs @@ -1,8 +1,7 @@ -using AppLauncher.Models; +using FizzyLauncher.Models; using RyzStudio.Windows.Forms; using System; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.IO; @@ -10,22 +9,27 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; +using AppResource = FizzyLauncher.AppResource; -namespace AppLauncher.Windows.Forms +namespace FizzyLauncher.Windows.Forms { - public partial class TTilePanelLayout : TUserControl + public partial class TilePanelLayout : TUserControl { + public static int CalcWidth(int tileCount) => (tileCount * tileSize) + ((tileCount - 1) * margin); + + public class Item { - public TTilePanel Tile { get; set; } + public TilePanel Tile { get; set; } public Point Coord { get; set; } = new Point(0, 0); } - protected readonly int tileSize = 70; - protected readonly int margin = 3; - protected readonly int labelHeight = 20; - protected readonly int collapseIncrement = 6; - protected readonly int expandIncrement = 8; + + protected const int tileSize = 70; + protected const int margin = 3; + protected const int labelHeight = 20; + protected const int collapseIncrement = 6; + protected const int expandIncrement = 8; protected TileGroupModel groupModel = null; protected List items = new List(); @@ -38,7 +42,8 @@ namespace AppLauncher.Windows.Forms protected Point lastMousePosition = new Point(); protected Point gridSize = new Point(); - public TTilePanelLayout(TileGroupModel model) : base() + + public TilePanelLayout(TileGroupModel model) : base() { InitializeComponent(); @@ -77,10 +82,6 @@ namespace AppLauncher.Windows.Forms this.Margin = new Padding(0); this.Padding = new Padding(0, 0, 0, 10); - //this.MaximumSize = new Size(panel1.Width, ExpandedHeight); - //this.MinimumSize = new Size(panel1.Width, label1.Height); - //this.Size = this.MaximumSize; - //this.Size = new Size(panel1.Width, this.ExpandedHeight); } protected override async void OnResize(EventArgs e) @@ -119,14 +120,7 @@ namespace AppLauncher.Windows.Forms public Point GridSize { - get - { - //int w = (int)Math.Floor(decimal.Divide(this.Width, this.TileSize)); - //int h = (int)Math.Floor(decimal.Divide(this.Height - labelHeight, this.TileSize)); - - //return new Point(w, h); - return gridSize; - } + get => gridSize; } public bool EnableAnimation @@ -305,7 +299,7 @@ namespace AppLauncher.Windows.Forms tile.Position = newCoord.Value; - TTilePanel panel = new TTilePanel(); + TilePanel panel = new TilePanel(); panel.LoadInfo(tile); panel.Location = convertCoordToLocation(tile.Position); @@ -411,7 +405,7 @@ namespace AppLauncher.Windows.Forms return; } - this.FlowLayoutPanel.Controls.Add(new TTilePanelLayout(new TileGroupModel() + this.FlowLayoutPanel.Controls.Add(new TilePanelLayout(new TileGroupModel() { Title = "New Group", GridSize = new Size(8, 1) @@ -429,7 +423,7 @@ namespace AppLauncher.Windows.Forms isChecked = groupModel.IsExpanded; label1.Text = " " + groupModel?.Title; - label1.Image = (isChecked ? Properties.Resources.toggle_right_ea_16 : Properties.Resources.toggle_left_ea_16); + label1.Image = (isChecked ? AppResource.toggle_right_ea_16 : AppResource.toggle_left_ea_16); this.SetGridSize(groupModel.GridSize.Width, groupModel.GridSize.Height); this.LoadTiles(model.Items); @@ -470,7 +464,7 @@ namespace AppLauncher.Windows.Forms } // place control - TTilePanel panel = new TTilePanel(); + TilePanel panel = new TilePanel(); panel.LoadInfo(item); panel.Location = convertCoordToLocation(confirmedPosition.Value); @@ -484,7 +478,7 @@ namespace AppLauncher.Windows.Forms } } - public void MoveTile(TTilePanel panel, int posX, int posY) + public void MoveTile(TilePanel panel, int posX, int posY) { Item item = items.Where(x => x.Tile.Equals(panel)).FirstOrDefault(); if (item == null) @@ -579,7 +573,7 @@ namespace AppLauncher.Windows.Forms this.FlowLayoutPanel.Controls.Remove(this); } - public void Remove(TTilePanel panel) + public void Remove(TilePanel panel) { Item m = items.Where(x => x.Tile.Equals(panel)).FirstOrDefault(); if (m != null) @@ -594,11 +588,11 @@ namespace AppLauncher.Windows.Forms { gridSize = new Point(width, height); - groupModel.GridSize.Height = height; + groupModel.GridSize = new Size(groupModel.GridSize.Width, height); expandedHeight = (this.TileSize * height) + labelHeight; - int w = (this.TileSize * gridSize.X); + int w = CalcWidth(gridSize.X); this.Size = new Size(w, (isChecked ? this.ExpandedHeight : this.CollapseHeight)); } @@ -774,14 +768,14 @@ namespace AppLauncher.Windows.Forms { Point coord = convertLocationToCoord(lastMousePosition.X, lastMousePosition.Y); - AddTileForm.ShowDialog(this, coord); + EditTileForm.ShowAddDialog(this, coord); } private void addListTileMenuItem_Click(object sender, EventArgs e) { Point coord = convertLocationToCoord(lastMousePosition.X, lastMousePosition.Y); - AddListTileForm.ShowDialog(this, coord); + EditTileFolderForm.ShowAddDialog(this, coord); } private void addGroupMenuItem_Click(object sender, EventArgs e) => this.AddGroup(); @@ -817,7 +811,7 @@ namespace AppLauncher.Windows.Forms { isChecked = !isChecked; - label1.Image = (isChecked ? Properties.Resources.toggle_right_ea_16 : Properties.Resources.toggle_left_ea_16); + label1.Image = (isChecked ? AppResource.toggle_right_ea_16 : AppResource.toggle_left_ea_16); this.Invalidate(); @@ -830,7 +824,7 @@ namespace AppLauncher.Windows.Forms { if (this.FlowLayoutPanel != null) { - foreach (TTilePanelLayout item in this.FlowLayoutPanel.Controls.OfType()) + foreach (TilePanelLayout item in this.FlowLayoutPanel.Controls.OfType()) { if (item.Equals(this)) { @@ -843,7 +837,7 @@ namespace AppLauncher.Windows.Forms } } - label1.Image = (isChecked ? Properties.Resources.toggle_right_ea_16 : Properties.Resources.toggle_left_ea_16); + label1.Image = (isChecked ? AppResource.toggle_right_ea_16 : AppResource.toggle_left_ea_16); } else if (e.Button == MouseButtons.Right) { diff --git a/Windows/Forms/Tile/TTilePanelLayout.resx b/Windows/Forms/TilePanelLayout.resx similarity index 100% rename from Windows/Forms/Tile/TTilePanelLayout.resx rename to Windows/Forms/TilePanelLayout.resx diff --git a/build-release.bat b/build-release.bat deleted file mode 100644 index 4647cd4..0000000 --- a/build-release.bat +++ /dev/null @@ -1,2 +0,0 @@ -"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" "skye.sln" /T:Build /P:Configuration=Release -PAUSE \ No newline at end of file diff --git a/installer.iss b/installer-64.iss similarity index 76% rename from installer.iss rename to installer-64.iss index 354cdaf..0928c3f 100644 --- a/installer.iss +++ b/installer-64.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "Fizzy Launcher" -#define MyAppVersion "0.1.2.016" +#define MyAppVersion "0.2.1.055" #define MyAppPublisher "Hi, I'm Ray" #define MyAppURL "https://www.hiimray.co.uk/software-fizzy-launcher" #define MyAppExeName "fizzylauncher.exe" @@ -24,7 +24,7 @@ DisableProgramGroupPage=yes ; Remove the following line to run in administrative install mode (install for all users.) PrivilegesRequired=lowest OutputDir=L:\gitlab-hiimray\fizzy-launcher\bin -OutputBaseFilename=fizzy-launcher +OutputBaseFilename=fizzy-launcher-64 Compression=lzma SolidCompression=yes WizardStyle=modern @@ -36,10 +36,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl" Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked [Files] -Source: "L:\gitlab-hiimray\fizzy-launcher\bin\Release\fizzylauncher.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "L:\gitlab-hiimray\fizzy-launcher\bin\Release\fizzylauncher.ui.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "L:\gitlab-hiimray\fizzy-launcher\bin\Release\Newtonsoft.Json.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "L:\gitlab-hiimray\fizzy-launcher\bin\Release\Newtonsoft.Json.xml"; DestDir: "{app}"; Flags: ignoreversion +Source: "L:\gitlab-hiimray\fizzy-launcher\bin\Release\64\fizzylauncher.exe"; DestDir: "{app}"; Flags: ignoreversion ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons] diff --git a/installer-86.iss b/installer-86.iss new file mode 100644 index 0000000..55499af --- /dev/null +++ b/installer-86.iss @@ -0,0 +1,49 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "Fizzy Launcher" +#define MyAppVersion "0.2.1.055" +#define MyAppPublisher "Hi, I'm Ray" +#define MyAppURL "https://www.hiimray.co.uk/software-fizzy-launcher" +#define MyAppExeName "fizzylauncher.exe" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{472ED37C-C4FC-4B72-8BC3-C281A6E0D2F9} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={autopf}\{#MyAppName} +DefaultGroupName={#MyAppName} +DisableProgramGroupPage=yes +; Remove the following line to run in administrative install mode (install for all users.) +PrivilegesRequired=lowest +OutputDir=L:\gitlab-hiimray\fizzy-launcher\bin +OutputBaseFilename=fizzy-launcher-86 +Compression=lzma +SolidCompression=yes +WizardStyle=modern + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "L:\gitlab-hiimray\fizzy-launcher\bin\Release\86\fizzylauncher.exe"; DestDir: "{app}"; Flags: ignoreversion +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent + diff --git a/packages.config b/packages.config deleted file mode 100644 index a9de8b5..0000000 --- a/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/skye.sln b/skye.sln deleted file mode 100644 index f67c029..0000000 --- a/skye.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30523.141 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FizzyLauncher", "FizzyLauncher.csproj", "{66C1C75C-3612-4D23-B937-C3DE0D653292}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FizzyLauncher.UI", "FizzyLauncher.UI\FizzyLauncher.UI.csproj", "{D9A49347-583F-41B4-AFE1-63EC80BBDB38}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {66C1C75C-3612-4D23-B937-C3DE0D653292}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {66C1C75C-3612-4D23-B937-C3DE0D653292}.Debug|Any CPU.Build.0 = Debug|Any CPU - {66C1C75C-3612-4D23-B937-C3DE0D653292}.Release|Any CPU.ActiveCfg = Release|Any CPU - {66C1C75C-3612-4D23-B937-C3DE0D653292}.Release|Any CPU.Build.0 = Release|Any CPU - {D9A49347-583F-41B4-AFE1-63EC80BBDB38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D9A49347-583F-41B4-AFE1-63EC80BBDB38}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D9A49347-583F-41B4-AFE1-63EC80BBDB38}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D9A49347-583F-41B4-AFE1-63EC80BBDB38}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {517C5E2C-E479-4B03-A992-C875F8B7ABCD} - EndGlobalSection -EndGlobal