From d8367a33368e783c15f2072daa9237b2643526d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Tue, 20 Feb 2018 14:17:56 +0100 Subject: [PATCH] debug threading with new TemplatedGroup arch, review examples. --- Crow.csproj | 1 + CrowIDE/ui/ProjectTree.template | 4 +- CrowIDE/ui/TreeExpandable.template | 2 +- Icons/crowproj.svg | 8 + Icons/project.svg | 2 +- Microsoft.Build.cs | 16 -- Properties/AssemblyInfo.cs | 2 +- Templates/DirectoryView.template | 2 +- Tests/BasicTests.cs | 44 ++-- Tests/Interfaces/Divers/0.crow | 4 +- .../testCtxMenu.crow | 2 +- Tests/Interfaces/Divers/testDock.crow | 7 - .../{Unsorted => Divers}/testFileDialog.crow | 0 Tests/Interfaces/Divers/testIMLContainer.crow | 2 + Tests/Interfaces/Divers/testImage.crow | 2 +- Tests/Interfaces/Divers/welcome.crow | 26 ++- Tests/Interfaces/Experimental/testDock.crow | 19 ++ .../testTypeViewer.goml | 0 .../TemplatedContainer/testTabView.crow | 2 +- .../TemplatedContainer/testTreeView.crow | 42 +--- .../TemplatedControl/testItemTemplateTag.crow | 17 +- .../TemplatedControl/testSpinner.crow | 4 +- Tests/Tests.csproj | 29 +-- src/GraphicObjects/DockWindow.cs | 135 +++++++----- src/GraphicObjects/Docker.cs | 193 +++++++++++++++++- src/GraphicObjects/GraphicObject.cs | 26 ++- src/GraphicObjects/Group.cs | 46 +++-- src/GraphicObjects/MessageBox.cs | 4 +- src/GraphicObjects/TabItem.cs | 10 +- src/GraphicObjects/TabView.cs | 4 +- src/GraphicObjects/TemplatedGroup.cs | 14 +- src/GraphicObjects/Window.cs | 2 +- src/Interface.cs | 5 +- 33 files changed, 458 insertions(+), 218 deletions(-) create mode 100644 Icons/crowproj.svg delete mode 100644 Microsoft.Build.cs rename Tests/Interfaces/{GraphicObject => Divers}/testCtxMenu.crow (52%) delete mode 100644 Tests/Interfaces/Divers/testDock.crow rename Tests/Interfaces/{Unsorted => Divers}/testFileDialog.crow (100%) create mode 100644 Tests/Interfaces/Divers/testIMLContainer.crow create mode 100644 Tests/Interfaces/Experimental/testDock.crow rename Tests/Interfaces/{Unsorted => Experimental}/testTypeViewer.goml (100%) diff --git a/Crow.csproj b/Crow.csproj index f9c42c85..228f21aa 100644 --- a/Crow.csproj +++ b/Crow.csproj @@ -379,6 +379,7 @@ + Crow.DockWindow.template diff --git a/CrowIDE/ui/ProjectTree.template b/CrowIDE/ui/ProjectTree.template index eadb733c..34a5cc84 100644 --- a/CrowIDE/ui/ProjectTree.template +++ b/CrowIDE/ui/ProjectTree.template @@ -11,14 +11,14 @@ MouseEnter="{Foreground=DimGray}" MouseLeave="{Foreground=Transparent}"> - + Path="#Crow.Icons.crowproj.svg"/> diff --git a/CrowIDE/ui/TreeExpandable.template b/CrowIDE/ui/TreeExpandable.template index 08093e4c..a2d14acd 100644 --- a/CrowIDE/ui/TreeExpandable.template +++ b/CrowIDE/ui/TreeExpandable.template @@ -5,7 +5,7 @@ MouseEnter="{Foreground=DimGray}" MouseLeave="{Foreground=Transparent}"> - + + + + + + + \ No newline at end of file diff --git a/Icons/project.svg b/Icons/project.svg index 1f9a1f1b..7522605c 100644 --- a/Icons/project.svg +++ b/Icons/project.svg @@ -4,6 +4,6 @@ height="64" width="64"> - + diff --git a/Microsoft.Build.cs b/Microsoft.Build.cs deleted file mode 100644 index eadbfe1e..00000000 --- a/Microsoft.Build.cs +++ /dev/null @@ -1,16 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Mono Runtime Version: 4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -// -//This source code was auto-generated by MonoXSD -// -namespace Schemas { - -} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index b83b6e28..3e2b7331 100755 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -43,7 +43,7 @@ using System.Runtime.CompilerServices; // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion ("0.5.*")] +[assembly: AssemblyVersion ("0.7.1.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. diff --git a/Templates/DirectoryView.template b/Templates/DirectoryView.template index 826dd3f8..2e42ae91 100755 --- a/Templates/DirectoryView.template +++ b/Templates/DirectoryView.template @@ -21,7 +21,7 @@ MouseEnter="{Foreground=DimGray}" MouseLeave="{Foreground=Transparent}"> - to toogle test files") + : base(800, 600,"test: press to toogle test files") { } int idx = 0; string[] testFiles; + public Version CrowVersion { + get { + return System.Reflection.Assembly.GetAssembly(typeof(GraphicObject)).GetName().Version; + } + } + #region Test values for Binding public List Commands; public int intValue = 500; @@ -162,31 +168,26 @@ namespace Tests this.KeyDown += KeyboardKeyDown1; - //testFiles = new string [] { @"Interfaces/Unsorted/testFileDialog.crow" }; - //testFiles = new string [] { @"Interfaces/Divers/colorPicker.crow" }; testFiles = new string [] { @"Interfaces/Divers/welcome.crow" }; - //testFiles = new string [] { @"Interfaces/TemplatedContainer/testTabView.crow" }; - //testFiles = new string [] { @"Interfaces/TemplatedControl/testSpinner.crow" }; - //testFiles = new string [] { @"Interfaces/DragAndDrop/0.crow" }; - //testFiles = new string [] { @"Interfaces/TemplatedControl/testItemTemplateTag.crow" }; - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedControl", "*.crow")).ToArray (); - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Group", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Stack", "*.crow")).ToArray (); - + testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedControl", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedContainer", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedGroup", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Wrapper", "*.crow")).ToArray (); + testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/DragAndDrop", "*.crow")).ToArray (); - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Unsorted", "*.crow")).ToArray (); + //testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Experimental", "*.crow")).ToArray (); Load(testFiles[idx]).DataSource = this; } void KeyboardKeyDown1 (object sender, OpenTK.Input.KeyboardKeyEventArgs e) { + try { + if (e.Key == OpenTK.Input.Key.Escape) { Quit (null, null); return; @@ -217,7 +218,6 @@ namespace Tests else return; - try { ClearInterface (); if (idx == testFiles.Length) @@ -230,7 +230,7 @@ namespace Tests GraphicObject obj = Load (testFiles[idx]); obj.DataSource = this; } catch (Exception ex) { - MessageBox.Show (CurrentInterface, MessageBox.Type.Error, ex.Message + "\n" + ex.InnerException); + MessageBox.Show (CurrentInterface, MessageBox.Type.Error, ex.Message + "\n" + ex.InnerException.Message); } } // void Tv_SelectedItemChanged (object sender, SelectionChangeEventArgs e) @@ -264,13 +264,17 @@ namespace Tests { Console.WriteLine ("button clicked:" + send.ToString()); } -// void onAddTabButClick(object sender, MouseButtonEventArgs e){ -// -// TabView tv = ifaceControl.CrowInterface.FindByName("tabview1") as TabView; -// if (tv == null) -// return; -// tv.AddChild (new TabItem () { Caption = "NewTab" }); -// } + void onAddTabButClick(object sender, MouseButtonEventArgs e){ + + TabView tv = FindByName("tabview1") as TabView; + if (tv == null) + return; + //tv.AddChild (new TabItem (CurrentInterface) { Caption = "NewTab" }); + lock (CurrentInterface.UpdateMutex) { + tv.AddChild (Crow.IML.Instantiator.CreateFromImlFragment + (@"").CreateInstance (CurrentInterface)); + } + } [STAThread] static void Main () { diff --git a/Tests/Interfaces/Divers/0.crow b/Tests/Interfaces/Divers/0.crow index 055b037e..47f36af5 100755 --- a/Tests/Interfaces/Divers/0.crow +++ b/Tests/Interfaces/Divers/0.crow @@ -148,8 +148,8 @@ - diff --git a/Tests/Interfaces/GraphicObject/testCtxMenu.crow b/Tests/Interfaces/Divers/testCtxMenu.crow similarity index 52% rename from Tests/Interfaces/GraphicObject/testCtxMenu.crow rename to Tests/Interfaces/Divers/testCtxMenu.crow index 86ebcf2f..edffc70a 100755 --- a/Tests/Interfaces/GraphicObject/testCtxMenu.crow +++ b/Tests/Interfaces/Divers/testCtxMenu.crow @@ -1,4 +1,4 @@ - \ No newline at end of file diff --git a/Tests/Interfaces/Divers/testDock.crow b/Tests/Interfaces/Divers/testDock.crow deleted file mode 100644 index 3dc9a6eb..00000000 --- a/Tests/Interfaces/Divers/testDock.crow +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Tests/Interfaces/Unsorted/testFileDialog.crow b/Tests/Interfaces/Divers/testFileDialog.crow similarity index 100% rename from Tests/Interfaces/Unsorted/testFileDialog.crow rename to Tests/Interfaces/Divers/testFileDialog.crow diff --git a/Tests/Interfaces/Divers/testIMLContainer.crow b/Tests/Interfaces/Divers/testIMLContainer.crow new file mode 100644 index 00000000..2ba5f2cd --- /dev/null +++ b/Tests/Interfaces/Divers/testIMLContainer.crow @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Tests/Interfaces/Divers/testImage.crow b/Tests/Interfaces/Divers/testImage.crow index cfa0f113..eddea8aa 100755 --- a/Tests/Interfaces/Divers/testImage.crow +++ b/Tests/Interfaces/Divers/testImage.crow @@ -2,7 +2,7 @@