From d40fed5ce2bc806a91245adb18039634eac13ed0 Mon Sep 17 00:00:00 2001 From: MichaelTheShifter Date: Wed, 20 Jul 2016 09:40:36 -0400 Subject: Move ShiftUI source code to ShiftOS This'll be a lot easier to work on. --- source/ShiftOS.sln | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/ShiftOS.sln') diff --git a/source/ShiftOS.sln b/source/ShiftOS.sln index b45576c..ccf69a3 100644 --- a/source/ShiftOS.sln +++ b/source/ShiftOS.sln @@ -10,6 +10,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution README.md = README.md EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftUI", "ShiftUI\ShiftUI.csproj", "{C56E34D0-4749-4A73-9469-BCCD063569CD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -20,6 +22,10 @@ Global {00BE72D0-B744-48BA-9C60-BC429757FC32}.Debug|Any CPU.Build.0 = Debug|Any CPU {00BE72D0-B744-48BA-9C60-BC429757FC32}.Release|Any CPU.ActiveCfg = Release|Any CPU {00BE72D0-B744-48BA-9C60-BC429757FC32}.Release|Any CPU.Build.0 = Release|Any CPU + {C56E34D0-4749-4A73-9469-BCCD063569CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C56E34D0-4749-4A73-9469-BCCD063569CD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C56E34D0-4749-4A73-9469-BCCD063569CD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C56E34D0-4749-4A73-9469-BCCD063569CD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE -- cgit v1.2.3 From b52090021ff0ae61db652e8a486cbff6732f5ec5 Mon Sep 17 00:00:00 2001 From: MichaelTheShifter Date: Wed, 20 Jul 2016 13:52:12 -0400 Subject: Move ShiftUI designer to ShiftOS and add prober for ShiftOS to allow ShiftUI designer to design ShiftOS forms. --- source/ShiftOS.sln | 6 ++ source/ShiftUI/Theming/ShiftOS.cs | 5 ++ source/ShiftUI/Theming/ThemeSkinnable.cs | 33 +++++----- source/WindowsFormsApplication1/API.cs | 1 + .../WindowsFormsApplication1/Apps/BitnoteWallet.cs | 15 +++-- .../Apps/Shifter.Designer.cs | 9 +-- .../Controls/ProgressBarEX.cs | 8 +-- .../WindowsFormsApplication1/Engine/Lua_Interp.cs | 4 +- source/WindowsFormsApplication1/Program.cs | 72 ++++++++++++---------- 9 files changed, 80 insertions(+), 73 deletions(-) (limited to 'source/ShiftOS.sln') diff --git a/source/ShiftOS.sln b/source/ShiftOS.sln index ccf69a3..ef829cd 100644 --- a/source/ShiftOS.sln +++ b/source/ShiftOS.sln @@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftUI", "ShiftUI\ShiftUI.csproj", "{C56E34D0-4749-4A73-9469-BCCD063569CD}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftUI Designer", "..\..\Project-Circle\ShiftUI Designer\ShiftUI Designer.csproj", "{20C1A600-B5C2-4226-B5B6-3F17716D2669}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -26,6 +28,10 @@ Global {C56E34D0-4749-4A73-9469-BCCD063569CD}.Debug|Any CPU.Build.0 = Debug|Any CPU {C56E34D0-4749-4A73-9469-BCCD063569CD}.Release|Any CPU.ActiveCfg = Release|Any CPU {C56E34D0-4749-4A73-9469-BCCD063569CD}.Release|Any CPU.Build.0 = Release|Any CPU + {20C1A600-B5C2-4226-B5B6-3F17716D2669}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {20C1A600-B5C2-4226-B5B6-3F17716D2669}.Debug|Any CPU.Build.0 = Debug|Any CPU + {20C1A600-B5C2-4226-B5B6-3F17716D2669}.Release|Any CPU.ActiveCfg = Release|Any CPU + {20C1A600-B5C2-4226-B5B6-3F17716D2669}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/source/ShiftUI/Theming/ShiftOS.cs b/source/ShiftUI/Theming/ShiftOS.cs index 00e9b1a..7950c18 100644 --- a/source/ShiftUI/Theming/ShiftOS.cs +++ b/source/ShiftUI/Theming/ShiftOS.cs @@ -14,6 +14,7 @@ namespace ShiftUI.ShiftOS public Color ButtonBorderColor = Color.Black; public Color ButtonBackColor = Color.White; public Color ButtonBackColor_Pressed = Color.Gray; + public Color ButtonBackColor_Checked = Color.Black; #endregion #region Global @@ -55,6 +56,10 @@ namespace ShiftUI.ShiftOS #endregion + #region ListView + public Color ListViewBackground = Color.White; + #endregion + // No reason to have ShiftOS deal with window borders itself // when I can do it inside ShiftUI. #region Form diff --git a/source/ShiftUI/Theming/ThemeSkinnable.cs b/source/ShiftUI/Theming/ThemeSkinnable.cs index 6772251..5ea8a4d 100644 --- a/source/ShiftUI/Theming/ThemeSkinnable.cs +++ b/source/ShiftUI/Theming/ThemeSkinnable.cs @@ -2973,7 +2973,7 @@ namespace ShiftUI // border is drawn directly in the Paint method if (details && control.HeaderStyle != ColumnHeaderStyle.None) { - dc.FillRectangle(SystemBrushes.Control, + dc.FillRectangle(new SolidBrush(Application.CurrentSkin.ListViewBackground), 0, 0, control.TotalWidth, control.Font.Height + 5); if (control.Columns.Count > 0) { @@ -6923,67 +6923,64 @@ namespace ShiftUI private void CPDrawButtonInternal(Graphics dc, Rectangle rectangle, ButtonState state, Pen DarkPen, Pen NormalPen, Pen LightPen) { // sadly enough, the rectangle gets always filled with a hatchbrush - dc.FillRectangle(ResPool.GetHatchBrush(HatchStyle.Percent50, - Color.FromArgb(Clamp(ColorControl.R + 3, 0, 255), - ColorControl.G, ColorControl.B), - ColorControl), + dc.FillRectangle(new SolidBrush(Application.CurrentSkin.ButtonBackColor), rectangle.X + 1, rectangle.Y + 1, rectangle.Width - 2, rectangle.Height - 2); if ((state & ButtonState.All) == ButtonState.All || ((state & ButtonState.Checked) == ButtonState.Checked && (state & ButtonState.Flat) == ButtonState.Flat)) { - dc.FillRectangle(ResPool.GetHatchBrush(HatchStyle.Percent50, ColorControlLight, ColorControl), rectangle.X + 2, rectangle.Y + 2, rectangle.Width - 4, rectangle.Height - 4); + dc.FillRectangle(new SolidBrush(Application.CurrentSkin.ButtonBackColor_Checked), rectangle.X + 2, rectangle.Y + 2, rectangle.Width - 4, rectangle.Height - 4); - dc.DrawRectangle(SystemPens.ControlDark, rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1); + dc.DrawRectangle(new Pen(new SolidBrush(Application.CurrentSkin.ButtonBorderColor), Application.CurrentSkin.ButtonBorderWidth), rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1); } else if ((state & ButtonState.Flat) == ButtonState.Flat) { - dc.DrawRectangle(SystemPens.ControlDark, rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1); + dc.DrawRectangle(new Pen(new SolidBrush(Application.CurrentSkin.ButtonBorderColor), Application.CurrentSkin.ButtonBorderWidth), rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1); } else if ((state & ButtonState.Checked) == ButtonState.Checked) { - dc.FillRectangle(ResPool.GetHatchBrush(HatchStyle.Percent50, ColorControlLight, ColorControl), rectangle.X + 2, rectangle.Y + 2, rectangle.Width - 4, rectangle.Height - 4); + dc.FillRectangle(new SolidBrush(Application.CurrentSkin.ButtonBackColor_Checked), rectangle.X + 2, rectangle.Y + 2, rectangle.Width - 4, rectangle.Height - 4); - Pen pen = DarkPen; + Pen pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DTopLeftInner)); dc.DrawLine(pen, rectangle.X, rectangle.Y, rectangle.X, rectangle.Bottom - 2); dc.DrawLine(pen, rectangle.X + 1, rectangle.Y, rectangle.Right - 2, rectangle.Y); - pen = NormalPen; + pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DBottomRight)); dc.DrawLine(pen, rectangle.X + 1, rectangle.Y + 1, rectangle.X + 1, rectangle.Bottom - 3); dc.DrawLine(pen, rectangle.X + 2, rectangle.Y + 1, rectangle.Right - 3, rectangle.Y + 1); - pen = LightPen; + pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DBottomRightInner)); dc.DrawLine(pen, rectangle.X, rectangle.Bottom - 1, rectangle.Right - 2, rectangle.Bottom - 1); dc.DrawLine(pen, rectangle.Right - 1, rectangle.Y, rectangle.Right - 1, rectangle.Bottom - 1); } else if (((state & ButtonState.Pushed) == ButtonState.Pushed) && ((state & ButtonState.Normal) == ButtonState.Normal)) { - Pen pen = DarkPen; + Pen pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DTopLeftInner)); dc.DrawLine(pen, rectangle.X, rectangle.Y, rectangle.X, rectangle.Bottom - 2); dc.DrawLine(pen, rectangle.X + 1, rectangle.Y, rectangle.Right - 2, rectangle.Y); - pen = NormalPen; + pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DBottomRight)); dc.DrawLine(pen, rectangle.X + 1, rectangle.Y + 1, rectangle.X + 1, rectangle.Bottom - 3); dc.DrawLine(pen, rectangle.X + 2, rectangle.Y + 1, rectangle.Right - 3, rectangle.Y + 1); - pen = LightPen; + pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DBottomRightInner)); dc.DrawLine(pen, rectangle.X, rectangle.Bottom - 1, rectangle.Right - 2, rectangle.Bottom - 1); dc.DrawLine(pen, rectangle.Right - 1, rectangle.Y, rectangle.Right - 1, rectangle.Bottom - 1); } else if (((state & ButtonState.Inactive) == ButtonState.Inactive) || ((state & ButtonState.Normal) == ButtonState.Normal)) { - Pen pen = LightPen; + Pen pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DTopLeftInner)); dc.DrawLine(pen, rectangle.X, rectangle.Y, rectangle.Right - 2, rectangle.Y); dc.DrawLine(pen, rectangle.X, rectangle.Y, rectangle.X, rectangle.Bottom - 2); - pen = NormalPen; + pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DBottomRight)); dc.DrawLine(pen, rectangle.X + 1, rectangle.Bottom - 2, rectangle.Right - 2, rectangle.Bottom - 2); dc.DrawLine(pen, rectangle.Right - 2, rectangle.Y + 1, rectangle.Right - 2, rectangle.Bottom - 3); - pen = DarkPen; + pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DBottomRightInner)); dc.DrawLine(pen, rectangle.X, rectangle.Bottom - 1, rectangle.Right - 1, rectangle.Bottom - 1); dc.DrawLine(pen, rectangle.Right - 1, rectangle.Y, rectangle.Right - 1, rectangle.Bottom - 2); } diff --git a/source/WindowsFormsApplication1/API.cs b/source/WindowsFormsApplication1/API.cs index 4434fc7..ce0ad8c 100644 --- a/source/WindowsFormsApplication1/API.cs +++ b/source/WindowsFormsApplication1/API.cs @@ -1926,6 +1926,7 @@ namespace ShiftOS public static Color[] yellowmemory = new Color[16]; public static Color[] pinkmemory = new Color[16]; internal static Dictionary> LuaShifterRegistry = null; + public static bool ShouldLoadEngine = true; #endregion } diff --git a/source/WindowsFormsApplication1/Apps/BitnoteWallet.cs b/source/WindowsFormsApplication1/Apps/BitnoteWallet.cs index 7b19c70..3a7164e 100644 --- a/source/WindowsFormsApplication1/Apps/BitnoteWallet.cs +++ b/source/WindowsFormsApplication1/Apps/BitnoteWallet.cs @@ -22,14 +22,17 @@ namespace ShiftOS public BitnoteWallet() { InitializeComponent(); - Clients = new List(); - foreach(var c in Package_Grabber.clients) + if (API.ShouldLoadEngine) { - if(c.Value.IsConnected) + Clients = new List(); + foreach (var c in Package_Grabber.clients) { - var client = new BitnoteClient(c.Key); - client.GetBank(); - Clients.Add(client); + if (c.Value.IsConnected) + { + var client = new BitnoteClient(c.Key); + client.GetBank(); + Clients.Add(client); + } } } } diff --git a/source/WindowsFormsApplication1/Apps/Shifter.Designer.cs b/source/WindowsFormsApplication1/Apps/Shifter.Designer.cs index 04a61d3..568822e 100644 --- a/source/WindowsFormsApplication1/Apps/Shifter.Designer.cs +++ b/source/WindowsFormsApplication1/Apps/Shifter.Designer.cs @@ -443,7 +443,6 @@ namespace ShiftOS this.pnlshifterintro.SuspendLayout(); this.pnldesktopoptions.SuspendLayout(); this.pnldesktoppaneloptions.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.txtdesktoppanelheight)).BeginInit(); this.pnlapplauncheroptions.SuspendLayout(); this.pnldesktopintro.SuspendLayout(); this.pnlpanelbuttonsoptions.SuspendLayout(); @@ -453,7 +452,6 @@ namespace ShiftOS this.predesktoppanel.SuspendLayout(); this.prepnlpanelbuttonholder.SuspendLayout(); this.prepnlpanelbutton.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pretbicon)).BeginInit(); this.pretimepanel.SuspendLayout(); this.preapplaunchermenuholder.SuspendLayout(); this.predesktopappmenu.SuspendLayout(); @@ -472,7 +470,6 @@ namespace ShiftOS this.prepgleft.SuspendLayout(); this.prepgright.SuspendLayout(); this.pretitlebar.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.prepnlicon)).BeginInit(); this.pnlreset.SuspendLayout(); this.pgcontents.SuspendLayout(); this.pnldesktopcomposition.SuspendLayout(); @@ -5123,7 +5120,7 @@ namespace ShiftOS this.pnldesktopoptions.ResumeLayout(false); this.pnldesktoppaneloptions.ResumeLayout(false); this.pnldesktoppaneloptions.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.txtdesktoppanelheight)).EndInit(); + //((System.ComponentModel.ISupportInitialize)(this.txtdesktoppanelheight)).EndInit(); this.pnlapplauncheroptions.ResumeLayout(false); this.pnlapplauncheroptions.PerformLayout(); this.pnldesktopintro.ResumeLayout(false); @@ -5139,7 +5136,7 @@ namespace ShiftOS this.prepnlpanelbuttonholder.ResumeLayout(false); this.prepnlpanelbutton.ResumeLayout(false); this.prepnlpanelbutton.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pretbicon)).EndInit(); + //((System.ComponentModel.ISupportInitialize)(this.pretbicon)).EndInit(); this.pretimepanel.ResumeLayout(false); this.pretimepanel.PerformLayout(); this.preapplaunchermenuholder.ResumeLayout(false); @@ -5169,7 +5166,7 @@ namespace ShiftOS this.prepgright.ResumeLayout(false); this.pretitlebar.ResumeLayout(false); this.pretitlebar.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.prepnlicon)).EndInit(); + //((System.ComponentModel.ISupportInitialize)(this.prepnlicon)).EndInit(); this.pnlreset.ResumeLayout(false); this.pgcontents.ResumeLayout(false); this.pgcontents.PerformLayout(); diff --git a/source/WindowsFormsApplication1/Controls/ProgressBarEX.cs b/source/WindowsFormsApplication1/Controls/ProgressBarEX.cs index d89969e..8febdcd 100644 --- a/source/WindowsFormsApplication1/Controls/ProgressBarEX.cs +++ b/source/WindowsFormsApplication1/Controls/ProgressBarEX.cs @@ -102,13 +102,7 @@ namespace ShiftOS get { return _MaxValue; } set { - if (value > this.MinValue) - { - _MaxValue = value; - } - else { - throw new ArgumentOutOfRangeException("The maximum value must be more than the minimum value."); - } + _MaxValue = value; } } diff --git a/source/WindowsFormsApplication1/Engine/Lua_Interp.cs b/source/WindowsFormsApplication1/Engine/Lua_Interp.cs index fabc1be..d36b4d9 100644 --- a/source/WindowsFormsApplication1/Engine/Lua_Interp.cs +++ b/source/WindowsFormsApplication1/Engine/Lua_Interp.cs @@ -1466,9 +1466,7 @@ end"); /// The converted widget. public static Widget ToWidget(this System.Windows.Forms.Control ctrl) { - string json = JsonConvert.SerializeObject(ctrl); - json = json.Replace("Control", "Widget"); - return JsonConvert.DeserializeObject(json); + return new Controls.WinFormsHost(ctrl); } } } diff --git a/source/WindowsFormsApplication1/Program.cs b/source/WindowsFormsApplication1/Program.cs index 5f3f1ad..af294db 100644 --- a/source/WindowsFormsApplication1/Program.cs +++ b/source/WindowsFormsApplication1/Program.cs @@ -12,24 +12,24 @@ using Newtonsoft.Json; namespace ShiftOS { - static class Program + public static class Program { /// /// The main entry point for the application. /// [STAThread] - static void Main(string[] args) + public static void Main(string[] args) { - Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Extract all dependencies before starting the engine. ExtractDependencies(); - var poolThread = new Thread(new ThreadStart(new Action(() => { + var poolThread = new Thread(new ThreadStart(new Action(() => + { try { - //Download ShiftOS server startup-pool - string pool = new WebClient().DownloadString("http://playshiftos.ml/server/startup_pool"); + //Download ShiftOS server startup-pool + string pool = new WebClient().DownloadString("http://playshiftos.ml/server/startup_pool"); string[] splitter = pool.Split(';'); foreach (string address in splitter) { @@ -55,13 +55,14 @@ namespace ShiftOS //Start the Windows Forms backend Paths.RegisterPaths(); //Sets ShiftOS path variables based on the current OS. SaveSystem.Utilities.CheckForOlderSaves(); //Backs up C:\ShiftOS on Windows systems if it exists and doesn't contain a _engineInfo.txt file telling ShiftOS what engine created it. - //If there isn't a save folder at the directory specified by ShiftOS.Paths.SaveRoot, create a new save. - //If not, load that save. + //If there isn't a save folder at the directory specified by ShiftOS.Paths.SaveRoot, create a new save. + //If not, load that save. if (Directory.Exists(Paths.SaveRoot)) { API.Log("Loading ShiftOS save..."); SaveSystem.Utilities.loadGame(); - } else + } + else { SaveSystem.Utilities.NewGame(); } @@ -80,44 +81,48 @@ namespace ShiftOS Skinning.Utilities.loadskin(); SaveSystem.ShiftoriumRegistry.UpdateShiftorium(); //Lua bootscreen. - if(File.Exists(Paths.SaveRoot + "BOOT")) + if (File.Exists(Paths.SaveRoot + "BOOT")) { string lua = File.ReadAllText(Paths.SaveRoot + "BOOT"); var l = new LuaInterpreter(); l.mod(lua); } //Start recieving calls from the Modding API... - Application.Run(new ShiftOSDesktop()); - //By now, the API receiver has been loaded, - //and the desktop is shown. So, let's check - //for auto-start mods. - if(Directory.Exists(Paths.AutoStart)) + if (!args.Contains("nodisplay")) { - foreach(string file in Directory.GetFiles(Paths.AutoStart)) + Application.Run(new ShiftOSDesktop()); + //By now, the API receiver has been loaded, + //and the desktop is shown. So, let's check + //for auto-start mods. + if (Directory.Exists(Paths.AutoStart)) { - var inf = new FileInfo(file); - switch(inf.Extension) + foreach (string file in Directory.GetFiles(Paths.AutoStart)) { - case ".saa": - if (API.Upgrades["shiftnet"] == true) - { - API.Log("Starting start-up mod \"" + inf.FullName + "\"..."); - API.LaunchMod(inf.FullName); - } - break; - case ".trm": - var t = new Terminal(); - t.runterminalfile(inf.FullName); - API.Log("Started terminal file \"" + inf.FullName + "\"..."); - break; - } } + var inf = new FileInfo(file); + switch (inf.Extension) + { + case ".saa": + if (API.Upgrades["shiftnet"] == true) + { + API.Log("Starting start-up mod \"" + inf.FullName + "\"..."); + API.LaunchMod(inf.FullName); + } + break; + case ".trm": + var t = new Terminal(); + t.runterminalfile(inf.FullName); + API.Log("Started terminal file \"" + inf.FullName + "\"..."); + break; + } + } + } } //Now, for some ShiftOS launcher integration. try { - if(args[0] != null) + if (args[0] != null) { - if(args[0] != "") + if (args[0] != "") { API.CurrentSave.username = args[0]; //Username set. @@ -130,6 +135,7 @@ namespace ShiftOS } } + static void ExtractDependencies() { //Wow. This'll make it easy for people... -- cgit v1.2.3 From dec9a4413664a362efd2e81452bf19ce37b87931 Mon Sep 17 00:00:00 2001 From: MichaelTheShifter Date: Sat, 23 Jul 2016 15:49:49 -0400 Subject: I dun derped. --- source/ShiftOS.sln | 2 +- source/ShiftUI Designer/App.config | 6 + source/ShiftUI Designer/Program.cs | 1445 ++++++++++++++++++++ source/ShiftUI Designer/Properties/AssemblyInfo.cs | 36 + source/ShiftUI Designer/ShiftUI Designer.csproj | 71 + 5 files changed, 1559 insertions(+), 1 deletion(-) create mode 100644 source/ShiftUI Designer/App.config create mode 100644 source/ShiftUI Designer/Program.cs create mode 100644 source/ShiftUI Designer/Properties/AssemblyInfo.cs create mode 100644 source/ShiftUI Designer/ShiftUI Designer.csproj (limited to 'source/ShiftOS.sln') diff --git a/source/ShiftOS.sln b/source/ShiftOS.sln index ef829cd..bc0765a 100644 --- a/source/ShiftOS.sln +++ b/source/ShiftOS.sln @@ -12,7 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftUI", "ShiftUI\ShiftUI.csproj", "{C56E34D0-4749-4A73-9469-BCCD063569CD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftUI Designer", "..\..\Project-Circle\ShiftUI Designer\ShiftUI Designer.csproj", "{20C1A600-B5C2-4226-B5B6-3F17716D2669}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftUI Designer", "ShiftUI Designer\ShiftUI Designer.csproj", "{20C1A600-B5C2-4226-B5B6-3F17716D2669}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/source/ShiftUI Designer/App.config b/source/ShiftUI Designer/App.config new file mode 100644 index 0000000..88fa402 --- /dev/null +++ b/source/ShiftUI Designer/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/source/ShiftUI Designer/Program.cs b/source/ShiftUI Designer/Program.cs new file mode 100644 index 0000000..7e4be98 --- /dev/null +++ b/source/ShiftUI Designer/Program.cs @@ -0,0 +1,1445 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ShiftUI; +using System.Drawing; +using System.Diagnostics; +using System.Reflection; + +namespace ShiftUI_Designer +{ + public class MyAwesomeSkin : ShiftUI.ShiftOS.Skin + { + public MyAwesomeSkin() + { + base.ButtonBackColor_Pressed = Color.Red; + } + } + + class Program + { + static void Main(string[] args) + { + Application.LoadSkin(new MyAwesomeSkin()); + Application.EnableVisualStyles(); + Application.Run(new FormSelectionForm()); + Console.WriteLine("This executed after Run."); + } + } + + public static class Helpers + { + public static void Debug(this Form host, string message) + { + Console.WriteLine("<{0}> [ShiftUI/{1}] {2}", DateTime.Now.ToString(), host.Text, message); + } + } + + public class MainEditorForm : Form + { + private Panel resize_se = null; + private Panel resize_e = null; + private Panel resize_s = null; + private Panel resize_sw = null; + private Panel resize_w = null; + + public void LoadFormFromClass(Form form) + { + var t = form.GetType(); + var init_method = t.GetMethod("InitializeComponent"); + if (init_method != null) + { + init_method.Invoke(form, null); + } + TopLevels.Add(form); + current_form = form; + PopulateTree(); + DrawForm(); + this.Show(); + } + + public enum ResizeLocation + { + South = 0, + SouthEast = 1, + East = 2, + NorthEast = 3, + North = 4, + NorthWest = 5, + West = 6, + SouthWest = 7 + } + + public void Select(Widget widget) + { + if (widget != null) + { + if(widget is Form && current_form != widget as Form) + { + current_form = widget as Form; + DrawForm(); + Select(current_form); + } + if (widget != current_form.Body) + { + properties.SelectedObject = widget; + resizing_widget = widget; + resize_w?.Parent?.Widgets.Remove(resize_w); + resize_w = null; + resize_sw?.Parent?.Widgets.Remove(resize_sw); + resize_sw = null; + resize_se?.Parent?.Widgets.Remove(resize_se); + resize_se = null; + resize_s?.Parent?.Widgets.Remove(resize_s); + resize_s = null; + resize_e?.Parent?.Widgets.Remove(resize_e); + resize_e = null; + SetupResizeBorder(widget); + } + else + { + Select(current_form); + } + } + else + { + resize_w?.Hide(); + resize_sw?.Hide(); + resize_s?.Hide(); + resize_se?.Hide(); + resize_e?.Hide(); + + } + } + + public void SetupResizeBorder(Widget widget) + { + if (!(widget is Form)) + { + SetupMoveHandle(ref resize_sw, ResizeLocation.NorthWest); + } + SetupResizeHandle(ref resize_se, ResizeLocation.SouthEast); + SetupResizeHandle(ref resize_e, ResizeLocation.East); + SetupResizeHandle(ref resize_s, ResizeLocation.South); + + } + + + Point last_mouse_location = Point.Empty; + bool dragging = false; + private Widget resizing_widget = null; + + public void SetupMoveHandle(ref Panel handle, ResizeLocation loc) + { + bool updown = false; + bool leftright = false; + properties.SelectedObject = resizing_widget; + if (handle == null) + { + handle = new Panel(); + body.Widgets.Add(handle); + handle.BackColor = Color.Black; + handle.Size = new Size(16, 16); + handle.MouseDown += (o, a) => + { + if (a.Button == MouseButtons.Left) + { + last_mouse_location = a.Location; + dragging = true; + } + }; + handle.MouseUp += (o, a) => + { + dragging = false; + }; + handle.MouseMove += (o, a) => + { + if (dragging == true) + { + var mouse_loc = a.Location; + int y_distance = mouse_loc.Y - last_mouse_location.Y; + int x_distance = mouse_loc.X - last_mouse_location.X; + if (updown == true) + { + resizing_widget.Top += y_distance; + form_preview.Refresh(); + } + if (leftright == true) + { + resizing_widget.Left += x_distance; + form_preview.Refresh(); + } + SetupResizeBorder(resizing_widget); + } + }; + } + bool ex = false; + var wloc = Point.Empty; + try + { + wloc = resizing_widget.Parent.PointToScreen(resizing_widget.Location); + } + catch + { + ex = true; + wloc = body.PointToScreen(resizing_widget.Location); //Must be a top-level widget. + } + wloc = body.PointToClient(wloc); + switch (loc) + { + case ResizeLocation.NorthWest: + handle.Left = wloc.X - handle.Width; + handle.Top = wloc.Y - handle.Height; + updown = true; + leftright = true; + break; + } + + handle.BringToFront(); + handle.Show(); + handle.Refresh(); + body.Refresh(); + } + + + public void SetupResizeHandle(ref Panel handle, ResizeLocation loc) + { + bool updown = false; + bool leftright = false; + properties.SelectedObject = resizing_widget; + if (handle == null) + { + handle = new Panel(); + body.Widgets.Add(handle); + handle.BackColor = Color.Black; + handle.Size = new Size(16, 16); + handle.MouseDown += (o, a) => + { + if (a.Button == MouseButtons.Left) + { + last_mouse_location = a.Location; + dragging = true; + } + }; + handle.MouseUp += (o, a) => + { + dragging = false; + }; + handle.MouseMove += (o, a) => + { + if (dragging == true) + { + var mouse_loc = a.Location; + int y_distance = mouse_loc.Y - last_mouse_location.Y; + int x_distance = mouse_loc.X - last_mouse_location.X; + if (updown == true) + { + resizing_widget.Height += y_distance; + form_preview.Refresh(); + } + if (leftright == true) + { + resizing_widget.Width += x_distance; + form_preview.Refresh(); + } + SetupResizeBorder(resizing_widget); + } + }; + } + bool ex = false; + var wloc = Point.Empty; + try + { + wloc = resizing_widget.Parent.PointToScreen(resizing_widget.Location); + } + catch + { + ex = true; + wloc = body.PointToScreen(resizing_widget.Location); //Must be a top-level widget. + } + wloc = body.PointToClient(wloc); + switch ((int)loc) + { + case 0: + handle.Left = wloc.X + ((resizing_widget.Width - handle.Width) / 2); + handle.Top = wloc.Y + resizing_widget.Height; + updown = true; + break; + case 1: + handle.Left = wloc.X + resizing_widget.Width + 5; + handle.Top = wloc.Y + resizing_widget.Height + 5; + updown = true; + leftright = true; + break; + case 2: + handle.Left = wloc.X + resizing_widget.Width; + handle.Top = wloc.Y + ((resizing_widget.Height - handle.Height) / 2); + leftright = true; + break; + case 3: + handle.Left = wloc.X + resizing_widget.Width; + handle.Top = wloc.Y + (resizing_widget.Top - handle.Top); + leftright = true; + updown = true; + break; + } + + handle.BringToFront(); + handle.Show(); + handle.Refresh(); + body.Refresh(); + } + + private Panel form_preview; + private Form current_form; + + public void DrawForm() + { + if (form_preview == null) + { + form_preview = new Panel(); + body.Widgets.Add(form_preview); + } + + if (current_form != null) + { + current_form.FormClosing += (o, a) => + { + a.Cancel = true; + }; + current_form.SizeChanged += (o, a) => + { + form_preview.Size = current_form.Size; + }; + current_form.Body.WidgetAdded += (o, a) => + { + SetupWidget(a.Widget); + }; + form_preview.Widgets.Clear(); + form_preview.Location = new Point(5, 5); + form_preview.Size = current_form.Size; + Widget[] widgets = new Widget[current_form.Widgets.Count]; + current_form.Widgets.CopyTo(widgets, 0); + Widget[] borderwidgets = new Widget[current_form.BorderWidgets.Length]; + current_form.BorderWidgets.CopyTo(borderwidgets, 0); + foreach (var widget in borderwidgets) + { + form_preview.Widgets.Add(widget); + widget.Show(); + SetupWidget(widget); + + } + + foreach (var widget in widgets) + { + if (!borderwidgets.Contains(widget)) + { + form_preview.Widgets.Add(widget); + widget.Show(); + if (widget == current_form.Body) + widget.BringToFront(); + SetupWidget(widget); + } + } + form_preview.Show(); + } + } + + public void SetupWidget(Widget widget) + { + if (string.IsNullOrEmpty(widget.Name)) + { + widget.MouseDown += (o, a) => + { + Select(current_form); + current_parent = current_form; + }; + } + else + { + widget.MouseDown += (o, a) => + { + Select(widget); + current_parent = widget; + }; + } + //give the widget the Container context menu + widget.ContextMenuStrip = container_menu; + + foreach(Widget w in widget.Widgets) + { + SetupWidget(w); + } + + } + + public List
TopLevels = new List(); + private Widget current_parent = null; + private ContextMenuStrip widget_modification_menu = null; + + public void PopulateTopLevelNode(TreeNode node, Widget widget) + { + document_outline.Nodes.Add(node); + node.ContextMenuStrip = widget_modification_menu; + if (widget.Widgets != null && widget.Widgets.Count > 0) + { + foreach(Widget w in widget.Widgets) + { + PopulateNode(node, w); + } + } + } + + public void PopulateNode(TreeNode parent, Widget widget) + { + var t = new TreeNode(); + if (!string.IsNullOrEmpty(widget.Name)) + { + t.Text = widget.Name + ": " + widget.GetType().Name; + t.Tag = widget; + t.ContextMenuStrip = widget_modification_menu; + parent.Nodes.Add(t); + if (widget.Widgets.Count > 0) + { + foreach (Widget w in widget.Widgets) + { + PopulateNode(t, w); + } + } + t.Expand(); + } + else + { + } + } + + public void PopulateTree() + { + document_outline.Nodes.Clear(); + foreach (var form in TopLevels) + { + var t = new TreeNode(); + t.Text = form.Name + ": " + form.GetType().Name; + t.Tag = form; + PopulateTopLevelNode(t, current_form.Body); + t.Expand(); + } + } + + public MainEditorForm() + { + Text = "ShiftUI"; + this.Debug("Starting designer..."); + this.MaximumSize = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height - 40); + this.SizeChanged += (o, a) => + { + if (this.WindowState == FormWindowState.Maximized) + this.Location = new Point(0, 0); + }; + this.Size = new Size(1280, 720); + this.Load += (o, a) => + { + ResetSkin(); + }; + + //create menu + menu = new MenuStrip(); + this.Widgets.Add(menu); + menu.Show(); + + //top-levels + file = new ToolStripMenuItem(); + edit = new ToolStripMenuItem(); + about = new ToolStripMenuItem(); + file.Text = "File"; + edit.Text = "Edit"; + about.Text = "About"; + menu.Items.Add(file); + menu.Items.Add(edit); + menu.Items.Add(about); + + //about + a_about_shiftui = new ToolStripMenuItem(); + a_about_shiftui_designer = new ToolStripMenuItem(); + a_shiftos = new ToolStripMenuItem(); + a_about_shiftui.Text = "About ShiftUI"; + a_about_shiftui_designer.Text = "About ShiftUI Designer"; + a_shiftos.Text = "ShiftOS"; + about.DropDownItems.Add(a_about_shiftui); + about.DropDownItems.Add(a_about_shiftui_designer); + about.DropDownItems.Add(a_shiftos); + a_about_shiftui.Click += (o, a) => + { + Process.Start("http://playshiftos.ml/wiki/index/shiftui"); + }; + a_about_shiftui_designer.Click += (o, a) => + { + Process.Start("http://playshiftos.ml/wiki/index/shiftui-designer"); + }; + a_shiftos.Click += (o, a) => + { + Process.Start("http://playshiftos.ml"); + }; + + + widget_modification_menu = new ContextMenuStrip(); + var rename_widget = new ToolStripMenuItem(); + rename_widget.Text = "Rename"; + widget_modification_menu.Items.Add(rename_widget); + rename_widget.Click += (o, a) => + { + if (document_outline.SelectedNode != null) + { + var renamer = new WidgetRenameForm(document_outline.SelectedNode.Tag as Widget); + renamer.ShowDialog(); + PopulateTree(); + } + }; + + e_newform = new ToolStripMenuItem(); + e_newform.Text = "Add new form"; + edit.DropDownItems.Add(e_newform); + e_newform.Click += (o, a) => + { + var nf = new Form(); + nf.Name = $"Form{TopLevels.Count + 1}"; + TopLevels.Add(nf); + current_form = nf; + PopulateTree(); + DrawForm(); + }; + + var delete_widget = new ToolStripMenuItem(); + delete_widget.Text = "Delete"; + widget_modification_menu.Items.Add(delete_widget); + delete_widget.Click += (o, a) => + { + if (document_outline.SelectedNode != null) + { + var w = document_outline.SelectedNode.Tag as Widget; + if (properties.SelectedObject == w) + Select(null); //deselect the widget IF it's the selected widget. + if (w.Parent != null) + w.Parent.Widgets.Remove(w); + + if (w is Form) + { + if (TopLevels.Contains(w as Form)) + { + bool should_redraw = current_form == w as Form; + Select(null); //have to deselect whatever is selected in case it's this form or + //it's a part of it's family (child, grandchild, etc) + TopLevels.Remove(w as Form); + if (TopLevels.Count > 0 && should_redraw == true) + { + current_form = TopLevels[0]; + DrawForm(); + } + else + { + current_form = null; + form_preview.Hide(); + } + } + } + + w.Hide(); + w.Dispose(); + + PopulateTree(); + + } + + }; + + + ///Main UI + + //Split panel + var splitter_parent = new Panel(); + this.Widgets.Add(splitter_parent); + splitter_parent.Dock = DockStyle.Fill; + splitter_parent.Show(); + //split panel - left panel + var splitter_left = new Panel(); + splitter_left.Dock = DockStyle.Left; + splitter_left.Width = splitter_parent.Width / 3; + splitter_parent.Widgets.Add(splitter_left); + splitter_left.Show(); + + //left panel - property grid + properties = new PropertyGrid(); + properties.Dock = DockStyle.Bottom; + properties.Height = splitter_left.Height / 2; + splitter_left.Widgets.Add(properties); + properties.Show(); + + //left panel - document tree + document_outline = new TreeView(); + document_outline.Dock = DockStyle.Fill; + splitter_left.Widgets.Add(document_outline); + document_outline.Show(); + + //splitter panel - body + body = new Panel(); + body.Dock = DockStyle.Fill; + splitter_parent.Widgets.Add(body); + body.Show(); + splitter_left.SendToBack(); + + //add a new form to the toplevel + var f = new Form(); + f.Name = "Form1"; + f.Text = "Form1"; + TopLevels.Add(f); + + //populate tree + current_form = TopLevels[0]; + PopulateTree(); + + menu.SendToBack(); + + //Create the container context menu + container_menu = new ContextMenuStrip(); + c_add_widget = new ToolStripMenuItem(); + c_add_widget.Text = "Add widget"; + container_menu.Items.Add(c_add_widget); + c_add_widget.Click += (o, a) => + { + var wselector = new WidgetSelectorForm(current_parent); + wselector.ShowDialog(); + PopulateTree(); + }; + + //draw the first top-level + DrawForm(); + Select(current_form); + document_outline.Click += (o, a) => + { + if(document_outline.SelectedNode != null) + { + Select(document_outline.SelectedNode.Tag as Widget); + } + }; + + f_export = new ToolStripMenuItem(); + f_export.Text = "Export as..."; + file.DropDownItems.Add(f_export); + + f_export_cs = new ToolStripMenuItem(); + f_export_cs.Text = "C# Code File"; + f_export.DropDownItems.Add(f_export_cs); + f_export_cs.Click += (o, a) => + { + MessageBox.Show("This is an experimental feature of the ShiftUI designer. Although we can handle most of the heavy lifting and you won't have to type lots of UI code, we may mess up a bit in some areas, and in that case, you may experience errors in the generated code.", "Warning: Experimental"); + ExportCS(TopLevels); + }; + } + + public string GenerateWidgetCSharp(Widget parent, Widget w) + { + string csharp = ""; + var wtype = w.GetType(); + string wName = w.Name; + if (w is Form && TopLevels.Contains(w as Form)) + wName = "this"; + string parentName = ""; + if (parent != null) + parentName = parent.Name; + if (parent is Form && TopLevels.Contains(parent as Form)) + parentName = "this"; + + + Type[] valid_types = { typeof(string), typeof(int), typeof(Color), typeof(bool), typeof(Size), typeof(Point), typeof(Font) }; + + //Instantiate widget. + if(wName != "this") + csharp += $"\t\t\t{wName} = new {wtype.Name}();\r\n"; + + //get all public properties of widget + var propertyinf = wtype.GetProperties(BindingFlags.Public | BindingFlags.Instance); + foreach (var p in propertyinf) + { + if (!p.CanRead || !p.CanWrite) + continue; + + var get = p.GetGetMethod(); + var set = p.GetSetMethod(); + + if (get == null) + continue; + + if (set == null) + continue; + + if (valid_types.Contains(p.PropertyType) || p.PropertyType.IsEnum) + { + if (p.Name != "TransparencyKey") + { + csharp += $"\t\t\t{wName}.{p.Name} = "; + + if (p.PropertyType == typeof(string)) + csharp += $"\"{p.GetValue(w)}\""; + else if (p.PropertyType == typeof(Cursor)) + csharp += $"{p.GetValue(w).ToString().Replace("[", "").Replace("]", "")}"; + else if (p.PropertyType.IsEnum) + { + try + { + int enum_val = int.Parse(p.GetValue(w).ToString()); + csharp += $"({p.PropertyType.Name}){enum_val}"; + } + catch + { + csharp += $"{p.PropertyType.Name}.{p.GetValue(w).ToString().Replace(", ", $" | {p.PropertyType.Name}.")}"; + } + } + else if (p.PropertyType == typeof(bool)) + csharp += $"{p.GetValue(w).ToString().ToLower()}"; //Booleans are always lowercase in C#. + else if (p.PropertyType == typeof(int)) + csharp += $"{p.GetValue(w)}"; + else if (p.PropertyType == typeof(Point)) + { + var point = (Point)p.GetValue(w); + csharp += $"new Point({point.X}, {point.Y})"; + } + else if (p.PropertyType == typeof(Size)) + { + var size = (Size)p.GetValue(w); + csharp += $"new Size({size.Width}, {size.Height})"; + } + else if (p.PropertyType == typeof(Color)) + { + //Bug: Form.TransparencyKey seems to always be set to black if the user doesn't explicitly + //set it. This causes the close, minimize and maximize buttons, as well as text to appear transparent. + // + //Workaround: Disallow TransparencyKey. + var color = (Color)p.GetValue(w); + csharp += $"Color.FromArgb({color.R}, {color.G}, {color.B})"; + } + else if (p.PropertyType == typeof(Font)) + { + var font = (Font)p.GetValue(w); + csharp += $"new Font(\"{font.FontFamily.Name}\", (float){font.Size}, (FontStyle){(int)font.Style})"; + } + csharp += ";\r\n"; + } + } + } + if (wName == "this") + { + csharp += "\r\n"; + } + else + { + csharp += $"\t\t\t{parentName}.Widgets.Add({wName});\r\n"; + csharp += $"\t\t\t{wName}.Show();\r\n"; + } + + foreach(Widget wid in w.Widgets) + { + csharp += GenerateWidgetCSharp(w, wid); + } + + return csharp; + } + + public string GenerateWidgetMembersCSharp(Widget widget) + { + var t = widget.GetType(); + string csharp = ""; + csharp += "public " + t.Name + " " + widget.Name + " = null;"; + foreach(Widget w in widget.Widgets) + { + csharp += GenerateWidgetMembersCSharp(w); + } + return csharp; + } + + public void ExportCS(List forms) + { + string csharp = ""; + csharp += @"/* + * This piece of code was automatically + * generated by the ShiftUI designer. + * + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Linq; +using System.Drawing; +using ShiftUI; + +namespace ShiftUI_DesignerGenerated { +"; + foreach (var form in forms) + { + csharp += $@" public class {form.Name} : Form" + @" { + public " + form.Name + @"() { +"; + + csharp += GenerateWidgetCSharp(null, form); + + //Widget property setup. + foreach (Widget widget in form.Body.Widgets) + { + csharp += GenerateWidgetCSharp(form as Widget, widget); + } + + csharp += @" + } +"; + + foreach (Widget widget in form.Body.Widgets) + { + csharp += GenerateWidgetMembersCSharp(widget); + } + + csharp += @" + }"; + } + csharp += @" +}"; + var f = new Form(); + var rtb = new RichTextBox(); + f.Text = "C# Output"; + rtb.Dock = DockStyle.Fill; + f.Show(); + f.Widgets.Add(rtb); + rtb.Show(); + rtb.Text = csharp; + + } + + private Panel body = null; + private PropertyGrid properties = null; + private MenuStrip menu = null; + private TreeView document_outline = null; + private ContextMenuStrip container_menu = null; + + private ToolStripMenuItem c_add_widget = null; + + private ToolStripMenuItem file = null; + private ToolStripMenuItem f_new = null; + private ToolStripMenuItem f_open = null; + private ToolStripMenuItem f_save = null; + private ToolStripMenuItem f_export = null; + + private ToolStripMenuItem f_export_vb = null; + private ToolStripMenuItem f_export_cs = null; + private ToolStripMenuItem f_export_lua = null; + + private ToolStripMenuItem f_exit = null; + + private ToolStripMenuItem edit = null; + private ToolStripMenuItem e_newform = null; + + private ToolStripMenuItem about = null; + private ToolStripMenuItem a_about_shiftui = null; + private ToolStripMenuItem a_about_shiftui_designer = null; + private ToolStripMenuItem a_shiftos = null; + + + } + + public class WidgetSelectorForm : Form + { + public WidgetSelectorForm(Widget parent) + { + this.Text = "Add Widget"; + Size = new Size(400, 400); + var cbox = new ComboBox(); + foreach(var t in Widget.GetAllToolboxWidgets()) + { + cbox.Items.Add(t.Name); + } + this.Widgets.Add(cbox); + cbox.Location = new Point(10, 50); + cbox.Width = this.Width - (cbox.Left * 2); + var cbox_label = new Label(); + cbox_label.Text = "Select widget type"; + cbox_label.Top = cbox.Top - cbox_label.Height; + cbox_label.Left = 10; + this.Widgets.Add(cbox_label); + var widget_name = new TextBox(); + widget_name.Location = new Point(10, 100); + widget_name.Width = this.Width - (widget_name.Left * 2); + this.Widgets.Add(widget_name); + widget_name.Show(); + var widget_name_label = new Label(); + widget_name_label.Text = "Widget name"; + widget_name_label.Left = 10; + widget_name_label.Top = widget_name.Top - widget_name_label.Height; + this.Widgets.Add(widget_name_label); + widget_name_label.Show(); + cbox.Show(); + cbox_label.Show(); + DialogResult = DialogResult.Cancel; + Button confirm = new Button(); + confirm.AutoSize = true; + confirm.AutoSizeMode = AutoSizeMode.GrowAndShrink; + confirm.Text = "Add"; + confirm.Click += (o, a) => + { + if (string.IsNullOrEmpty(cbox.Text)) + { + MessageBox.Show("Error: Widget type not present. You must select a valid widget type.", "Add Widget"); return; + } + + if(string.IsNullOrEmpty(widget_name.Text)) + { + MessageBox.Show("Error: Widget name cannot be empty as it is required for the variable name when generating code.", "Add Widget"); return; + } + + //get the type of the selected widget + Type type = null; + foreach (var t in Widget.GetAllToolboxWidgets()) + { + if (t.Name == cbox.SelectedItem.ToString()) + { + type = t; + } + } + if(type == null) + { + MessageBox.Show("Error: Invalid widget type. The type could not be found.", "Add Widget"); return; + } + try + { + Widget w = Activator.CreateInstance(type) as Widget; + w.Name = widget_name.Text; + parent.Widgets.Add(w); + w.Show(); + } + catch(Exception ex) + { + MessageBox.Show($"Error: Couldn't create widget instance from type! {ex.Message}", "Add Widget"); return; + } + + this.DialogResult = DialogResult.OK; + this.Close(); + }; + var bottom_panel = new FlowLayoutPanel(); + bottom_panel.Dock = DockStyle.Bottom; + bottom_panel.Height = 25; + this.Widgets.Add(bottom_panel); + bottom_panel.Show(); + bottom_panel.BackColor = Application.CurrentSkin.MessageBox_BottomPanel; + bottom_panel.Widgets.Add(confirm); + confirm.Show(); + } + } + + public class WidgetRenameForm : Form + { + public WidgetRenameForm(Widget widget) + { + this.AllowTransparency = false; + this.AutoScale = true; + this.AutoScaleBaseSize = new Size(5, 13); + this.AutoScroll = false; + this.AutoSize = false; + this.AutoSizeMode = AutoSizeMode.GrowOnly; + this.AutoValidate = AutoValidate.Inherit; + this.BackColor = Color.FromArgb(240, 240, 240); + this.ClientSize = new Size(300, 132); + this.WidgetBox = true; + this.DesktopLocation = new Point(0, 0); + this.DialogResult = DialogResult.None; + this.FormBorderStyle = FormBorderStyle.FixedSingle; + this.HelpButton = false; + this.IsMdiContainer = false; + this.KeyPreview = false; + this.MaximizeBox = true; + this.MaximumSize = new Size(0, 0); + this.MinimizeBox = true; + this.MinimumSize = new Size(0, 0); + this.RightToLeftLayout = false; + this.ShowIcon = true; + this.ShowInTaskbar = true; + this.Size = new Size(300, 132); + this.SizeGripStyle = SizeGripStyle.Auto; + this.StartPosition = FormStartPosition.WindowsDefaultLocation; + this.TabIndex = 0; + this.TabStop = true; + this.TopLevel = true; + this.TopMost = false; + this.WindowState = FormWindowState.Normal; + this.Text = "Rename widget"; + this.Location = new Point(0, 0); + this.AutoScaleMode = AutoScaleMode.Inherit; + this.AutoScrollMargin = new Size(0, 0); + this.AutoScrollMinSize = new Size(0, 0); + this.AutoScrollPosition = new Point(0, 0); + this.Alignment = (ContentAlignment)0; + this.AccessibleDefaultActionDescription = ""; + this.AccessibleDescription = ""; + this.AccessibleName = ""; + this.AccessibleRole = AccessibleRole.Default; + this.AllowDrop = false; + this.Anchor = AnchorStyles.Top | AnchorStyles.Left; + this.AutoScrollOffset = new Point(0, 0); + this.BackgroundImageLayout = ImageLayout.Tile; + this.Capture = false; + this.CausesValidation = true; + this.Dock = DockStyle.None; + this.Enabled = true; + this.Font = new Font("Microsoft Sans Serif", (float)8.25, (FontStyle)0); + this.ForeColor = Color.FromArgb(0, 0, 0); + this.Height = 132; + this.ImeMode = ImeMode.NoControl; + this.IsAccessible = false; + this.Left = 0; + this.Name = "Form1"; + this.RightToLeft = RightToLeft.No; + this.Top = 0; + this.UseWaitCursor = false; + this.Visible = false; + this.Width = 300; + + btnok = new Button(); + btnok.AutoSizeMode = AutoSizeMode.GrowOnly; + btnok.DialogResult = DialogResult.None; + btnok.AutoEllipsis = false; + btnok.AutoSize = false; + btnok.BackColor = Color.FromArgb(255, 255, 0); + btnok.FlatStyle = FlatStyle.Standard; + btnok.ImageAlign = ContentAlignment.MiddleCenter; + btnok.ImageIndex = -1; + btnok.ImageKey = ""; + btnok.ImeMode = ImeMode.Disable; + btnok.Text = "Rename"; + btnok.TextAlign = ContentAlignment.MiddleCenter; + btnok.TextImageRelation = TextImageRelation.Overlay; + btnok.UseCompatibleTextRendering = true; + btnok.UseMnemonic = true; + btnok.UseVisualStyleBackColor = true; + btnok.Alignment = (ContentAlignment)0; + btnok.AccessibleDefaultActionDescription = ""; + btnok.AccessibleDescription = ""; + btnok.AccessibleName = ""; + btnok.AccessibleRole = AccessibleRole.Default; + btnok.AllowDrop = false; + btnok.Anchor = AnchorStyles.Top | AnchorStyles.Left; + btnok.AutoScrollOffset = new Point(0, 0); + btnok.MaximumSize = new Size(0, 0); + btnok.MinimumSize = new Size(0, 0); + btnok.BackgroundImageLayout = ImageLayout.Tile; + btnok.Capture = false; + btnok.CausesValidation = true; + btnok.ClientSize = new Size(75, 23); + btnok.Dock = DockStyle.None; + btnok.Enabled = true; + btnok.Font = new Font("Microsoft Sans Serif", (float)8.25, (FontStyle)0); + btnok.ForeColor = Color.FromArgb(0, 0, 0); + btnok.Height = 23; + btnok.IsAccessible = false; + btnok.Left = 210; + btnok.Location = new Point(210, 66); + btnok.Name = "btnok"; + btnok.RightToLeft = RightToLeft.No; + btnok.Size = new Size(75, 23); + btnok.TabIndex = 0; + btnok.TabStop = true; + btnok.Top = 66; + btnok.UseWaitCursor = false; + btnok.Visible = true; + btnok.Width = 75; + this.Widgets.Add(btnok); + btnok.Show(); + btnok.Click += (o, a) => + { + if(string.IsNullOrEmpty(txtnewname.Text)) + { + MessageBox.Show("Error: The new name must not be empty!", "Rename Widget"); return; + } + + widget.Name = txtnewname.Text.Replace(" ", ""); + this.Close(); + }; + + txtnewname = new TextBox(); + txtnewname.AutoCompleteMode = AutoCompleteMode.None; + txtnewname.AutoCompleteSource = AutoCompleteSource.None; + txtnewname.UseSystemPasswordChar = false; + txtnewname.AcceptsReturn = false; + txtnewname.CharacterCasing = CharacterCasing.Normal; + txtnewname.ScrollBars = ScrollBars.None; + txtnewname.Text = widget.Name; + txtnewname.TextAlign = HorizontalAlignment.Left; + txtnewname.Multiline = false; + txtnewname.AcceptsTab = false; + txtnewname.AutoSize = true; + txtnewname.BackColor = Color.FromArgb(240, 240, 240); + txtnewname.BorderStyle = BorderStyle.Fixed3D; + txtnewname.ForeColor = Color.FromArgb(0, 0, 0); + txtnewname.HideSelection = true; + txtnewname.MaxLength = 32767; + txtnewname.Modified = true; + txtnewname.ReadOnly = false; + txtnewname.SelectedText = ""; + txtnewname.SelectionLength = 0; + txtnewname.SelectionStart = 14; + txtnewname.ShortcutsEnabled = true; + txtnewname.WordWrap = true; + txtnewname.BackgroundImageLayout = ImageLayout.Tile; + txtnewname.Alignment = (ContentAlignment)0; + txtnewname.AccessibleDefaultActionDescription = ""; + txtnewname.AccessibleDescription = ""; + txtnewname.AccessibleName = ""; + txtnewname.AccessibleRole = AccessibleRole.Default; + txtnewname.AllowDrop = false; + txtnewname.Anchor = AnchorStyles.Top | AnchorStyles.Left; + txtnewname.AutoScrollOffset = new Point(0, 0); + txtnewname.MaximumSize = new Size(0, 0); + txtnewname.MinimumSize = new Size(0, 0); + txtnewname.Capture = false; + txtnewname.CausesValidation = true; + txtnewname.ClientSize = new Size(272, 20); + txtnewname.Dock = DockStyle.None; + txtnewname.Enabled = true; + txtnewname.Font = new Font("Microsoft Sans Serif", (float)8.25, (FontStyle)0); + txtnewname.Height = 24; + txtnewname.ImeMode = ImeMode.NoControl; + txtnewname.IsAccessible = false; + txtnewname.Left = 11; + txtnewname.Location = new Point(11, 35); + txtnewname.Name = "txtnewname"; + txtnewname.RightToLeft = RightToLeft.No; + txtnewname.Size = new Size(276, 24); + txtnewname.TabIndex = 1; + txtnewname.TabStop = true; + txtnewname.Top = 35; + txtnewname.UseWaitCursor = false; + txtnewname.Visible = true; + txtnewname.Width = 276; + this.Widgets.Add(txtnewname); + txtnewname.Show(); + lblnewnamelabel = new Label(); + lblnewnamelabel.AutoEllipsis = false; + lblnewnamelabel.AutoSize = false; + lblnewnamelabel.BackgroundImageLayout = ImageLayout.Tile; + lblnewnamelabel.BorderStyle = BorderStyle.None; + lblnewnamelabel.FlatStyle = FlatStyle.Standard; + lblnewnamelabel.ImageAlign = ContentAlignment.MiddleCenter; + lblnewnamelabel.ImageIndex = -1; + lblnewnamelabel.ImageKey = ""; + lblnewnamelabel.ImeMode = ImeMode.NoControl; + lblnewnamelabel.TabStop = false; + lblnewnamelabel.TextAlign = ContentAlignment.TopLeft; + lblnewnamelabel.UseMnemonic = true; + lblnewnamelabel.UseCompatibleTextRendering = true; + lblnewnamelabel.Text = "New name:"; + lblnewnamelabel.Alignment = (ContentAlignment)0; + lblnewnamelabel.AccessibleDefaultActionDescription = ""; + lblnewnamelabel.AccessibleDescription = ""; + lblnewnamelabel.AccessibleName = ""; + lblnewnamelabel.AccessibleRole = AccessibleRole.Default; + lblnewnamelabel.AllowDrop = false; + lblnewnamelabel.Anchor = AnchorStyles.Top | AnchorStyles.Left; + lblnewnamelabel.AutoScrollOffset = new Point(0, 0); + lblnewnamelabel.MaximumSize = new Size(0, 0); + lblnewnamelabel.MinimumSize = new Size(0, 0); + lblnewnamelabel.BackColor = Color.FromArgb(255, 255, 0); + lblnewnamelabel.Capture = false; + lblnewnamelabel.CausesValidation = true; + lblnewnamelabel.ClientSize = new Size(100, 23); + lblnewnamelabel.Dock = DockStyle.None; + lblnewnamelabel.Enabled = true; + lblnewnamelabel.Font = new Font("Microsoft Sans Serif", (float)8.25, (FontStyle)0); + lblnewnamelabel.ForeColor = Color.FromArgb(0, 0, 0); + lblnewnamelabel.Height = 23; + lblnewnamelabel.IsAccessible = false; + lblnewnamelabel.Left = 12; + lblnewnamelabel.Location = new Point(12, 18); + lblnewnamelabel.Name = "lblnewnamelabel"; + lblnewnamelabel.RightToLeft = RightToLeft.No; + lblnewnamelabel.Size = new Size(100, 23); + lblnewnamelabel.TabIndex = 2; + lblnewnamelabel.Top = 18; + lblnewnamelabel.UseWaitCursor = false; + lblnewnamelabel.Visible = true; + lblnewnamelabel.Width = 100; + this.Widgets.Add(lblnewnamelabel); + lblnewnamelabel.Show(); + + } + public Button btnok = null; public TextBox txtnewname = null; public Label lblnewnamelabel = null; + } + + public class FormSelectionForm : Form + { + public FormSelectionForm() + { + this.AllowTransparency = false; + this.AutoScale = true; + this.AutoScaleBaseSize = new Size(5, 13); + this.AutoScroll = false; + this.AutoSize = false; + this.AutoSizeMode = AutoSizeMode.GrowOnly; + this.AutoValidate = AutoValidate.Inherit; + this.BackColor = Color.FromArgb(240, 240, 240); + this.ClientSize = new Size(456, 395); + this.WidgetBox = true; + this.DesktopLocation = new Point(0, 0); + this.DialogResult = DialogResult.None; + this.FormBorderStyle = FormBorderStyle.Sizable; + this.HelpButton = false; + this.IsMdiContainer = false; + this.KeyPreview = false; + this.MaximizeBox = true; + this.MaximumSize = new Size(0, 0); + this.MinimizeBox = true; + this.MinimumSize = new Size(0, 0); + this.RightToLeftLayout = false; + this.ShowIcon = true; + this.ShowInTaskbar = true; + this.Size = new Size(456, 395); + this.SizeGripStyle = SizeGripStyle.Auto; + this.StartPosition = FormStartPosition.WindowsDefaultLocation; + this.TabIndex = 0; + this.TabStop = true; + this.TopLevel = true; + this.TopMost = false; + this.WindowState = FormWindowState.Normal; + this.Text = "Select form"; + this.Location = new Point(0, 0); + this.AutoScaleMode = AutoScaleMode.Inherit; + this.AutoScrollMargin = new Size(0, 0); + this.AutoScrollMinSize = new Size(0, 0); + this.AutoScrollPosition = new Point(0, 0); + this.Alignment = (ContentAlignment)0; + this.AccessibleDefaultActionDescription = ""; + this.AccessibleDescription = ""; + this.AccessibleName = ""; + this.AccessibleRole = AccessibleRole.Default; + this.AllowDrop = false; + this.Anchor = AnchorStyles.Top | AnchorStyles.Left; + this.AutoScrollOffset = new Point(0, 0); + this.BackgroundImageLayout = ImageLayout.Tile; + this.Capture = false; + this.CausesValidation = true; + this.Dock = DockStyle.None; + this.Enabled = true; + this.Font = new Font("Microsoft Sans Serif", (float)8.25, (FontStyle)0); + this.ForeColor = Color.FromArgb(0, 0, 0); + this.Height = 395; + this.ImeMode = ImeMode.NoControl; + this.IsAccessible = false; + this.Left = 0; + this.Name = "Form1"; + this.RightToLeft = RightToLeft.No; + this.Top = 0; + this.UseWaitCursor = false; + this.Visible = false; + this.Width = 456; + + lblabel = new Label(); + lblabel.AutoEllipsis = false; + lblabel.AutoSize = false; + lblabel.BackgroundImageLayout = ImageLayout.Tile; + lblabel.BorderStyle = BorderStyle.None; + lblabel.FlatStyle = FlatStyle.Standard; + lblabel.ImageAlign = ContentAlignment.MiddleCenter; + lblabel.ImageIndex = -1; + lblabel.ImageKey = ""; + lblabel.ImeMode = ImeMode.NoControl; + lblabel.TabStop = false; + lblabel.TextAlign = ContentAlignment.TopLeft; + lblabel.UseMnemonic = true; + lblabel.UseCompatibleTextRendering = true; + lblabel.Text = "Please select a form inside the ShiftOS code to load into the ShiftUI designer."; + lblabel.Alignment = (ContentAlignment)0; + lblabel.AccessibleDefaultActionDescription = ""; + lblabel.AccessibleDescription = ""; + lblabel.AccessibleName = ""; + lblabel.AccessibleRole = AccessibleRole.Default; + lblabel.AllowDrop = false; + lblabel.Anchor = AnchorStyles.Top | AnchorStyles.Left; + lblabel.AutoScrollOffset = new Point(0, 0); + lblabel.MaximumSize = new Size(0, 0); + lblabel.MinimumSize = new Size(0, 0); + lblabel.BackColor = Color.FromArgb(240, 240, 240); + lblabel.Capture = false; + lblabel.CausesValidation = true; + lblabel.ClientSize = new Size(390, 16); + lblabel.Dock = DockStyle.None; + lblabel.Enabled = true; + lblabel.Font = new Font("Microsoft Sans Serif", (float)8.25, (FontStyle)0); + lblabel.ForeColor = Color.FromArgb(0, 0, 0); + lblabel.Height = 16; + lblabel.IsAccessible = false; + lblabel.Left = 19; + lblabel.Location = new Point(19, 18); + lblabel.Name = "lblabel"; + lblabel.RightToLeft = RightToLeft.No; + lblabel.Size = new Size(390, 16); + lblabel.TabIndex = 0; + lblabel.Top = 18; + lblabel.UseWaitCursor = false; + lblabel.Visible = true; + lblabel.Width = 390; + this.Widgets.Add(lblabel); + lblabel.Show(); + lvforms = new ListView(); + lvforms.Activation = ItemActivation.Standard; + lvforms.Alignment = ListViewAlignment.Top; + lvforms.AllowColumnReorder = false; + lvforms.AutoArrange = true; + lvforms.BackColor = Color.FromArgb(255, 255, 255); + lvforms.BackgroundImageLayout = ImageLayout.Tile; + lvforms.BackgroundImageTiled = false; + lvforms.BorderStyle = BorderStyle.Fixed3D; + lvforms.CheckBoxes = false; + lvforms.ForeColor = Color.FromArgb(0, 0, 0); + lvforms.FullRowSelect = false; + lvforms.GridLines = false; + lvforms.HeaderStyle = ColumnHeaderStyle.Clickable; + lvforms.HideSelection = true; + lvforms.HotTracking = false; + lvforms.HoverSelection = false; + lvforms.LabelEdit = false; + lvforms.LabelWrap = true; + lvforms.MultiSelect = true; + lvforms.OwnerDraw = false; + lvforms.RightToLeftLayout = false; + lvforms.Scrollable = true; + lvforms.ShowGroups = true; + lvforms.ShowItemToolTips = false; + lvforms.Sorting = SortOrder.None; + lvforms.Text = ""; + lvforms.UseCompatibleStateImageBehavior = false; + lvforms.View = View.List; + lvforms.VirtualMode = false; + lvforms.VirtualListSize = 0; + lvforms.Alignment = (ListViewAlignment)0; + lvforms.AccessibleDefaultActionDescription = ""; + lvforms.AccessibleDescription = ""; + lvforms.AccessibleName = ""; + lvforms.AccessibleRole = AccessibleRole.Default; + lvforms.AllowDrop = false; + lvforms.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + lvforms.AutoScrollOffset = new Point(0, 0); + lvforms.AutoSize = false; + lvforms.MaximumSize = new Size(0, 0); + lvforms.MinimumSize = new Size(0, 0); + lvforms.Capture = false; + lvforms.CausesValidation = true; + lvforms.ClientSize = new Size(407, 280); + lvforms.Dock = DockStyle.None; + lvforms.Enabled = true; + lvforms.Font = new Font("Microsoft Sans Serif", (float)8.25, (FontStyle)0); + lvforms.Height = 284; + lvforms.ImeMode = ImeMode.NoControl; + lvforms.IsAccessible = false; + lvforms.Left = 16; + lvforms.Location = new Point(16, 36); + lvforms.Name = "lvforms"; + lvforms.RightToLeft = RightToLeft.No; + lvforms.Size = new Size(411, 284); + lvforms.TabIndex = 1; + lvforms.TabStop = true; + lvforms.Top = 36; + lvforms.UseWaitCursor = false; + lvforms.Visible = true; + lvforms.Width = 411; + this.Widgets.Add(lvforms); + lvforms.Show(); + btnstart = new Button(); + btnstart.AutoSizeMode = AutoSizeMode.GrowOnly; + btnstart.DialogResult = DialogResult.None; + btnstart.AutoEllipsis = false; + btnstart.AutoSize = false; + btnstart.BackColor = Color.FromArgb(240, 240, 240); + btnstart.FlatStyle = FlatStyle.Standard; + btnstart.ImageAlign = ContentAlignment.MiddleCenter; + btnstart.ImageIndex = -1; + btnstart.ImageKey = ""; + btnstart.ImeMode = ImeMode.Disable; + btnstart.Text = "Design"; + btnstart.TextAlign = ContentAlignment.MiddleCenter; + btnstart.TextImageRelation = TextImageRelation.Overlay; + btnstart.UseCompatibleTextRendering = true; + btnstart.UseMnemonic = true; + btnstart.UseVisualStyleBackColor = true; + btnstart.Alignment = (ContentAlignment)0; + btnstart.AccessibleDefaultActionDescription = ""; + btnstart.AccessibleDescription = ""; + btnstart.AccessibleName = ""; + btnstart.AccessibleRole = AccessibleRole.Default; + btnstart.AllowDrop = false; + btnstart.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; + btnstart.AutoScrollOffset = new Point(0, 0); + btnstart.MaximumSize = new Size(0, 0); + btnstart.MinimumSize = new Size(0, 0); + btnstart.BackgroundImageLayout = ImageLayout.Tile; + btnstart.Capture = false; + btnstart.CausesValidation = true; + btnstart.ClientSize = new Size(75, 23); + btnstart.Dock = DockStyle.None; + btnstart.Enabled = true; + btnstart.Font = new Font("Microsoft Sans Serif", (float)8.25, (FontStyle)0); + btnstart.ForeColor = Color.FromArgb(0, 0, 0); + btnstart.Height = 23; + btnstart.IsAccessible = false; + btnstart.Left = 17; + btnstart.Location = new Point(17, 329); + btnstart.Name = "btnstart"; + btnstart.RightToLeft = RightToLeft.No; + btnstart.Size = new Size(75, 23); + btnstart.TabIndex = 2; + btnstart.TabStop = true; + btnstart.Top = 329; + btnstart.UseWaitCursor = false; + btnstart.Visible = true; + btnstart.Width = 75; + this.Widgets.Add(btnstart); + btnstart.Show(); + btnstart.Click += (o, a) => + { + if(lvforms.SelectedItems.Count > 0) + { + var form = lvforms.SelectedItems[0].Tag as Form; + var designer = new MainEditorForm(); + designer.LoadFormFromClass(form); + } + }; + ShiftOS.Program.Main(new[] { "nodisplay" }); + ShiftOS.API.ShouldLoadEngine = false; //so that things like bitnote wallet don't try to connect to server and stuff + Assembly asm = Assembly.Load("ShiftOS"); + Type[] types = asm.GetTypes(); + Dictionary forms = new Dictionary(); + foreach(var type in types) + { + try + { + if (type.BaseType == typeof(Form) && type != this.GetType()) + { + this.Debug($"Found form \"{type.Name}\" in assembly \"{asm.FullName}\"..."); + forms.Add(type.Name, Activator.CreateInstance(type) as Form); + } + } + catch + { + + } + } + foreach(var item in forms) + { + var lvitem = new ListViewItem(); + lvitem.Text = item.Key; + lvitem.Tag = item.Value; + lvforms.Items.Add(lvitem); + } + + } + public Label lblabel = null; public ListView lvforms = null; public Button btnstart = null; + } + +} + + diff --git a/source/ShiftUI Designer/Properties/AssemblyInfo.cs b/source/ShiftUI Designer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3b60acc --- /dev/null +++ b/source/ShiftUI Designer/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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("ShiftUI Designer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ShiftUI Designer")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[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("20c1a600-b5c2-4226-b5b6-3f17716d2669")] + +// 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/source/ShiftUI Designer/ShiftUI Designer.csproj b/source/ShiftUI Designer/ShiftUI Designer.csproj new file mode 100644 index 0000000..9a748d7 --- /dev/null +++ b/source/ShiftUI Designer/ShiftUI Designer.csproj @@ -0,0 +1,71 @@ + + + + + Debug + AnyCPU + {20C1A600-B5C2-4226-B5B6-3F17716D2669} + Exe + Properties + ShiftUI_Designer + ShiftUI Designer + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + {00be72d0-b744-48ba-9c60-bc429757fc32} + ShiftOS + + + {c56e34d0-4749-4a73-9469-bccd063569cd} + ShiftUI + + + + + \ No newline at end of file -- cgit v1.2.3