]> O.S.I.I.S - jp/crow.git/commitdiff
crowIDE wip, lock layouting for items loading in tg
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 23 Feb 2018 11:07:22 +0000 (12:07 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 23 Feb 2018 11:07:22 +0000 (12:07 +0100)
20 files changed:
Crow.csproj
Crow.sln
CrowIDE/CrowIDE.csproj
CrowIDE/src/CrowIDE.cs
CrowIDE/src/INetProject.cs [new file with mode: 0644]
CrowIDE/src/ImlVisualEditor.cs
CrowIDE/src/Project.cs
CrowIDE/src/ProjectNodes.cs
CrowIDE/src/Solution.cs
CrowIDE/ui/CrowIDE.crow
CrowIDE/ui/MemberView.crow
CrowIDE/ui/MembersView.template
CrowIDE/ui/MenuItem.template
Icons/frame.svg [new file with mode: 0644]
Templates/ContextMenu.template
Tests/GraphicObjects/TechBorder.cs [new file with mode: 0644]
Tests/Tests.csproj
src/CompilerServices/CompilerServices.cs
src/GraphicObjects/TemplatedGroup.cs
src/Interface.cs

index af3df9f19a575c23e9f3f1e1be788be6d33631f6..6a4c56b32ea01ac340582882cf0d9837a9a5d4e2 100644 (file)
     <AssemblyOriginatorKeyFile>crow.key</AssemblyOriginatorKeyFile>
     <ProductVersion>8.0.30703</ProductVersion>
     <SchemaVersion>2.0</SchemaVersion>
-    <ReleaseVersion>0.7</ReleaseVersion>
+    <ReleaseVersion>0.5</ReleaseVersion>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
     <DebugType>full</DebugType>
     <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
-    <DefineConstants>DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_DISPOSE0;DEBUG_LAYOUTING0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
     <Optimize>false</Optimize>
     <OutputPath>$(SolutionDir)build\Debug</OutputPath>
+    <DefineConstants>DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_DISPOSE0;DEBUG_LAYOUTING0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <Optimize>true</Optimize>
     <EmbeddedResource Include="Icons\folder.svg" />
     <EmbeddedResource Include="Icons\file.svg" />
     <EmbeddedResource Include="Icons\level-up.svg" />
+    <EmbeddedResource Include="Icons\frame.svg" />
     <EmbeddedResource Include="Templates\FileItems.template" />
     <EmbeddedResource Include="Templates\DefaultItem.template">
       <LogicalName>Crow.DefaultItem.template</LogicalName>
index 156e43df52e0506bec5ca09dcf0eb291f63b9337..61aaa3af8775aeb9a09a749f64f9daf9dd49ede9 100644 (file)
--- a/Crow.sln
+++ b/Crow.sln
@@ -7,6 +7,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow.Test", "Crow.Test\Crow.Test.csproj", "{42C73BD8-51F5-4BB7-8EE9-9F0BE2D80A2C}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE", "CrowIDE\CrowIDE.csproj", "{B6D911CD-1D09-42FC-B300-9187190F2AE1}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow.Coding", "..\gts\CrowEdit\Crow.Coding\Crow.Coding.csproj", "{78842EE4-8A2F-4C75-AEC6-C95F15AD3994}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Any CPU = Debug|Any CPU
@@ -19,31 +23,47 @@ Global
                {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Any CPU.Build.0 = Release|Any CPU
+               {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Release|Any CPU.Build.0 = Release|Any CPU
                {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Any CPU.Build.0 = Release|Any CPU
+               {78842EE4-8A2F-4C75-AEC6-C95F15AD3994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {78842EE4-8A2F-4C75-AEC6-C95F15AD3994}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {78842EE4-8A2F-4C75-AEC6-C95F15AD3994}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {78842EE4-8A2F-4C75-AEC6-C95F15AD3994}.Release|Any CPU.Build.0 = Release|Any CPU
        EndGlobalSection
        GlobalSection(MonoDevelopProperties) = preSolution
                Policies = $0
                $0.StandardHeader = $1
                $1.Text = @\n${FileName}\n \nAuthor:\n      ${AuthorName} <${AuthorEmail}>\n\nCopyright (c) 2013-2017 Jean-Philippe Bruyère\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.
-               $1.IncludeInNewFiles = True
                $0.DotNetNamingPolicy = $2
-               $2.DirectoryNamespaceAssociation = None
-               $2.ResourceNamePolicy = FileFormatDefault
                $0.TextStylePolicy = $3
-               $3.FileWidth = 120
-               $3.TabsToSpaces = False
                $3.EolMarker = Unix
-               $3.inheritsSet = VisualStudio
-               $3.inheritsScope = text/plain
                $3.scope = text/x-csharp
                $0.CSharpFormattingPolicy = $4
                $4.AfterDelegateDeclarationParameterComma = True
-               $4.inheritsSet = Mono
-               $4.inheritsScope = text/x-csharp
                $4.scope = text/x-csharp
+               $4.IndentSwitchSection = False
+               $4.NewLinesForBracesInProperties = False
+               $4.NewLinesForBracesInAccessors = False
+               $4.NewLinesForBracesInAnonymousMethods = False
+               $4.NewLinesForBracesInControlBlocks = False
+               $4.NewLinesForBracesInAnonymousTypes = False
+               $4.NewLinesForBracesInObjectCollectionArrayInitializers = False
+               $4.NewLinesForBracesInLambdaExpressionBody = False
+               $4.NewLineForElse = False
+               $4.NewLineForCatch = False
+               $4.NewLineForFinally = False
+               $4.NewLineForMembersInObjectInit = False
+               $4.NewLineForMembersInAnonymousTypes = False
+               $4.NewLineForClausesInQuery = False
+               $4.SpacingAfterMethodDeclarationName = True
+               $4.SpaceAfterMethodCallName = True
+               $4.SpaceBeforeOpenSquareBracket = True
                $0.VersionControlPolicy = $5
                $5.CommitMessageStyle = $6
                $6.Indent = @\t
@@ -51,8 +71,7 @@ Global
                $6.LastFilePostfix = "@:\n  "
                $6.LineAlign = 0
                $6.Wrap = False
-               $5.inheritsSet = Mono
                description = @C.R.O.W. c# Rapid Open Widgets\n\nCrow is a pure c# widget toolkit with XML definition of interface, bindings, styling...\n
-               version = 0.7
+               version = 0.5
        EndGlobalSection
 EndGlobal
index 63ab331ec086623b2bb05da5f4f5d8df7dbf0299..10944136d40abac7761ac0a5814a6844acb12c41 100644 (file)
       <Project>{C2980F9B-4798-4C05-99E2-E174810F7C7B}</Project>
       <Name>Crow</Name>
     </ProjectReference>
+    <ProjectReference Include="..\..\gts\CrowEdit\Crow.Coding\Crow.Coding.csproj">
+      <Project>{78842EE4-8A2F-4C75-AEC6-C95F15AD3994}</Project>
+      <Name>Crow.Coding</Name>
+    </ProjectReference>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="src\CrowIDE.cs" />
     <Compile Include="src\EditPane.cs" />
     <Compile Include="src\ProjectNodes.cs" />
     <Compile Include="src\SolutionControler.cs" />
+    <Compile Include="src\INetProject.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="ui\" />
     <EmbeddedResource Include="ui\TabItem.template">
       <LogicalName>Crow.TabItem.template</LogicalName>
     </EmbeddedResource>
+    <EmbeddedResource Include="ui\MenuItem.template">
+      <LogicalName>Crow.MenuItem.template</LogicalName>
+    </EmbeddedResource>
   </ItemGroup>
   <ItemGroup>
     <None Include="ui\test.crow">
     <None Include="ui\icons\zoom-in.svg" />
     <None Include="ui\icons\zoom-out.svg" />
     <None Include="ui\icons\basic_floppydisk.svg" />
-    <None Include="ui\MenuItem.template">
-      <LogicalName>Crow.MenuItem.template</LogicalName>
-    </None>
   </ItemGroup>
 </Project>
index 2ad1fa753d5c5c672ae99fa437b03f037700765d..905468a9d3972d2265f53770ddd373df394fedd0 100644 (file)
@@ -182,13 +182,14 @@ namespace CrowIDE
                {
                        if (e.Key == OpenTK.Input.Key.Escape) {
                                Quit (null, null);
-                               return;
-                       }
-//                     else if (e.Key == OpenTK.Input.Key.F4) {
-//                             loadWindow ("#CrowIDE.ui.MemberView.crow");
-//                     } else if (e.Key == OpenTK.Input.Key.F5) {
-//                             loadWindow ("#CrowIDE.ui.GTreeExplorer.crow");
-//                     } else if (e.Key == OpenTK.Input.Key.F6) {
+                       } else if (e.Key == OpenTK.Input.Key.F5) {
+                               try {
+                                       CurrentSolution.StartupProject.Compile ();      
+                               } catch (Exception ex) {
+                                       Console.WriteLine (ex.ToString ());
+                               }
+
+                       }// else if (e.Key == OpenTK.Input.Key.F6) {
 //                             loadWindow ("#CrowIDE.ui.LQIsExplorer.crow");
 //                     } else if (e.Key == OpenTK.Input.Key.F7) {
 //                             loadWindow ("#CrowIDE.ui.CSProjExplorer.crow");
diff --git a/CrowIDE/src/INetProject.cs b/CrowIDE/src/INetProject.cs
new file mode 100644 (file)
index 0000000..53d81a1
--- /dev/null
@@ -0,0 +1,35 @@
+//
+// INetProject.cs
+//
+// Author:
+//       Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2013-2017 Jean-Philippe Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace Crow.Coding
+{
+       public interface INetProject
+       {
+               
+       }
+}
+
index 55c7b0c60de5d02f834d871baa2489dc4409802f..fe116f7888143401dcaddf764ed65f200da4b888 100644 (file)
@@ -286,6 +286,7 @@ namespace CrowIDE
                                return;
                        hr = SelectedItem.ScreenCoordinates(SelectedItem.getSlot ());
                        hr.Inflate (1);
+                       gr.LineWidth = 2;
                        gr.SetSourceColor (Color.Yellow);
                        gr.SetDash (new double[]{ 5.0, 3.0 },0.0);
                        gr.Rectangle (hr, 1.0);
index e2690b7c22d92c5c1b35294eda683ad1a935f8a8..40f14f80980ed11222b1ebd55cd3c6e05669aae0 100644 (file)
@@ -31,6 +31,7 @@ using System.Linq;
 using Microsoft.CSharp;
 using System.CodeDom.Compiler;
 using Crow;
+using System.Text.RegularExpressions;
 
 namespace CrowIDE
 {      
@@ -49,11 +50,15 @@ namespace CrowIDE
                XmlNode nodeProject;
                XmlNode nodeProps;
                XmlNodeList nodesItems;
+               SolutionProject solutionProject;
+
                public Solution solution;
                public List<Crow.Command> Commands;
                public CompilerResults CompilationResults;
                public List<Project> dependantProjects = new List<Project>();
                public Project ParentProject = null;
+               List<ProjectNode> rootItems;
+               List<ProjectNode> flattenNodes;
 
                public string Name {
                        get { return solutionProject.ProjectName; }
@@ -77,12 +82,75 @@ namespace CrowIDE
                public string Path {
                        get { return System.IO.Path.Combine (solution.SolutionFolder, solutionProject.RelativePath.Replace('\\','/')); }
                }
-
-
-               #region Project properties
                public string RootDir {
                        get { return System.IO.Path.GetDirectoryName (Path); }
                }
+
+
+
+               public List<ProjectNode> RootItems {
+                       get { return rootItems; }
+               }
+
+               void buildTreeNodes(){
+                       ProjectNode root = new ProjectNode (this, ItemType.VirtualGroup, RootNamespace);
+                       List<ProjectItem> items = new List<ProjectItem> ();
+                       foreach (XmlNode i in nodesItems) {
+                               foreach (XmlNode f in i.ChildNodes) {
+                                       items.Add (new ProjectItem (this, f));
+                               }
+                       }
+
+                       flattenNodes = new List<ProjectNode> ();
+
+                       ProjectNode refs = new ProjectNode (this, ItemType.ReferenceGroup, "References");
+                       root.ChildNodes.Add (refs);
+
+                       foreach (ProjectItem pn in items) {
+                               switch (pn.Type) {
+                               case ItemType.Reference:
+                                       refs.ChildNodes.Add (pn);
+                                       flattenNodes.Add (pn);
+                                       break;                                  
+                               case ItemType.ProjectReference:
+                                       ProjectReference pr = new ProjectReference (pn); 
+                                       refs.ChildNodes.Add (pr);
+                                       flattenNodes.Add (pr);
+                                       break;                                  
+                               case ItemType.Compile:
+                               case ItemType.None:
+                               case ItemType.EmbeddedResource:                                         
+                                       ProjectNode curNode = root;
+                                       string[] folds = pn.Path.Split ('/');
+                                       for (int i = 0; i < folds.Length - 1; i++) {
+                                               ProjectNode nextNode = curNode.ChildNodes.FirstOrDefault (n => n.DisplayName == folds [i] && n.Type == ItemType.VirtualGroup);
+                                               if (nextNode == null) {
+                                                       nextNode = new ProjectNode (this, ItemType.VirtualGroup, folds [i]);
+                                                       curNode.ChildNodes.Add (nextNode);
+                                               }
+                                               curNode = nextNode;
+                                       }
+                                       ProjectNode f = null;
+                                       switch (pn.Extension) {
+                                       case ".crow":
+                                       case ".template":
+                                               f = new ImlProjectItem (pn);
+                                               break;
+                                       default:
+                                               f = new ProjectFile (pn);
+                                               break;
+                                       }
+                                       curNode.ChildNodes.Add (f);
+                                       flattenNodes.Add (f);
+                                       break;
+                               }
+                       }
+                       root.SortChilds ();
+
+                       rootItems = root.ChildNodes;
+               }
+                       
+               #region Project properties
                public string ToolsVersion {
                        get { return nodeProject?.Attributes ["ToolsVersion"]?.Value; }
                }
@@ -128,70 +196,18 @@ namespace CrowIDE
                public string IntermediateOutputPath {
                        get { return nodeProps["IntermediateOutputPath"]?.InnerText; }
                }
-               #endregion
-
-               public List<ProjectItem> Items {
-                       get {
-                               List<ProjectItem> tmp = new List<ProjectItem> ();
-                               foreach (XmlNode i in nodesItems) {
-                                       foreach (XmlNode f in i.ChildNodes) {
-                                               tmp.Add (new ProjectItem (this, f));
-                                       }
-                               }
-                               return tmp;
-                       }
+               public string StartupObject {
+                       get { return nodeProps["StartupObject"]?.InnerText; }
+               }
+               public bool DebugSymbols {
+                       get { return nodeProps["DebugSymbols"] == null ? false : bool.Parse( nodeProps["DebugSymbols"]?.InnerText); }
+               }
+               public int WarningLevel {
+                       get { return nodeProps["WarningLevel"] == null ? 0 : int.Parse(nodeProps["WarningLevel"]?.InnerText); }
                }
 
-               public List<ProjectNode> RootItems {
-                       get {
-                               ProjectNode root = new ProjectNode (this, ItemType.VirtualGroup, RootNamespace);
-                               List<ProjectItem> items = Items;
-
-                               ProjectNode refs = new ProjectNode (this, ItemType.ReferenceGroup, "References");
-                               root.ChildNodes.Add (refs);
-
-                               foreach (ProjectItem pn in items) {
-                                       switch (pn.Type) {
-                                       case ItemType.Reference:
-                                               refs.ChildNodes.Add (pn);
-                                               break;                                  
-                                       case ItemType.ProjectReference:
-                                               refs.ChildNodes.Add (new ProjectReference(pn));
-                                               break;                                  
-                                       case ItemType.Compile:
-                                       case ItemType.None:
-                                       case ItemType.EmbeddedResource:                                         
-                                               ProjectNode curNode = root;
-                                               string[] folds = pn.Path.Split ('/');
-                                               for (int i = 0; i < folds.Length - 1; i++) {
-                                                       ProjectNode nextNode = curNode.ChildNodes.FirstOrDefault (n => n.DisplayName == folds [i] && n.Type == ItemType.VirtualGroup);
-                                                       if (nextNode == null) {
-                                                               nextNode = new ProjectNode (this, ItemType.VirtualGroup, folds [i]);
-                                                               curNode.ChildNodes.Add (nextNode);
-                                                       }
-                                                       curNode = nextNode;
-                                               }
-                                               switch (pn.Extension) {
-                                               case ".crow":
-                                               case ".template":
-                                                       curNode.ChildNodes.Add (new ImlProjectItem(pn));
-                                                       break;
-                                               default:
-                                                       curNode.ChildNodes.Add (pn);
-                                                       break;
-                                               }
-
-
-                                               break;
-                                       }
-                               }
-                               root.SortChilds ();
-
-                               return root.ChildNodes;
-                       }
+               #endregion
 
-               }
-               SolutionProject solutionProject;
 
                public Project (Solution sol, SolutionProject sp) {
                        solutionProject = sp;
@@ -225,39 +241,58 @@ namespace CrowIDE
                        if (ProjectGuid != solutionProject.ProjectGuid)
                                throw new Exception ("Project GUID not matching with solution");
 
+                       buildTreeNodes ();
+
                        IsLoaded = true;
                }
 
                void setAsStartupProject () {
                        solution.StartupProject = this;
                }
-       
-               public void Compile () {
+               static Regex regexDirTokens = new Regex(@"\$\(([^\)]*)\)|([^\$]*)");
+
+               string getDirectoryWithTokens (string dir){                     
+                       Match m = regexDirTokens.Match (dir);
+                       string tmp = "";
+                       while (m.Success)
+                       {
+                               if (m.Value == @"$(SolutionDir)")
+                                       tmp = System.IO.Path.Combine (tmp, solution.SolutionFolder);
+                               else if (m.Value == @"$(Configuration)")
+                                       tmp = System.IO.Path.Combine (tmp, "Debug");
+                               else
+                                       tmp = System.IO.Path.Combine (tmp, m.Value);
+
+                               if (tmp.EndsWith (@"\")||tmp.EndsWith (@"/"))
+                                       tmp = tmp.Remove (tmp.Length - 1);
+
+                               m = m.NextMatch();
+                       }
+                       return tmp;
+               }
+               public string Compile () {
+                       GetStyling ();
+
                        if (ParentProject != null)
                                ParentProject.Compile ();
 
                        CSharpCodeProvider cp = new CSharpCodeProvider();
                        CompilerParameters parameters = new CompilerParameters();
 
-                       foreach (ProjectItem pi in Items.Where (pp=>pp.Type == ItemType.ProjectReference)) {
-                               ProjectReference pr = new ProjectReference (pi);
+                       foreach (ProjectReference pr in flattenNodes.OfType<ProjectReference>()) {                              
                                Project p = solution.Projects.FirstOrDefault (pp => pp.ProjectGuid == pr.ProjectGUID);
                                if (p == null)
                                        throw new Exception ("referenced project not found");
-                               p.Compile ();
-                               parameters.ReferencedAssemblies.Add (pr.DisplayName);
+                               parameters.ReferencedAssemblies.Add (p.Compile ());
                        }
 
-                       foreach (ProjectItem pi in Items.Where (p=>p.Type == ItemType.Reference)) {
-                               parameters.ReferencedAssemblies.Add (pi.Path);
-                       }
-                       parameters.ReferencedAssemblies.Add ("System.Core");
-                               
-                       parameters.GenerateInMemory = true;
+                       string outputDir =  getDirectoryWithTokens(this.OutputPath);
+                       string objDir = getDirectoryWithTokens (this.IntermediateOutputPath);
 
-                       if (!Directory.Exists("testbuild"))
-                               Directory.CreateDirectory ("testbuild");
-                       parameters.OutputAssembly = "testbuild/" + this.AssemblyName;
+                       Directory.CreateDirectory (outputDir);
+                       Directory.CreateDirectory (objDir);
+
+                       parameters.OutputAssembly = System.IO.Path.Combine (outputDir, this.AssemblyName);
 
                        // True - exe file generation, false - dll file generation
                        if (this.OutputType == "Library") {
@@ -268,33 +303,89 @@ namespace CrowIDE
                                parameters.GenerateExecutable = true;
                                parameters.CompilerOptions += " /target:exe";
                                parameters.OutputAssembly += ".exe";
+                               parameters.MainClass = this.StartupObject;
                        }
 
-                       parameters.IncludeDebugInformation = true;
+                       parameters.GenerateInMemory = false;
+                       parameters.IncludeDebugInformation = this.DebugSymbols;
                        parameters.TreatWarningsAsErrors = this.TreatWarningsAsErrors;
-                       parameters.WarningLevel = 4;
+                       parameters.WarningLevel = this.WarningLevel;
                        parameters.CompilerOptions += " /noconfig";
                        if (this.AllowUnsafeBlocks)
                                parameters.CompilerOptions += " /unsafe";
                        parameters.CompilerOptions += " /delaysign+";
+                       parameters.CompilerOptions += " /debug:full /debug+";
+                       parameters.CompilerOptions += " /optimize-";
+                       parameters.CompilerOptions += " /define:\"DEBUG;TRACE\"";
+                       parameters.CompilerOptions += " /nostdlib";
+
+
+
+                       foreach (ProjectItem pi in flattenNodes.Where (p=>p.Type == ItemType.Reference)) {
+                               
+                               if (string.IsNullOrEmpty (pi.HintPath)) {
+                                       parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/" + pi.Path + ".dll";
+                                       continue;
+                               }
+                               parameters.ReferencedAssemblies.Add (pi.Path);
+                               string fullHintPath = System.IO.Path.GetFullPath(System.IO.Path.Combine (RootDir, pi.HintPath.Replace('\\','/')));
+                               if (File.Exists(fullHintPath))
+                                       File.Copy (fullHintPath, System.IO.Path.Combine(outputDir, System.IO.Path.GetFileName(fullHintPath)));
+                       }
+                       parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/System.Core.dll";
+                       parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/mscorlib.dll";
+                       //parameters.ReferencedAssemblies.Add ("System.Core");
+                       //parameters.ReferencedAssemblies.Add ("mscorlib.dll");
+
 
-                       foreach (ProjectFile pi in Items.OfType<ProjectFile>().Where (p => p.Type == ItemType.EmbeddedResource)) {
+                       IEnumerable<ProjectFile> pfs = flattenNodes.OfType<ProjectFile> ();
+
+                       foreach (ProjectFile pi in pfs.Where (p => p.Type == ItemType.EmbeddedResource)) {
                                
                                string absPath = pi.AbsolutePath;
                                string logicName = pi.LogicalName;
                                if (string.IsNullOrEmpty (logicName))
-                                       parameters.CompilerOptions += string.Format (" /resource:{0}", absPath);
+                                       parameters.CompilerOptions += string.Format (" /resource:{0},{1}", absPath , this.Name + "." + pi.Path.Replace('/','.'));
                                else
                                        parameters.CompilerOptions += string.Format (" /resource:{0},{1}", absPath, logicName);
                        }
+                       foreach (ProjectFile pi in pfs.Where (p => p.Type == ItemType.None)) {
+                               if (pi.CopyToOutputDirectory == CopyToOutputState.Never)
+                                       continue;
+                               string source = pi.AbsolutePath;
+                               string target = System.IO.Path.Combine (outputDir, pi.Path);                                    
+                               Directory.CreateDirectory (System.IO.Path.GetDirectoryName (target));
+
+                               if (File.Exists (target)) {
+                                       if (pi.CopyToOutputDirectory == CopyToOutputState.PreserveNewest) {
+                                               if (DateTime.Compare (
+                                                           System.IO.File.GetLastWriteTime (source),
+                                                           System.IO.File.GetLastWriteTime (target)) < 0)
+                                                       continue;
+                                       }
+                                       File.Delete (target);
+                               }
+                               System.Diagnostics.Debug.WriteLine ("copy " + source + " to " + target);
+                               File.Copy (source, target);
+                       }
+                       string[] files = pfs.Where (p => p.Type == ItemType.Compile).Select (p => p.AbsolutePath).ToArray();
 
-
-                       string[] files = Items.Where (p => p.Type == ItemType.Compile).Select (p => p.AbsolutePath).ToArray();
+                       System.Diagnostics.Debug.WriteLine("---- start compilation of :" + parameters.OutputAssembly);
+                       System.Diagnostics.Debug.WriteLine (parameters.CompilerOptions);
 
                        CompilationResults = cp.CompileAssemblyFromFile(parameters, files);
 
                        solution.UpdateErrorList ();
+
+                       return parameters.OutputAssembly;
                }       
+
+       
+               public void GetStyling () {
+                       foreach (ProjectFile pi in flattenNodes.OfType<ProjectFile> ().Where (pp=>pp.Type == ItemType.EmbeddedResource)) {
+                               Console.WriteLine (pi.Extension);
+                       }                       
+               }
        }
 }
 
index 5d13af05cf077b4a0dae096bdd020eb91b6d2429..bdabbdd82114a08df81fa748dde070d368f23fcb 100644 (file)
@@ -119,7 +119,9 @@ namespace CrowIDE
                                        Path.Split ('/').LastOrDefault();
                        }
                }
-
+               public string HintPath {
+                       get { return node.SelectSingleNode ("HintPath")?.InnerText; }
+               }
        }
        public class ProjectReference : ProjectItem {
                public ProjectReference (ProjectItem pi) : base (pi.Project, pi.node){
@@ -135,11 +137,18 @@ namespace CrowIDE
                        }
                }
        }
+       public enum CopyToOutputState {
+               Never,
+               Always,
+               PreserveNewest
+       }
        public class ProjectFile : ProjectItem {
+               bool isDirty = false;
+               object selectedItem;
+
                public ProjectFile (ProjectItem pi) : base (pi.Project, pi.node){                       
                }
 
-               object selectedItem;
                public string LogicalName {
                        get {
                                return node.SelectSingleNode ("LogicalName")?.InnerText;
@@ -162,7 +171,16 @@ namespace CrowIDE
                                NotifyValueChanged ("SelectedItem", selectedItem);
                        }
                }
-
+               public CopyToOutputState CopyToOutputDirectory {
+                       get {
+                               XmlNode xn = node.SelectSingleNode ("CopyToOutputDirectory");
+                               if (xn == null)
+                                       return CopyToOutputState.Never;
+                               CopyToOutputState tmp = (CopyToOutputState)Enum.Parse (typeof(CopyToOutputState), xn.InnerText, true);
+                               return tmp;
+                               //return xn == null ? CopyToOutputState.Never : (CopyToOutputState)Enum.Parse (typeof(CopyToOutputState), xn.InnerText, true);
+                       }
+               }
                public void OnQueryClose (object sender, EventArgs e){
                        Project.solution.CloseItem (this);
                }
index d8a7c4e75220b19a42dfb3766450f9999e2a58e7..c971b84783dbc0555d687201564c17dc88e4974c 100644 (file)
@@ -309,6 +309,8 @@ namespace CrowIDE{
                }
                ));
 
+                       Console.WriteLine ("******** CONFIG ***************");
+
                new Regex("GlobalSection\\(ProjectConfigurationPlatforms\\).*?[\r\n]+(.*?)EndGlobalSection[\r\n]+", RegexOptions.Singleline).Replace(slnTxt, new MatchEvaluator(m2 =>
                {
                    foreach (Match m3 in new Regex("\\s*({[A-F0-9-]+})\\.(.*?)\\.(.*?)\\s+=\\s+(.*?)[\r\n]+").Matches(m2.Groups[1].ToString()))
@@ -322,6 +324,8 @@ namespace CrowIDE{
                        if (p == null)
                            continue;
 
+                                               Console.WriteLine ("{0},{1},{2},{3}",guid,solutionConfig,action,projectConfig);
+
                        int iConfigIndex = s.configurations.IndexOf(solutionConfig);
                        if (iConfigIndex == -1)
                            continue;
index 18ffc0c3a44b92f2e6f9230de3b977a0a9b512fa..079635fed06b41493f20420b958ae6c9104e51f7 100644 (file)
@@ -41,7 +41,7 @@
                                                Data="{Projects}" SelectedItemChanged="onSelectedItemChanged"
                                                ItemTemplate="#CrowIDE.ui.ProjectTree.template"/>
                                        <Splitter/>
-                                       <MembersView Instance="{SelectedItemElement}" DataTest="Type"  Background="DimGray"
+                                       <MembersView Instance="{SelectedItemElement}" DataTest="Type"
                                                ItemTemplate="#CrowIDE.ui.MembersItem.template"/>
                                </VerticalStack>
                        </HorizontalStack>
index 4b038d9a660156df9050bc4a1e5ae596ea63620a..6cdfbf31131eadea4a27c2ab91d0e12018ccdabc 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
 <Window Caption="Properties" Width="30%" Height="60%" AlwaysOnTop="true">
-       <MembersView Instance="{SelectedItem}" DataTest="Type"  Background="DimGray"
+       <MembersView Instance="{SelectedItem}" DataTest="Type"
                ItemTemplate="#CrowIDE.ui.MembersItem.template"/>
 </Window>
\ No newline at end of file
index d541fe01779750dc70e41c538bbb52f827312852..411834c474db2ca5e5fee66209357ab350891f17 100755 (executable)
@@ -3,9 +3,19 @@
        <Border Height="Fit">
                <Label TextAlignment="Left" Text="{../../../SelectedItemName}" Width="Stretched"/>
        </Border>
-       <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true"         
-               ValueChanged="./_scroller_ValueChanged">
-               <VerticalStack LayoutChanged="./_list_LayoutChanged" Spacing="0"
-                       Height="Fit" Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
-       </Scroller>
+       <HorizontalStack>
+               <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true"
+                       Background="{./Background}"
+                       ScrollY="{../scrollbar1.Value}">
+                       <VerticalStack
+                               Height="Fit" Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
+               </Scroller>
+               <ScrollBar
+                       Name="scrollbar1"
+                       LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30"
+                       CursorSize="{../scroller1.ChildHeightRatio}"
+                       Value="{../scroller1.ScrollY}"
+                       Maximum="{../scroller1.MaximumScroll}"
+                       Width="14" Orientation="Vertical"/>
+       </HorizontalStack>
 </VerticalStack>
index 5752b088ce7607ae7c589da03eafe79ba7f2f9c1..eccad164324121cdbfa82f8edc910c653f7ccccf 100644 (file)
@@ -3,21 +3,25 @@
        Foreground = "{./Foreground}" CanPop="{./HasChildren}" MouseClick="./onMI_Click"
        IsPopped="{²./IsOpened}" PopWidth="{./PopWidth}" PopHeight="{./PopHeight}" IsEnabled="{./IsEnabled}">
        <Template>
-               <Border Name="border1"
-                               MouseEnter="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
-                               MouseLeave="{Foreground=Transparent}"
-                               MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}"
-                               MouseUp="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
-                               MinimumSize = "40,0"
-                               Foreground="Transparent"
-                               Background="{./Background}">
-                               <HorizontalStack HorizontalAlignment="Left" Margin="1">
-                                       <Image MaximumSize="10,10" Picture="{../../../../Icon}"/>
-                                       <Label Text="{./Caption}"
-                                               Foreground="{./Foreground}"
-                                               Font="{./Font}" />
-                               </HorizontalStack>
-               </Border>
+               <CheckBox IsChecked="{²./IsPopped}" Caption="{./Caption}" Background="{./Background}" Foreground="{./Foreground}">
+                       <Template>
+                               <Border Name="border1"
+                                               MouseEnter="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
+                                               MouseLeave="{Foreground=Transparent}"
+                                               MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}"
+                                               MouseUp="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
+                                               MinimumSize = "40,0"
+                                               Foreground="Transparent"
+                                               Background="{./Background}">
+                                               <HorizontalStack HorizontalAlignment="Left" Margin="1">
+                                                       <Image MaximumSize="10,10" Picture="{../../../../../Icon}"/>
+                                                       <Label Text="{./Caption}"
+                                                               Foreground="{./Foreground}"
+                                                               Font="{./Font}" />
+                                               </HorizontalStack>
+                               </Border>
+                       </Template>
+               </CheckBox>
        </Template>
        <Border Foreground="DimGray" Width="{../PopWidth}" Height="{../PopHeight}" Background="Onyx">
                <VerticalStack Name="ItemsContainer"/>
diff --git a/Icons/frame.svg b/Icons/frame.svg
new file mode 100644 (file)
index 0000000..576d418
--- /dev/null
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="67.316353mm"
+   height="27.756908mm"
+   viewBox="0 0 67.316353 27.756908"
+   version="1.1"
+   id="svg8895"
+   inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
+   sodipodi:docname="frame.svg">
+  <defs
+     id="defs8889" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#434343"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="195.58263"
+     inkscape:cy="-58.812438"
+     inkscape:document-units="mm"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1600"
+     inkscape:window-height="881"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     fit-margin-top="0"
+     fit-margin-left="0"
+     fit-margin-right="0"
+     fit-margin-bottom="0" />
+  <metadata
+     id="metadata8892">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Calque 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(106.44585,-169.24652)">
+    <polygon
+       transform="matrix(0.26458333,0,0,0.26458333,-314.15488,52.734079)"
+       style="fill:#f5fcff"
+       id="polygon6818"
+       points="860.815,440.362 785.042,440.362 785.042,469.369 789.327,469.369 789.327,515.071 815.242,540.986 971.44,540.986 971.44,545.27 1001.438,545.27 1001.438,540.986 1039.466,540.986 1039.466,470.564 1013.109,444.207 1012.21,445.105 1038.193,471.091 1038.193,539.714 815.77,539.714 790.598,514.544 790.598,445.919 1014.176,445.919 1014.176,444.648 860.815,444.648 " />
+  </g>
+</svg>
index 3fb2955225c592b40e16ea18b0e0092971d7979e..58e71b7ce89f36f5777201301e9f496f1a82f579 100644 (file)
@@ -14,7 +14,7 @@
                <MenuItem Command="{}" Width="150" PopWidth="120" SelectionBackground="Transparent">
                        <Template>
                                <Popper Font="{./Font}" Caption="{./Caption}"  Background="{./Background}" PopDirection="{./PopDirection}"
-                                       Foreground = "{./Foreground}" CanPop="{./HasChildren}" MouseClick="./onMI_Click"
+                                       Foreground = "{./Foreground}" CanPop="{./HasChildren}" MouseDown="./onMI_Click"
                                        IsPopped="{²./IsOpened}" PopWidth="{./PopWidth}" PopHeight="{./PopHeight}">
                                        <Template>
                                                <Border Name="border1"
diff --git a/Tests/GraphicObjects/TechBorder.cs b/Tests/GraphicObjects/TechBorder.cs
new file mode 100644 (file)
index 0000000..4f818e5
--- /dev/null
@@ -0,0 +1,88 @@
+//
+// TechBorder.cs
+//
+// Author:
+//       Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2013-2017 Jean-Philippe Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Crow;
+
+namespace Tests
+{
+       public class TechBorder : Container
+       {
+               public TechBorder () : base() {}
+               public TechBorder (Interface iface): base (iface){}
+
+               protected override int measureRawSize (LayoutingType lt)
+               {
+                       return base.measureRawSize (lt) + 6;
+               }
+               protected override void onDraw (Cairo.Context gr)
+               {
+                       gr.Save ();
+
+                       drawTechBorder1 (gr);
+
+                       if (child != null) {
+                               if (child.Visible)
+                                       child.Paint (ref gr);
+                       }
+
+                       gr.Restore ();
+               }
+
+               void drawTechBorder1 (Cairo.Context gr){
+                       Rectangle r = ClientRectangle;
+
+                       double l1 = Math.Round(0.2 * Math.Min (r.Width, r.Height)) + 0.5;
+
+                       Foreground.SetAsSource (gr);
+                       gr.LineWidth = 6.0;
+                       gr.MoveTo (r.Left + 1.5, r.Top + l1);
+                       gr.LineTo (r.Left + 1.5, r.Top + 1.5);
+                       gr.LineTo (r.Left + l1, r.Top + 1.5);
+                       gr.MoveTo (r.Left + r.Width * 0.65, r.Bottom - 1.5);
+                       gr.LineTo (r.Left + r.Width * 0.85, r.Bottom - 1.5);
+                       gr.Stroke ();
+
+                       gr.MoveTo (r.Left + 2.5, r.Top + 2.5);
+                       gr.LineTo (r.Left + 2.5, r.Bottom - l1);
+                       gr.LineTo (r.Left + l1, r.Bottom - 2.5);
+                       gr.LineTo (r.Right - 2.5, r.Bottom - 2.5);
+                       gr.LineTo (r.Right - 2.5, r.Top + l1);
+                       gr.LineTo (r.Right - l1, r.Top + 2.5);
+                       gr.ClosePath ();
+
+                       if (ClipToClientRect) //clip to client zone                             
+                               gr.ClipPreserve ();                     
+
+                       Background.SetAsSource (gr);
+                       gr.FillPreserve ();
+
+                       gr.LineWidth = 1.0;
+                       Foreground.SetAsSource (gr);
+                       gr.Stroke ();                   
+               }
+       }
+}
+
index be91d79121b5b4beef7b08ec05beaee6a9b8df07..677eec33cdda71d77b29d8b331242cc21e16c02d 100644 (file)
@@ -8,10 +8,10 @@
     <OutputType>Exe</OutputType>
     <RootNamespace>Tests</RootNamespace>
     <AssemblyName>Tests</AssemblyName>
-    <StartupObject>Tests.Showcase</StartupObject>
+    <StartupObject>Tests.BasicTests</StartupObject>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ReleaseVersion>0.7</ReleaseVersion>
+    <ReleaseVersion>0.5</ReleaseVersion>
     <OutputPath>$(SolutionDir)build/$(Configuration)</OutputPath>
     <IntermediateOutputPath>$(SolutionDir)build/obj/$(Configuration)</IntermediateOutputPath>
     <CustomCommands>
     <Compile Include="Tutorials\T4_Gauge.cs" />
     <Compile Include="Tutorials\T2_IML.cs" />
     <Compile Include="GraphicObjects\HexaContainer.cs" />
+    <Compile Include="GraphicObjects\TechBorder.cs" />
   </ItemGroup>
   <ItemGroup>
     <None Include="image\u.svg">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
     <None Include="Interfaces\Container\0.crow">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="Interfaces\Container\1.crow">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
+    <None Include="Interfaces\Container\1.crow" />
     <None Include="Interfaces\Container\2.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
index dbd12d414c14a8f02a5cd80b19f5a2b47506d0b2..1e7fab8e4628bb05b65688fbe369e7ee206ea9a9 100644 (file)
@@ -159,18 +159,18 @@ namespace Crow.IML
                                                        else
                                                                il.Emit (OpCodes.Ldc_I4_0);
                                                        break;
-                                                       //                                              case TypeCode.Empty:
-                                                       //                                                      break;
-                                                       //                                              case TypeCode.Object:
-                                                       //                                                      break;
-                                                       //                                              case TypeCode.DBNull:
-                                                       //                                                      break;
-                                                       //                                              case TypeCode.SByte:
-                                                       //                                                      break;
-                                                       //                                              case TypeCode.Decimal:
-                                                       //                                                      break;
-                                                       //                                              case TypeCode.DateTime:
-                                                       //                                                      break;
+//                                             case TypeCode.Empty:
+//                                                     break;
+//                                             case TypeCode.Object:
+//                                                     break;
+//                                             case TypeCode.DBNull:
+//                                                     break;
+//                                             case TypeCode.SByte:
+//                                                     break;
+//                                             case TypeCode.Decimal:
+//                                                     break;
+//                                             case TypeCode.DateTime:
+//                                                     break;
                                                case TypeCode.Char:
                                                        il.Emit (OpCodes.Ldc_I4, Convert.ToChar (val));
                                                        break;
index 8025435d8483cd0fff8afaa04f7d74e5181b917d..a6f1b1514269f009b1d2fa130602eed8f7a9ad4c 100644 (file)
@@ -427,13 +427,13 @@ namespace Crow
                                        iTemp = ItemTemplates ["default"];
                        }
 
-                       //lock (CurrentInterface.LayoutMutex) {
+                       lock (CurrentInterface.LayoutMutex) {
                                g = iTemp.CreateInstance(CurrentInterface);
                                page.AddChild (g);
 //                             if (isPaged)
                                g.LogicalParent = this;
                                g.MouseDown += itemClick;
-                       //}
+                       }
 
                        if (iTemp.Expand != null && g is Expandable) {
                                (g as Expandable).Expand += iTemp.Expand;
index 485101e61c2b505426a3bee51ff238399865f293..3d2389b2db00604755baff0761c6b1e01be3ddd7 100644 (file)
@@ -1091,16 +1091,18 @@ namespace Crow
 
                public void ShowContextMenu (GraphicObject go) {
 
-                       if (ctxMenuContainer.Parent == null)
-                               this.AddWidget (ctxMenuContainer);
-                       else
-                               ctxMenuContainer.IsOpened = true;
+                       lock (UpdateMutex) {
+                               if (ctxMenuContainer.Parent == null)
+                                       this.AddWidget (ctxMenuContainer);
+                               else
+                                       ctxMenuContainer.IsOpened = true;
 
-                       ctxMenuContainer.isPopup = true;
-                       ctxMenuContainer.LogicalParent = go;
-                       ctxMenuContainer.DataSource = go;
+                               ctxMenuContainer.isPopup = true;
+                               ctxMenuContainer.LogicalParent = go;
+                               ctxMenuContainer.DataSource = go;
 
-                       PutOnTop (ctxMenuContainer, true);
+                               PutOnTop (ctxMenuContainer, true);
+                       }
                        ctxMenuContainer.Left = Mouse.X - 5;
                        ctxMenuContainer.Top = Mouse.Y - 5;