-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
what *should* have been the initial commit
- Loading branch information
Showing
53 changed files
with
3,499 additions
and
1,492 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,37 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.30011.22 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GHUI", "GHUI\GHUI.csproj", "{4961F23B-4C99-4F28-A227-05629C88FD0C}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{77EB629A-D99F-457C-9125-2723FE578139}" | ||
ProjectSection(SolutionItems) = preProject | ||
README.md = README.md | ||
EndProjectSection | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Debug|x64 = Debug|x64 | ||
Release|Any CPU = Release|Any CPU | ||
Release|x64 = Release|x64 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Debug|Any CPU.ActiveCfg = Debug|x64 | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Debug|Any CPU.Build.0 = Debug|x64 | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Debug|x64.ActiveCfg = Debug|x64 | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Debug|x64.Build.0 = Debug|x64 | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Release|Any CPU.ActiveCfg = Release|x64 | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Release|Any CPU.Build.0 = Release|x64 | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Release|x64.ActiveCfg = Release|x64 | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Release|x64.Build.0 = Release|x64 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {66917442-78A4-4CB2-B5C7-A6140A2EF379} | ||
EndGlobalSection | ||
EndGlobal | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.30011.22 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GHUI", "GHUI\GHUI.csproj", "{4961F23B-4C99-4F28-A227-05629C88FD0C}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{77EB629A-D99F-457C-9125-2723FE578139}" | ||
ProjectSection(SolutionItems) = preProject | ||
LICENSE = LICENSE | ||
README.md = README.md | ||
EndProjectSection | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Debug|x64 = Debug|x64 | ||
Release|Any CPU = Release|Any CPU | ||
Release|x64 = Release|x64 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Debug|Any CPU.ActiveCfg = Debug|x64 | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Debug|Any CPU.Build.0 = Debug|x64 | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Debug|x64.ActiveCfg = Debug|x64 | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Debug|x64.Build.0 = Debug|x64 | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Release|Any CPU.ActiveCfg = Release|x64 | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Release|Any CPU.Build.0 = Release|x64 | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Release|x64.ActiveCfg = Release|x64 | ||
{4961F23B-4C99-4F28-A227-05629C88FD0C}.Release|x64.Build.0 = Release|x64 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {66917442-78A4-4CB2-B5C7-A6140A2EF379} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
using System; | ||
using Grasshopper.Kernel; | ||
|
||
namespace GHUI | ||
{ | ||
public class BuildCheckBoxComponent : GH_Component | ||
{ | ||
/// <summary> | ||
/// Component for building a HTML checkbox input component. | ||
/// </summary> | ||
public BuildCheckBoxComponent() | ||
: base("Create Checkbox Input", "checkbox", | ||
"Create a HTML checkbox Input.", | ||
"UI", "Create") | ||
{ | ||
} | ||
|
||
protected override void RegisterInputParams(GH_InputParamManager pManager) | ||
{ | ||
pManager.AddTextParameter("Name", "name", "The name of the checkbox input component.", GH_ParamAccess.item, | ||
"checkbox"); | ||
pManager.AddTextParameter("ID", "id", "The id of the checkbox input component.", GH_ParamAccess.item, | ||
"checkbox"); | ||
pManager.AddBooleanParameter("Value", "val", "The starting value of the checkbox input component.", | ||
GH_ParamAccess.item, false); | ||
pManager.AddTextParameter("Label", "label", "The starting label of the checkbox input component.", | ||
GH_ParamAccess.item, ""); | ||
pManager.AddTextParameter("CSS", "css", "The `style` attribute to apply to the element and its children.", | ||
GH_ParamAccess.item, | ||
""); | ||
} | ||
|
||
protected override void RegisterOutputParams(GH_OutputParamManager pManager) | ||
{ | ||
pManager.AddTextParameter("HTML", "html", "The HTML code for the created checkbox input.", | ||
GH_ParamAccess.list); | ||
} | ||
|
||
protected override void SolveInstance(IGH_DataAccess da) | ||
{ | ||
// get input from gh component inputs | ||
string name = null; | ||
string id = null; | ||
bool value = false; | ||
string label = null; | ||
string cssStyle = null; | ||
|
||
da.GetData(0, ref name); | ||
da.GetData(1, ref id); | ||
da.GetData(2, ref value); | ||
da.GetData(3, ref label); | ||
da.GetData(4, ref cssStyle); | ||
|
||
string textString = | ||
$"<input type='checkbox' id='{id}' name='{name}' checked='{value}' style='{cssStyle}'>"; | ||
|
||
if (label != "") | ||
{ | ||
textString = textString + $"<label for='{id}' id='{id}-label' >{label}</label>"; | ||
} | ||
|
||
da.SetData(0, textString); | ||
} | ||
|
||
protected override System.Drawing.Bitmap Icon => Properties.Resources.checkbox; | ||
|
||
public override Guid ComponentGuid => new Guid("d1123685-f181-40aa-8f75-d88bcbc49498"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using System; | ||
using Grasshopper.Kernel; | ||
|
||
namespace GHUI | ||
{ | ||
public class BuildColorComponent : GH_Component | ||
{ | ||
/// <summary> | ||
/// Component for building a HTML color input component. | ||
/// </summary> | ||
public BuildColorComponent() | ||
: base("Create Color Input", "Color", | ||
"Create a HTML Color Input.", | ||
"UI", "Create") | ||
{ | ||
} | ||
|
||
protected override void RegisterInputParams(GH_InputParamManager pManager) | ||
{ | ||
pManager.AddTextParameter("Name", "name", "The name of the color input component.", GH_ParamAccess.item, | ||
"color"); | ||
pManager.AddTextParameter("ID", "id", "The id of the color input component.", GH_ParamAccess.item, | ||
"color"); | ||
pManager.AddTextParameter("Value", "val", "The starting value of the color input component.", | ||
GH_ParamAccess.item, ""); | ||
pManager.AddTextParameter("CSS", "css", "The `style` attribute to apply to the element and its children.", | ||
GH_ParamAccess.item, | ||
""); | ||
} | ||
|
||
protected override void RegisterOutputParams(GH_OutputParamManager pManager) | ||
{ | ||
pManager.AddTextParameter("HTML", "html", "The HTML code for the created color input.", | ||
GH_ParamAccess.list); | ||
} | ||
|
||
protected override void SolveInstance(IGH_DataAccess da) | ||
{ | ||
// get input from gh component inputs | ||
string name = null; | ||
string id = null; | ||
string value = null; | ||
string cssStyle = null; | ||
|
||
da.GetData(0, ref name); | ||
da.GetData(1, ref id); | ||
da.GetData(2, ref value); | ||
da.GetData(3, ref cssStyle); | ||
|
||
string textString = | ||
$"<input type='color' id='{id}' name='{name}' value='{value}' style='{cssStyle}'>"; | ||
|
||
da.SetData(0, textString); | ||
} | ||
|
||
protected override System.Drawing.Bitmap Icon => Properties.Resources.color; | ||
|
||
public override Guid ComponentGuid => new Guid("dea8a036-7b2e-4f0b-9e60-ad24894d2b25"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using System; | ||
using Grasshopper.Kernel; | ||
|
||
namespace GHUI | ||
{ | ||
public class BuildDateComponent : GH_Component | ||
{ | ||
/// <summary> | ||
/// Component for building a HTML date input component. | ||
/// </summary> | ||
public BuildDateComponent() | ||
: base("Create Date Input", "Date", | ||
"Create a HTML Date Input.", | ||
"UI", "Create") | ||
{ | ||
} | ||
|
||
protected override void RegisterInputParams(GH_InputParamManager pManager) | ||
{ | ||
pManager.AddTextParameter("Name", "name", "The name of the date input component.", GH_ParamAccess.item, | ||
"date"); | ||
pManager.AddTextParameter("ID", "id", "The id of the date input component.", GH_ParamAccess.item, | ||
"date"); | ||
pManager.AddTextParameter("Value", "val", "The starting value of the date input component.", | ||
GH_ParamAccess.item, ""); | ||
pManager.AddTextParameter("Min", "min", "The min value of the date input component.", | ||
GH_ParamAccess.item, "1900-12-31"); | ||
pManager.AddTextParameter("Max", "max", "The max value of the date input component.", | ||
GH_ParamAccess.item, "2021-01-02"); | ||
pManager.AddTextParameter("CSS", "css", "The `style` attribute to apply to the element and its children.", | ||
GH_ParamAccess.item, | ||
""); | ||
} | ||
|
||
protected override void RegisterOutputParams(GH_OutputParamManager pManager) | ||
{ | ||
pManager.AddTextParameter("HTML", "html", "The HTML code for the created date input.", | ||
GH_ParamAccess.list); | ||
} | ||
|
||
protected override void SolveInstance(IGH_DataAccess da) | ||
{ | ||
// get input from gh component inputs | ||
string name = null; | ||
string id = null; | ||
string value = null; | ||
string min = null; | ||
string max = null; | ||
string cssStyle = null; | ||
|
||
da.GetData(0, ref name); | ||
da.GetData(1, ref id); | ||
da.GetData(2, ref value); | ||
da.GetData(3, ref min); | ||
da.GetData(4, ref max); | ||
da.GetData(4, ref cssStyle); | ||
|
||
string textString = | ||
$"<input type='date' id='{id}' name='{name}' value='{value}' min='{min}' max='{max}' style='{cssStyle}'>"; | ||
|
||
da.SetData(0, textString); | ||
} | ||
|
||
protected override System.Drawing.Bitmap Icon => Properties.Resources.date; | ||
|
||
public override Guid ComponentGuid => new Guid("3164dd20-ddff-4af4-a452-7a5a2bd12caa"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.