diff --git a/.ci/code/UI_Test/Properties/AssemblyInfo.cs b/.ci/code/UI_Test/Properties/AssemblyInfo.cs index 211dcd2..9350912 100644 --- a/.ci/code/UI_Test/Properties/AssemblyInfo.cs +++ b/.ci/code/UI_Test/Properties/AssemblyInfo.cs @@ -54,6 +54,6 @@ // 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("6.0.0.0")] -[assembly: AssemblyFileVersion("6.3.0.0")] +[assembly: AssemblyVersion("7.0.0.0")] +[assembly: AssemblyFileVersion("7.0.0.0")] diff --git a/BHoM_UI/BHoM_UI.csproj b/BHoM_UI/BHoM_UI.csproj index 8d0b904..d333114 100644 --- a/BHoM_UI/BHoM_UI.csproj +++ b/BHoM_UI/BHoM_UI.csproj @@ -197,6 +197,7 @@ + @@ -233,6 +234,8 @@ + + @@ -252,6 +255,7 @@ + diff --git a/BHoM_UI/Components/UI/FalseStartToggle.cs b/BHoM_UI/Components/UI/FalseStartToggle.cs new file mode 100644 index 0000000..27de83c --- /dev/null +++ b/BHoM_UI/Components/UI/FalseStartToggle.cs @@ -0,0 +1,113 @@ +/* + * This file is part of the Buildings and Habitats object Model (BHoM) + * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. + * + * Each contributor holds copyright over their respective contributions. + * The project versioning (Git) records all such contribution source information. + * + * + * The BHoM is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3.0 of the License, or + * (at your option) any later version. + * + * The BHoM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this code. If not, see . + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Reflection; +using System.ComponentModel; +using BH.oM.UI; +using BH.oM.Data.Collections; +using BH.Engine.Reflection; +using BH.Engine.Data; +using BH.Engine.Serialiser; +using System.Windows.Forms; +using System.Drawing; + +namespace BH.UI.Base.Components +{ + public class FalseStartToggleCaller : Caller + { + /*************************************/ + /**** Properties ****/ + /*************************************/ + + public override System.Drawing.Bitmap Icon_24x24 { get; protected set; } = Properties.Resources.BooleanToggleOff; + + public override Guid Id { get; protected set; } = new Guid("e1e0d75f-41b0-4268-ae5c-a55673d77851"); + + public override string Category { get; protected set; } = "UI"; + + public override string Name { get; protected set; } = ""; + + public override string Description { get; protected set; } = ""; + + public bool Value + { + get + { + return (bool)SelectedItem; + } + protected set + { + SelectedItem = value; + } + } + + /*************************************/ + /**** Constructors ****/ + /*************************************/ + + public FalseStartToggleCaller() : base() + { + SelectedItem = false; + OutputParams = new List() { new ParamInfo { DataType = typeof(bool), Kind = ParamKind.Output, Name = Name, Description = Description, IsRequired = true } }; + } + + /*************************************/ + /**** Public Method ****/ + /*************************************/ + + public override void SetItem(object value, bool sendNotification = true, bool updateOriginal = true) + { + if (updateOriginal) + m_OriginalItem = value; + SelectedItem = (bool)value; + + if (Value) + Icon_24x24 = Properties.Resources.BooleanToggleOn; + else + Icon_24x24 = Properties.Resources.BooleanToggleOff; + + if (sendNotification) + { + MarkAsModified(new CallerUpdate + { + Cause = CallerUpdateCause.ItemSelected, + ComponentUpdate = new ComponentUpdate { Name = Name, Description = Description } + }); + } + } + + /*************************************/ + + public override object Run(List inputs) + { + return Value; + } + + /*************************************/ + } +} + diff --git a/BHoM_UI/Properties/AssemblyInfo.cs b/BHoM_UI/Properties/AssemblyInfo.cs index 01aa99b..3af873c 100644 --- a/BHoM_UI/Properties/AssemblyInfo.cs +++ b/BHoM_UI/Properties/AssemblyInfo.cs @@ -54,8 +54,8 @@ // 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("6.0.0.0")] -[assembly: AssemblyFileVersion("6.3.0.0")] +[assembly: AssemblyVersion("7.0.0.0")] +[assembly: AssemblyFileVersion("7.0.0.0")] diff --git a/BHoM_UI/Properties/Resources.Designer.cs b/BHoM_UI/Properties/Resources.Designer.cs index b1b616d..6b688f1 100644 --- a/BHoM_UI/Properties/Resources.Designer.cs +++ b/BHoM_UI/Properties/Resources.Designer.cs @@ -281,7 +281,31 @@ internal static System.Drawing.Bitmap BHoM_ToJSON { return ((System.Drawing.Bitmap)(obj)); } } - + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap BooleanToggleOn + { + get + { + object obj = ResourceManager.GetObject("BooleanToggleOn", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap BooleanToggleOff + { + get + { + object obj = ResourceManager.GetObject("BooleanToggleOff", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/BHoM_UI/Properties/Resources.resx b/BHoM_UI/Properties/Resources.resx index fa3204a..4177e56 100644 --- a/BHoM_UI/Properties/Resources.resx +++ b/BHoM_UI/Properties/Resources.resx @@ -247,4 +247,10 @@ Resources\BHoM_Logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Resources\BooleanToggleOff.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\BooleanToggleOn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/BHoM_UI/Properties/Resources/BooleanToggleOff.png b/BHoM_UI/Properties/Resources/BooleanToggleOff.png new file mode 100644 index 0000000..e663a7a Binary files /dev/null and b/BHoM_UI/Properties/Resources/BooleanToggleOff.png differ diff --git a/BHoM_UI/Properties/Resources/BooleanToggleOn.png b/BHoM_UI/Properties/Resources/BooleanToggleOn.png new file mode 100644 index 0000000..6de1e80 Binary files /dev/null and b/BHoM_UI/Properties/Resources/BooleanToggleOn.png differ diff --git a/README.md b/README.md index ca6958c..c61e7ff 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ # Core BHoM_UI Repo This repo is part of the Buildings and Habitats object Model. -If you are new (_welcome!_ 👋 😄) a great place to start is on [bhom.xyz](https://bhom.xyz) or reading our [wiki here](https://github.com/BHoM/documentation/wiki) including pages like the [Structure of the BHoM](https://github.com/BHoM/documentation/wiki/Structure-of-the-BHoM) and [Using the BHoM](https://github.com/BHoM/documentation/wiki/Using-the-BHoM). +If you are new (_welcome!_ 👋 😄) a great place to start is on [bhom.xyz](https://bhom.xyz) and reading our [documentation](https://bhom.xyz/documentation), including our [Getting Started Pages](https://bhom.xyz/documentation/Basics/Using-the-BHoM/). This particular repo contains the parent _BHoM UI_ defining all the base functionality necessary to expose the BHoM functionality through user interfaces. @@ -22,12 +22,12 @@ Grab the [latest installer](https://bhom.xyz/) and a selection of [sample script ## Getting Started for Developers 🤖 If you want to build the BHoM and the Toolkits from source, it's hopefully easy! 😄 -Do take a look at our specific wiki pages here: [Getting Started for Developers](https://github.com/BHoM/documentation/wiki/Getting-started-for-developers) +Do take a look at our specific wiki pages here: [Getting Started for Developers](https://bhom.xyz/documentation/Guides-and-Tutorials/Coding-with-BHoM/). ## Want to Contribute? ## -BHoM is an open-source project and would be nothing without its community. Take a look at our contributing guidelines and tips [here](https://github.com/BHoM/BHoM/blob/master/CONTRIBUTING.md). +BHoM is an open-source project and would be nothing without its community. Take a look at our contributing guidelines and tips [here](https://github.com/BHoM/BHoM/blob/main/CONTRIBUTING.md). ## Licence ## @@ -35,4 +35,4 @@ BHoM is an open-source project and would be nothing without its community. Take BHoM is free software licenced under GNU Lesser General Public Licence - [https://www.gnu.org/licenses/lgpl-3.0.html](https://www.gnu.org/licenses/lgpl-3.0.html) Each contributor holds copyright over their respective contributions. The project versioning (Git) records all such contribution source information. -See [LICENSE](https://github.com/BHoM/BHoM/blob/master/LICENSE) and [COPYRIGHT_HEADER](https://github.com/BHoM/BHoM/blob/master/COPYRIGHT_HEADER.txt). +See [LICENSE](https://github.com/BHoM/BHoM/blob/main/LICENSE) and [COPYRIGHT_HEADER](https://github.com/BHoM/BHoM/blob/main/COPYRIGHT_HEADER.txt). diff --git a/UI_Engine/Properties/AssemblyInfo.cs b/UI_Engine/Properties/AssemblyInfo.cs index 01772ba..1d3a0a0 100644 --- a/UI_Engine/Properties/AssemblyInfo.cs +++ b/UI_Engine/Properties/AssemblyInfo.cs @@ -54,8 +54,8 @@ // 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("6.0.0.0")] -[assembly: AssemblyFileVersion("6.3.0.0")] +[assembly: AssemblyVersion("7.0.0.0")] +[assembly: AssemblyFileVersion("7.0.0.0")] diff --git a/UI_oM/Properties/AssemblyInfo.cs b/UI_oM/Properties/AssemblyInfo.cs index 34b1df2..b70bf91 100644 --- a/UI_oM/Properties/AssemblyInfo.cs +++ b/UI_oM/Properties/AssemblyInfo.cs @@ -54,8 +54,8 @@ // 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("6.0.0.0")] -[assembly: AssemblyFileVersion("6.3.0.0")] +[assembly: AssemblyVersion("7.0.0.0")] +[assembly: AssemblyFileVersion("7.0.0.0")]