]> O.S.I.I.S - jp/crow.git/commitdiff
debug threading with new TemplatedGroup arch, review examples. singleLeveledTemplatedGroup
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Tue, 20 Feb 2018 13:17:56 +0000 (14:17 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Tue, 20 Feb 2018 13:22:24 +0000 (14:22 +0100)
36 files changed:
Crow.csproj
CrowIDE/ui/ProjectTree.template
CrowIDE/ui/TreeExpandable.template
Icons/crowproj.svg [new file with mode: 0644]
Icons/project.svg
Microsoft.Build.cs [deleted file]
Properties/AssemblyInfo.cs
Templates/DirectoryView.template
Tests/BasicTests.cs
Tests/Interfaces/Divers/0.crow
Tests/Interfaces/Divers/testCtxMenu.crow [new file with mode: 0755]
Tests/Interfaces/Divers/testDock.crow [deleted file]
Tests/Interfaces/Divers/testFileDialog.crow [new file with mode: 0644]
Tests/Interfaces/Divers/testIMLContainer.crow [new file with mode: 0644]
Tests/Interfaces/Divers/testImage.crow
Tests/Interfaces/Divers/welcome.crow
Tests/Interfaces/Experimental/testDock.crow [new file with mode: 0644]
Tests/Interfaces/Experimental/testTypeViewer.goml [new file with mode: 0755]
Tests/Interfaces/GraphicObject/testCtxMenu.crow [deleted file]
Tests/Interfaces/TemplatedContainer/testTabView.crow
Tests/Interfaces/TemplatedContainer/testTreeView.crow
Tests/Interfaces/TemplatedControl/testItemTemplateTag.crow
Tests/Interfaces/TemplatedControl/testSpinner.crow
Tests/Interfaces/Unsorted/testFileDialog.crow [deleted file]
Tests/Interfaces/Unsorted/testTypeViewer.goml [deleted file]
Tests/Tests.csproj
src/GraphicObjects/DockWindow.cs
src/GraphicObjects/Docker.cs
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/Group.cs
src/GraphicObjects/MessageBox.cs
src/GraphicObjects/TabItem.cs
src/GraphicObjects/TabView.cs
src/GraphicObjects/TemplatedGroup.cs
src/GraphicObjects/Window.cs
src/Interface.cs

index f9c42c852c99cc8f62346f39e3a5abe89c607375..228f21aa10a463dc0a2d684e304a82ef1d9f0615 100644 (file)
     </EmbeddedResource>
     <EmbeddedResource Include="Icons\compiler_error.svg" />
     <EmbeddedResource Include="Icons\project.svg" />
+    <EmbeddedResource Include="Icons\crowproj.svg" />
     <EmbeddedResource Include="Icons\projectRef.svg" />
     <EmbeddedResource Include="Templates\DockWindow.template">
       <LogicalName>Crow.DockWindow.template</LogicalName>
index eadb733c83d918c3ac987cd6a5101a66ee74073c..34a5cc840fe00a3e0e7b3abfeb52f9cfc3e4f2f8 100644 (file)
                                                MouseEnter="{Foreground=DimGray}"
                                                MouseLeave="{Foreground=Transparent}">
                                        <HorizontalStack Spacing="1">
-                                               <Image Margin="1" Width="9" Height="9" Focusable="true" MouseClick="./onClickForExpand"
+                                               <Image Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand"
                                                        Path="{./Image}"
                                                        Visible="{./IsExpandable}"
                                                        SvgSub="{./IsExpanded}"
                                                        MouseEnter="{Background=LightGray}"
                                                        MouseLeave="{Background=Transparent}"/>
                                                <Image Margin="1" Width="14" Height="14"
-                                                       Path="#Crow.Icons.project.svg"/>
+                                                       Path="#Crow.Icons.crowproj.svg"/>
                                                <GraphicObject Width="2" Height="9" Background="Green" Visible="{IsStartupProject}"/>
                                                <Label Text="{./Caption}"/>
                                        </HorizontalStack>
index 08093e4c630eb40b714bdab81f1f8417f9181072..a2d14acd7c99db66789dbb80691fad1e9647634f 100644 (file)
@@ -5,7 +5,7 @@
                        MouseEnter="{Foreground=DimGray}"
                        MouseLeave="{Foreground=Transparent}">
                <HorizontalStack Spacing="1">
-                       <Image Margin="1" Width="9" Height="9" Focusable="true" MouseClick="./onClickForExpand"
+                       <Image Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand"
                                Path="{./Image}"
                                Visible="{./IsExpandable}"
                                SvgSub="{./IsExpanded}"
diff --git a/Icons/crowproj.svg b/Icons/crowproj.svg
new file mode 100644 (file)
index 0000000..b0f6b86
--- /dev/null
@@ -0,0 +1,8 @@
+<svg width="64" height="64" xmlns="http://www.w3.org/2000/svg">
+ <!-- Created with Method Draw - http://github.com/duopixel/Method-Draw/ -->
+ <g>
+  <rect opacity="1.0" rx="5" id="svg_1" height="59" width="59" y="2.5" x="2.5" stroke-width="6" stroke="#111111" fill="#bbbbcc"/>
+  <rect opacity="1.0" rx="5" id="svg_1" height="22" width="59" y="2.5" x="2.5" stroke-width="6" stroke="#111111" fill="#4455aa"/>
+<!--  <line stroke-linecap="undefined" stroke-linejoin="undefined" id="svg_2" y2="24.5" x2="61.5" y1="24.5" x1="2.5" stroke-width="6" stroke="#bbbbbb" fill="none"/>-->
+ </g>
+</svg>
\ No newline at end of file
index 1f9a1f1bae7f1cc44b2b689c79ac0d389a1fb925..7522605c9ea93456273bad8ea510575830bf0ea4 100644 (file)
@@ -4,6 +4,6 @@
    height="64"
    width="64">  
   <g>
-   <path fill="#007fff" stroke="#111111" stroke-width="2" d="m1.655043,19.482317l17.905939,-17.913175l25.323143,0l17.905937,17.913175l0,25.333551l-17.905937,17.913147l-25.323143,0l-17.905939,-17.913147l0,-25.333551z" id="svg_2"/>
+   <path fill="#3333dd" stroke="#bbbbff" stroke-width="10" d="m1.655043,19.482317l17.905939,-17.913175l25.323143,0l17.905937,17.913175l0,25.333551l-17.905937,17.913147l-25.323143,0l-17.905939,-17.913147l0,-25.333551z" id="svg_2"/>
   </g>
 </svg>
diff --git a/Microsoft.Build.cs b/Microsoft.Build.cs
deleted file mode 100644 (file)
index eadbfe1..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// ------------------------------------------------------------------------------
-//  <autogenerated>
-//      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.
-//  </autogenerated>
-// ------------------------------------------------------------------------------
-
-// 
-//This source code was auto-generated by MonoXSD
-//
-namespace Schemas {
-    
-}
index b83b6e284ecc3853f46698461a4421fd8022519e..3e2b7331631a39184284bd0c327e690581dbd708 100755 (executable)
@@ -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.
index 826dd3f83d78fb6b9ce3ac2ce1cb6bcc017245c4..2e42ae91a79b760f10e5d9dfa8ca720d58f8f99f 100755 (executable)
@@ -21,7 +21,7 @@
                                                        MouseEnter="{Foreground=DimGray}"
                                                        MouseLeave="{Foreground=Transparent}">
                                                <HorizontalStack Spacing="1">
-                                                       <Image Margin="1" Width="9" Height="9" Focusable="true" MouseClick="./onClickForExpand"
+                                                       <Image Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand"
                                                                Path="{./Image}"
                                                                Visible="{./IsExpandable}"
                                                                SvgSub="{./IsExpanded}"
index 97469591f9abc69f7c12b564c3da0766654c3a01..5e988c81b0c75013492f66fa21223db272e50b5a 100644 (file)
@@ -39,13 +39,19 @@ namespace Tests
        class BasicTests : CrowWindow
        {
                public BasicTests ()
-                       : base(1280, 800,"test: press <F3> to toogle test files")
+                       : base(800, 600,"test: press <F3> 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<Crow.Command> 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
+                                       (@"<TabItem Caption='New tab' Background='Blue'><Label/></TabItem>").CreateInstance (CurrentInterface));
+                       }
+               }
                [STAThread]
                static void Main ()
                {
index 055b037ed555fe99fae5b71a8778f8a72a3c6f31..47f36af5538d2001879d4230b740d6b7b83e5c1b 100755 (executable)
                <VerticalStack Width="30%" Margin="5">
 <!--                   <Border Margin="5" Height="Fit">
                                <Label Width="Stretched" Margin="1" Text="{../../dv.SelectedItem}"/>
-                       </Border>-->
-<!--                   <Border Margin="5" Height="30%">
+                       </Border>
+                       <Border Margin="5" Height="30%">
                                <DirectoryView Name="dv" CurrentDirectory="/" Margin="1"/>
                        </Border>
                        <Splitter/>-->
diff --git a/Tests/Interfaces/Divers/testCtxMenu.crow b/Tests/Interfaces/Divers/testCtxMenu.crow
new file mode 100755 (executable)
index 0000000..edffc70
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<GraphicObject Margin="10" Width="50%" Height="50%" Focusable="true"
+               Background="hgradient|0:Red|0.25:Blue|0.5:Green|0.75:Yellow|1:Red"
+               MinimumSize="50,50" ContextCommands="{Commands}"/>
\ No newline at end of file
diff --git a/Tests/Interfaces/Divers/testDock.crow b/Tests/Interfaces/Divers/testDock.crow
deleted file mode 100644 (file)
index 3dc9a6e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<Docker Background="Jet" Margin = "0" Focusable="true" >
-       <DockWindow Focusable="true" Caption="View 1" Width="100" Height="100"><GraphicObject Background="Green"/></DockWindow>
-       <DockWindow Focusable="true" Caption="View 2" Resizable = "true" Width="100" Height="100"><GraphicObject Background="Blue"/></DockWindow>
-       <DockWindow Focusable="true" Caption="View 3" Resizable = "true" Width="100" Height="100"><GraphicObject Background="Yellow"/></DockWindow>
-       <DockWindow Focusable="true" Caption="View 4" Resizable = "true" Width="100" Height="100"><GraphicObject Background="Black"/></DockWindow>
-</Docker>
\ No newline at end of file
diff --git a/Tests/Interfaces/Divers/testFileDialog.crow b/Tests/Interfaces/Divers/testFileDialog.crow
new file mode 100644 (file)
index 0000000..868baf6
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<FileDialog Caption="Open File" CurrentDirectory="/" SearchPattern="*.*"/>
+
diff --git a/Tests/Interfaces/Divers/testIMLContainer.crow b/Tests/Interfaces/Divers/testIMLContainer.crow
new file mode 100644 (file)
index 0000000..2ba5f2c
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<IMLContainer Path="Interfaces/Divers/colorPicker.crow"/>
\ No newline at end of file
index cfa0f113f65d4dbcb6d482d786721f344a9d7c37..eddea8aa7e31abf1df2b495fb65a6581e47a6352 100755 (executable)
@@ -2,7 +2,7 @@
 <VerticalStack Fit="true">
        <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" Margin="5">
                <Label Text="SCALED PROPORTIONNAL" Width="150"/>
-               <Image Width="50%" Height="Fit" Background="vgradient|0:SkyBlue|1:White" Path="#Tests.image.crow0.svg"/>
+               <Image Width="10%" Height="Fit" Background="vgradient|0:SkyBlue|1:White" Path="#Tests.image.crow0.svg"/>
                <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Path="#Tests.image.crow0.svg" />
                <Image Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Tests.image.crow0.svg" />
                <Image Margin="2" Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Tests.image.crow0.svg" />
index c4ec889f11bd47b92949ea2d2ce2baeecdeb948f..3a08829c785834c23ea0f899f550f9595ff0a15e 100644 (file)
@@ -1,7 +1,21 @@
 <?xml version="1.0"?>
-<VerticalStack Fit="true" VerticalAlignment="Top" Background="0.7,0.7,0.7,0.5"
-       Margin="10" CornerRadius="10">
-       <Label Font="20" Text="Press &lt;F3&gt; to cycle into the examples"/>
-       <Label Font="20" Text="Those are basic tests used to validate changes"/>
-       <Label Font="20" Text="{fps}"/>
-</VerticalStack>
\ No newline at end of file
+<Border BorderStyle="Sunken" Fit="true" Background="0.7,0.7,0.7,0.5" CornerRadius="10">
+       <VerticalStack Margin="20">
+               <Image Path="#Crow.Images.Icons.crow.svg"/>
+<!--           <Label Font="Times bold, 60" Text="C.R.O.W"/>-->
+               <HorizontalStack Fit="true" DataSource="{CrowVersion}" Spacing="0">
+                       <Label Foreground="Black" Font="mono, 12" Text="version: "/>            
+                       <Label Foreground="Black" Font="mono, 12" Text="{Major}"/>              
+                       <Label Foreground="Black" Font="mono, 12" Text="."/>
+                       <Label Foreground="Black" Font="mono, 12" Text="{Minor}"/>
+                       <Label Foreground="Black" Font="mono, 12" Text="."/>
+                       <Label Foreground="Jet" Font="mono, 12" Text="{Build}"/>
+               </HorizontalStack>
+               <GraphicObject Height="30"/>
+               <Label Font="20" Text="Press &lt;F2&gt; and &lt;F3&gt; to cycle into the examples"/>
+               <Label Font="20" Text="Those are basic tests used to validate changes,"/>
+               <GraphicObject Height="30"/>
+               <Label Foreground="Jet" Font="20" Text="&lt;F5&gt; => File dialog example"/>
+               <Label Foreground="Jet" Font="20" Text="&lt;F6&gt; => Window example"/>
+       </VerticalStack>
+</Border>
\ No newline at end of file
diff --git a/Tests/Interfaces/Experimental/testDock.crow b/Tests/Interfaces/Experimental/testDock.crow
new file mode 100644 (file)
index 0000000..8a9df9c
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!--<Docker Background="Jet" Margin = "0" Focusable="true" >
+       <DockWindow Focusable="true" Caption="View 1" Width="100" Height="100"><GraphicObject Background="Green"/></DockWindow>
+       <DockWindow Focusable="true" Caption="View 2" Resizable = "true" Width="100" Height="100"><GraphicObject Background="Blue"/></DockWindow>
+       <DockWindow Focusable="true" Caption="View 3" Resizable = "true" Width="100" Height="100"><GraphicObject Background="Yellow"/></DockWindow>
+       <DockWindow Focusable="true" Caption="View 4" Resizable = "true" Width="100" Height="100"><GraphicObject Background="Black"/></DockWindow>
+</Docker>-->
+<!--<Group Background="Jet" Margin = "0" Focusable="true" >
+       <Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Gray}" MouseLeave="{Background=Green}"/></Window>
+       <Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></Window>
+       <Window Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></Window>
+       <Window Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></Window>
+</Group>-->
+<Docker Background="Jet" Margin = "0" Focusable="true" >
+       <DockWindow Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Gray}" MouseLeave="{Background=Green}"/></DockWindow>
+       <DockWindow Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></DockWindow>
+       <DockWindow Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></DockWindow>
+       <DockWindow Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></DockWindow>
+</Docker>
\ No newline at end of file
diff --git a/Tests/Interfaces/Experimental/testTypeViewer.goml b/Tests/Interfaces/Experimental/testTypeViewer.goml
new file mode 100755 (executable)
index 0000000..caa454f
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+
+       <VerticalStack Height="Fit" Width="250" Name="hstack" Margin="0" Spacing="0">
+               <Border Height="Fit" Width="Stretched" BorderWidth="2" CornerRadius="10" Background="SteelBlue">
+                       <Label Name="labName" Text="{Name}" Width="Stretched" Height="Fit" Margin="3"/>
+               </Border>
+               <ListBox Data="{Members}" Width="Stretched" Height="400" ItemTemplate="Interfaces/tmpMembers.goml" Focusable="true">
+                       
+               </ListBox>
+       </VerticalStack>
diff --git a/Tests/Interfaces/GraphicObject/testCtxMenu.crow b/Tests/Interfaces/GraphicObject/testCtxMenu.crow
deleted file mode 100755 (executable)
index 86ebcf2..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<GraphicObject MouseEnter="{Background=Red}" MouseLeave="{Background=Green}" Margin="10" Width="50%" Height="50%" Focusable="true"
-               Background="hgradient|0:Red|0.25:Blue|0.5:Green|0.75:Yellow|1:Red"
-               MinimumSize="50,50" ContextCommands="{Commands}"/>
\ No newline at end of file
index f9934007be48313f7f4c47e903e668142360fecd..c6cc043b7ee5af9b05686e2d46baa9f55f859181 100644 (file)
@@ -31,5 +31,5 @@
                </TabItem>
        </TabView>
        <Button Background="vgradient|0:DimGray|1:Black" HorizontalAlignment="Right"
-               Caption="Add new tab" Width="Fit" Height="30" MouseClick="onAddTabButClick"/>
+               Caption="Add new tab" Width="Fit" Height="30" MouseDown="onAddTabButClick"/>
 </VerticalStack>
index 9d58cda6dc5e7834de3e984cea8496a2dcb1a47b..099ce66d79d0a92b225194854e24b6798bc02b92 100755 (executable)
@@ -1,40 +1,4 @@
 <?xml version="1.0"?>
-<TreeView IsRoot="true" Name="treeView" Data="{CurDirectory}" Background="DimGray">
-       <ItemTemplate DataType="System.IO.FileInfo">
-               <HorizontalStack Focusable="true"  Height="Fit" Width="Stretched"  >
-                       <Image Margin="2" Width="14" Height="14"
-                               Path="#Crow.Images.Icons.file.svg"/>
-                       <Label Text="{Name}" Width="Stretched"
-                               MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
-                               MouseLeave="{Background=Transparent}"/>
-               </HorizontalStack>
-       </ItemTemplate>
-       <ItemTemplate DataType="System.IO.DirectoryInfo" Data="GetFileSystemInfos">
-               <Expandable Caption="{Name}" >
-                       <Template>
-                               <VerticalStack>
-                                       <HorizontalStack Spacing="1" Height="Fit"
-                                                       MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
-                                                       MouseLeave="{Background=Transparent}">
-                                               <Image Margin="2" Width="12" Height="12"
-                                                       Visible="{./HasContent}"
-                                                       Path="{./Image}"
-                                                       SvgSub="{./IsExpanded}"/>
-                                               <Image Margin="2" Width="14" Height="14"
-                                                       Path="#Crow.Images.Icons.folder.svg"/>
-                                               <Label Text="{./Caption}"/>
-                                       </HorizontalStack>
-                                       <Container Name="Content" Visible="false"/>
-                               </VerticalStack>
-                       </Template>
-                       <HorizontalStack Height="Fit">
-                               <GraphicObject Width="12" Height="10"/>
-                               <TreeView Name="List" Height="Fit">
-                                       <Template>
-                                               <VerticalStack Height="Fit" Name="ItemsContainer"/>
-                                       </Template>
-                               </TreeView>
-                       </HorizontalStack>
-               </Expandable>
-       </ItemTemplate>
-</TreeView>
+<Border Margin="5" Height="90%" Width="50%">
+       <DirectoryView Name="dv" CurrentDirectory="/" Margin="1"/>
+</Border>
\ No newline at end of file
index 65b77d7945b78329cd351efba848fb8c214a6ab5..54ccde153452b802ec4e0b4862d8d1f96b2c9099 100755 (executable)
@@ -6,16 +6,15 @@
                        <Template>
                                <Border BorderWidth="1">
                                        <HorizontalStack Margin="1">
-                                               <Scroller Name="scroller1"
+                                               <Scroller Name="scroller1" 
                                                                Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Value}">
                                                        <VerticalStack Height="Fit" MinimumSize="10,10"
-                                                               Name="ItemsContainer" Margin="0"
-                                                               VerticalAlignment="Top"
-                                                               HorizontalAlignment="Left"/>
+                                                               Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
                                                </Scroller>
-                                               <ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
-                                                       Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
-                                                       Width="14"/>
+                                               <ScrollBar Name="scrollbar1" Value="{²../scroller1.ScrollY}"
+                                                       LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30" CursorSize="{../scroller1.ChildHeightRatio}"
+                                                       Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical" 
+                                                       Width="14" />
                                        </HorizontalStack>
                                </Border>
                        </Template>
@@ -31,8 +30,8 @@
                        </ItemTemplate>
                </ListBox>
                <HorizontalStack Fit="true" HorizontalAlignment="Right">
-                       <Button Caption="Load list" MouseClick="OnLoadList"/>
-                       <Button Caption="Clear" MouseClick="OnClear"/>
+                       <Button Caption="Load list" MouseDown="OnLoadList"/>
+                       <Button Caption="Clear" MouseDown="OnClear"/>
                </HorizontalStack>
        </VerticalStack>
 </Border>
index 09f618be181beada32b110059922b21b1fe549d6..07d62e6528f4d3dc4224a9392f187dbc675ac0ad 100755 (executable)
@@ -3,10 +3,8 @@
        Margin="20" Background="DarkGray">
 
        <HorizontalStack Fit="true" Margin="5" Background="SkyBlue">
-               <Spinner Value="{IntValue}" ValueChanged="onSpinnerValueChange"/>
+               <Spinner Name="sp1" Value="5" ValueChanged="onSpinnerValueChange"/>
                <Spinner Value="5"/>
                <Spinner Value="5"/>
-               <Button/>
        </HorizontalStack>
-       <IMLContainer Path="Interfaces/Divers/colorPicker.crow"/>
 </VerticalStack>
\ No newline at end of file
diff --git a/Tests/Interfaces/Unsorted/testFileDialog.crow b/Tests/Interfaces/Unsorted/testFileDialog.crow
deleted file mode 100644 (file)
index 868baf6..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0"?>
-<FileDialog Caption="Open File" CurrentDirectory="/" SearchPattern="*.*"/>
-
diff --git a/Tests/Interfaces/Unsorted/testTypeViewer.goml b/Tests/Interfaces/Unsorted/testTypeViewer.goml
deleted file mode 100755 (executable)
index caa454f..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0"?>
-
-       <VerticalStack Height="Fit" Width="250" Name="hstack" Margin="0" Spacing="0">
-               <Border Height="Fit" Width="Stretched" BorderWidth="2" CornerRadius="10" Background="SteelBlue">
-                       <Label Name="labName" Text="{Name}" Width="Stretched" Height="Fit" Margin="3"/>
-               </Border>
-               <ListBox Data="{Members}" Width="Stretched" Height="400" ItemTemplate="Interfaces/tmpMembers.goml" Focusable="true">
-                       
-               </ListBox>
-       </VerticalStack>
index 9a63b7d075ff828acbb0f3e4c0fbfa8914bef8f7..62a2cbf7c8c0cb8b30bc2f8c0406782ace968b37 100644 (file)
@@ -8,7 +8,7 @@
     <OutputType>Exe</OutputType>
     <RootNamespace>Tests</RootNamespace>
     <AssemblyName>Tests</AssemblyName>
-    <StartupObject>Tests.BasicTests</StartupObject>
+    <StartupObject>Tests.Showcase</StartupObject>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <ReleaseVersion>0.5</ReleaseVersion>
     <None Include="Interfaces\Divers\welcome.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
-    <None Include="Interfaces\Unsorted\testTypeViewer.goml">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
     <None Include="Interfaces\Divers\testPropLess.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
     <None Include="Interfaces\Divers\3.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
-    <None Include="Interfaces\Divers\testDock.crow">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
     <None Include="Interfaces\TemplatedContainer\0.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
     <None Include="Interfaces\Divers\test2WayBinding.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
-    <None Include="Interfaces\Unsorted\testFileDialog.crow">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
     <None Include="Interfaces\Divers\perfMeasures.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
     <None Include="Interfaces\Divers\testShape.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
-    <None Include="Interfaces\GraphicObject\testCtxMenu.crow">
+    <None Include="Interfaces\DragAndDrop\0.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
-    <None Include="Interfaces\DragAndDrop\0.crow">
+    <None Include="Interfaces\Divers\testIMLContainer.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="Interfaces\Divers\testCtxMenu.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="Interfaces\Divers\testFileDialog.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="Interfaces\Experimental\testTypeViewer.goml">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="Interfaces\Experimental\testDock.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
   </ItemGroup>
     <Folder Include="Interfaces\Group\" />
     <Folder Include="Interfaces\Divers\" />
     <Folder Include="Interfaces\Splitter\" />
-    <Folder Include="Interfaces\Unsorted\" />
     <Folder Include="Interfaces\Wrapper\" />
     <Folder Include="Interfaces\TemplatedControl\" />
     <Folder Include="Interfaces\TemplatedContainer\" />
     <Folder Include="GraphicObjects\" />
     <Folder Include="Tutorials\" />
     <Folder Include="Interfaces\DragAndDrop\" />
+    <Folder Include="Interfaces\Experimental\" />
   </ItemGroup>
   <ItemGroup>
     <EmbeddedResource Include="image\tetra.png">
index 5e066f3929a287e6c57c8de0966fb50345c3e098..b68a308566469affefdea19cf07e5704bb320f89 100644 (file)
@@ -52,63 +52,98 @@ namespace Crow
                                NotifyValueChanged ("IsDocked", isDocked);
                        }
                }
-               public override void OnLayoutChanges (LayoutingType layoutType)
-               {
-                       base.OnLayoutChanges (layoutType);
-
-                       if (isDocked)
-                               return;
-                       
-                       Docker dv = Parent as Docker;
-                       if (dv == null)
-                               return;
-
-                       Rectangle dvCliRect = dv.ClientRectangle;
-
-                       if (layoutType == LayoutingType.X) {
-                               if (Slot.X < dv.DockingThreshold)
-                                       dock (Alignment.Left);
-                               else if (Slot.Right > dvCliRect.Width - dv.DockingThreshold)
-                                       dock (Alignment.Right);
-                       }else if (layoutType == LayoutingType.Y) {
-                               if (Slot.Y < dv.DockingThreshold)
-                                       dock (Alignment.Top);
-                               else if (Slot.Bottom > dvCliRect.Height - dv.DockingThreshold)
-                                       dock (Alignment.Bottom);
+               public Alignment DockingPosition {
+                       get { return docking; }
+                       set {
+                               if (docking == value)
+                                       return;
+                               docking = value;
+                               NotifyValueChanged ("DockingPosition", DockingPosition);
                        }
                }
-
-               public override void onMouseMove (object sender, MouseMoveEventArgs e)
+               protected override void onDrop (object sender, DragDropEventArgs e)
                {
-                       lastMousePos = e.Position;
-
-                       if (this.HasFocus && e.Mouse.IsButtonDown (MouseButton.Left) && IsDocked) {
-                               Docker dv = Parent as Docker;
-                               if (docking == Alignment.Left) {
-                                       if (lastMousePos.X - undockingMousePosOrig.X > dv.DockingThreshold)
-                                               undock ();
-                               } else if (docking == Alignment.Right) {
-                                       if (undockingMousePosOrig.X - lastMousePos.X > dv.DockingThreshold)
-                                               undock ();
-                               } else if (docking == Alignment.Top) {
-                                       if (lastMousePos.Y - undockingMousePosOrig.Y > dv.DockingThreshold)
-                                               undock ();
-                               } else if (docking == Alignment.Bottom) {
-                                       if (undockingMousePosOrig.Y - lastMousePos.Y > dv.DockingThreshold)
-                                               undock ();
+                       base.onDrop (sender, e);
+                       Docker dv = Parent as Docker;
+                       dv.Dock (this);
+               }
+               public override bool PointIsIn (ref Point m)
+               {                       
+                       if (!base.PointIsIn(ref m))
+                               return false;
+
+                       Group p = Parent as Group;
+                       if (p != null) {
+                               lock (p.Children) {
+                                       for (int i = p.Children.Count - 1; i >= 0; i--) {
+                                               if (p.Children [i] == this)
+                                                       break;
+                                               if (p.Children [i].Slot.ContainsOrIsEqual (m)) {                                                
+                                                       return false;
+                                               }
+                                       }
                                }
-                               return;
                        }
-
-                       base.onMouseMove (sender, e);
+                       return Slot.ContainsOrIsEqual(m);
                }
-               public override void onMouseDown (object sender, MouseButtonEventArgs e)
-               {
-                       base.onMouseDown (sender, e);
 
-                       if (this.HasFocus && IsDocked && e.Button == MouseButton.Left)
-                               undockingMousePosOrig = lastMousePos;
-               }
+//             public override void OnLayoutChanges (LayoutingType layoutType)
+//             {
+//                     base.OnLayoutChanges (layoutType);
+//
+//                     if (isDocked)
+//                             return;
+                       
+//                     Docker dv = Parent as Docker;
+//                     if (dv == null)
+//                             return;
+//
+//                     Rectangle dvCliRect = dv.ClientRectangle;
+//
+//                     if (layoutType == LayoutingType.X) {
+//                             if (Slot.X < dv.DockingThreshold)
+//                                     dock (Alignment.Left);
+//                             else if (Slot.Right > dvCliRect.Width - dv.DockingThreshold)
+//                                     dock (Alignment.Right);
+//                     }else if (layoutType == LayoutingType.Y) {
+//                             if (Slot.Y < dv.DockingThreshold)
+//                                     dock (Alignment.Top);
+//                             else if (Slot.Bottom > dvCliRect.Height - dv.DockingThreshold)
+//                                     dock (Alignment.Bottom);
+//                     }
+//             }
+//
+//             public override void onMouseMove (object sender, MouseMoveEventArgs e)
+//             {
+//                     lastMousePos = e.Position;
+//
+//                     if (this.HasFocus && e.Mouse.IsButtonDown (MouseButton.Left) && IsDocked) {
+//                             Docker dv = Parent as Docker;
+//                             if (docking == Alignment.Left) {
+//                                     if (lastMousePos.X - undockingMousePosOrig.X > dv.DockingThreshold)
+//                                             undock ();
+//                             } else if (docking == Alignment.Right) {
+//                                     if (undockingMousePosOrig.X - lastMousePos.X > dv.DockingThreshold)
+//                                             undock ();
+//                             } else if (docking == Alignment.Top) {
+//                                     if (lastMousePos.Y - undockingMousePosOrig.Y > dv.DockingThreshold)
+//                                             undock ();
+//                             } else if (docking == Alignment.Bottom) {
+//                                     if (undockingMousePosOrig.Y - lastMousePos.Y > dv.DockingThreshold)
+//                                             undock ();
+//                             }
+//                             return;
+//                     }
+//
+//                     base.onMouseMove (sender, e);
+//             }
+//             public override void onMouseDown (object sender, MouseButtonEventArgs e)
+//             {
+//                     base.onMouseDown (sender, e);
+//
+//                     if (this.HasFocus && IsDocked && e.Button == MouseButton.Left)
+//                             undockingMousePosOrig = lastMousePos;
+//             }
 
 //             protected override void onBorderMouseEnter (object sender, MouseMoveEventArgs e)
 //             {
index 57b493909783604bed367c1deb62f4003ea2a9cf..3b66eb7e1820bbe3e015ccbac156467e1376ad48 100644 (file)
 using System;
 using System.Xml.Serialization;
 using System.ComponentModel;
+using Crow.IML;
 
 namespace Crow
 {
        public class Docker : Group
        {
+               static Instantiator instStack, instSplit, instSpacer;
                #region CTOR
+               static Docker () {
+                       instStack = Instantiator.CreateFromImlFragment(@"<GenericStack Background='Blue' AllowDrop='true' DragEnter='onStackDragEnter'/>");
+                       instSplit = Instantiator.CreateFromImlFragment(@"<Splitter/>");
+                       instSpacer = Instantiator.CreateFromImlFragment(@"<GraphicObject Background='Red' IsEnabled='false'/>");
+               }
                public Docker () : base ()
                {
                }
                #endregion
 
+               GenericStack rootStack = null;
+
+               public override void AddChild (GraphicObject g)
+               {
+                       DockWindow dw = g as DockWindow;
+                       if (dw == null)
+                               throw new Exception ("Docker accept only DockWindow as child");
+                       
+                       base.AddChild (g);
+
+                       dw.LogicalParent = this;
+               }
+               public override void RemoveChild (GraphicObject child)
+               {
+                       child.LogicalParent = null;
+
+
+                       base.RemoveChild (child);
+               }
+
+               GenericStack mainStack = null;
                int dockingThreshold;
 
                [XmlAttributeAttribute][DefaultValue(10)]
@@ -51,17 +79,176 @@ namespace Crow
                        }
                }
 
+               bool showDockingTarget = false;
+               Alignment dockingDirection = Alignment.Center;
+               int dockingDiv = 5;
+
                public override void onMouseMove (object sender, MouseMoveEventArgs e)
                {                       
                        if (CurrentInterface.DragAndDropOperation?.DragSource as DockWindow != null) {
                                DockWindow dw = CurrentInterface.DragAndDropOperation?.DragSource as DockWindow;
-                               if (CurrentInterface.DragAndDropOperation.DragSource.Parent == this && !dw.IsDocked) 
-                                       dw.MoveAndResize (e.XDelta, e.YDelta);                          
-                       }
+                               if (CurrentInterface.DragAndDropOperation.DragSource.Parent == this && !dw.IsDocked)
+                                       dw.MoveAndResize (e.XDelta, e.YDelta);
 
+                               Rectangle r = ClientRectangle;
+                               int vTreshold = r.Height / dockingDiv;
+                               int hTreshold = r.Width / dockingDiv;
+
+
+                               bool showDock = true;
+
+                               if (dw.Slot.Left < hTreshold)
+                                       dockingDirection = Alignment.Left;
+                               else if (dw.Slot.Right > r.Right - hTreshold)
+                                       dockingDirection = Alignment.Right;
+                               else if (dw.Slot.Top < vTreshold)
+                                       dockingDirection = Alignment.Top;
+                               else if (dw.Slot.Bottom > r.Bottom - vTreshold)
+                                       dockingDirection = Alignment.Bottom;
+                               else {
+                                       dockingDirection = Alignment.Center;
+                                       showDock = false;
+                               }
+
+                               showDockingTarget = showDock;
+
+                               RegisterForGraphicUpdate ();
+
+                               //System.Diagnostics.Debug.WriteLine ("Dock: {0}", dockingDirection);
+                       } else
+                               showDockingTarget = false;
 
                        base.onMouseMove (sender, e);
                }
+               protected override void onDragEnter (object sender, DragDropEventArgs e)
+               {
+                       base.onDragEnter (sender, e);
+               }
+               void onStackDragEnter (object sender, DragDropEventArgs e)
+               {
+                       base.onDragEnter (sender, e);
+
+                       mainStack = sender as GenericStack;
+               }
+               protected override void onDraw (Cairo.Context gr)
+               {
+                       gr.Save ();
+
+                       Rectangle rBack = new Rectangle (Slot.Size);
+
+                       Background.SetAsSource (gr, rBack);
+                       CairoHelpers.CairoRectangle (gr, rBack, CornerRadius);
+                       gr.Fill ();
+
+                       if (ClipToClientRect) {
+                               //clip to client zone
+                               CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius);
+                               gr.Clip ();
+                       }
+
+                       lock (Children) {
+                               foreach (GraphicObject g in Children) {
+                                       if (CurrentInterface.DragAndDropOperation?.DragSource == g)
+                                               continue;
+                                       g.Paint (ref gr);
+                               }
+                       }
+
+                       if (showDockingTarget) {
+                               Rectangle r;
+                               if (mainStack == null)
+                                       r = ClientRectangle;
+                               else
+                                       r = mainStack.ClientRectangle;
+                               
+                               switch (dockingDirection) {
+                               case Alignment.Top:
+                                       gr.Rectangle (r.Left, r.Top, r.Width, r.Height / dockingDiv);
+                                       break;
+                               case Alignment.Bottom:
+                                       gr.Rectangle (r.Left, r.Bottom - r.Height / dockingDiv, r.Width, r.Height / dockingDiv);
+                                       break;
+                               case Alignment.Left:
+                                       gr.Rectangle (r.Left, r.Top, r.Width / dockingDiv, r.Height);
+                                       break;
+                               case Alignment.Right:
+                                       gr.Rectangle (r.Right - r.Width / dockingDiv, r.Top, r.Width / dockingDiv, r.Height);
+                                       break;
+                               }
+                               gr.LineWidth = 1;
+                               gr.SetSourceRGBA (0.4, 0.4, 0.9, 0.4);
+                               gr.FillPreserve ();
+                               gr.SetSourceRGBA (0.9, 0.9, 1.0, 0.8);
+                               gr.Stroke ();
+                       }
+
+                       if (CurrentInterface.DragAndDropOperation != null)
+                               CurrentInterface.DragAndDropOperation.DragSource.Paint (ref gr);
+
+
+                       gr.Restore ();  
+               }
+
+               public void Dock(DockWindow dw){
+                       if (dockingDirection == Alignment.Center)
+                               return;
+                       lock (CurrentInterface.UpdateMutex) {
+
+                               Splitter splitter = instSplit.CreateInstance<Splitter> (CurrentInterface);
+
+                               dw.Resizable = false;
+                               dw.Left = dw.Top = 0;
+                               this.RemoveChild (dw);
+
+                               Rectangle r;
+                               if (mainStack == null) {
+                                       mainStack = instStack.CreateInstance<GenericStack> (CurrentInterface);
+                                       this.AddChild (mainStack);
+                                       this.putWidgetOnBottom (mainStack);
+                                       r = ClientRectangle;
+                               } else
+                                       r = mainStack.ClientRectangle;                          
+                                
+                               int vTreshold = r.Height / dockingDiv;
+                               int hTreshold = r.Width / dockingDiv;
+
+                               switch (dockingDirection) {
+                               case Alignment.Top:                                             
+                                       dw.Width = Measure.Stretched;
+                                       mainStack.Orientation = Orientation.Vertical;
+                                       mainStack.AddChild (dw);
+                                       mainStack.AddChild (splitter);
+                                       //mainStack.AddChild (instSpacer.CreateInstance (CurrentInterface));
+                                       break;
+                               case Alignment.Bottom:
+                                       dw.Width = Measure.Stretched;
+                                       mainStack.Orientation = Orientation.Vertical;
+                                       //mainStack.AddChild (instSpacer.CreateInstance (CurrentInterface));
+                                       mainStack.AddChild (splitter);
+                                       mainStack.AddChild (dw);
+                                       break;
+                               case Alignment.Left:
+                                       dw.Height = Measure.Stretched;
+                                       mainStack.Orientation = Orientation.Horizontal;
+                                       mainStack.AddChild (dw);
+                                       mainStack.AddChild (splitter);
+                                       //mainStack.AddChild (instSpacer.CreateInstance (CurrentInterface));
+                                       break;
+                               case Alignment.Right:
+                                       dw.Height = Measure.Stretched;
+                                       mainStack.Orientation = Orientation.Horizontal;
+                                       //mainStack.AddChild (instSpacer.CreateInstance (CurrentInterface));
+                                       mainStack.AddChild (splitter);
+                                       mainStack.AddChild (dw);
+                                       break;
+                               }
+
+                       }
+               }
+               protected override void onDrop (object sender, DragDropEventArgs e)
+               {
+                       base.onDrop (sender, e);
+               }
        }
 }
 
index 9857d198341f3710c8af4d33e7630b9309bd8df8..d49cbe8fcda58d0224be3f7e77d66b79864b8789 100644 (file)
@@ -243,10 +243,11 @@ namespace Crow
                                if (parent == value)
                                        return;
                                DataSourceChangeEventArgs e = new DataSourceChangeEventArgs (parent, value);
-                               lock (this)
+                               lock (CurrentInterface.LayoutMutex) {
                                        parent = value;
-
-                               onParentChanged (this, e);
+                               }
+                                       onParentChanged (this, e);
+                               
                        }
                }
                [XmlIgnore]public ILayoutable LogicalParent {
@@ -786,8 +787,9 @@ namespace Crow
                                //prevent setting null causing stack overflow in specific case
                                if (dse.NewDataSource == dse.OldDataSource)
                                        return;
-
-                               OnDataSourceChanged (this, dse);
+                               lock (CurrentInterface.LayoutMutex) {
+                                       OnDataSourceChanged (this, dse);
+                               }
 
                                NotifyValueChanged ("DataSource", DataSource);
                        }
@@ -1097,7 +1099,7 @@ namespace Crow
                /// fired when drag and drop operation start
                /// </summary>
                protected virtual void onStartDrag (object sender, DragDropEventArgs e){
-                       CurrentInterface.HoverWidget = this.focusParent;
+                       CurrentInterface.HoverWidget = null;
                        IsDragged = true;
                        StartDrag.Raise (this, e);
                        Debug.WriteLine(this.ToString() + " : START DRAG => " + e.ToString());
@@ -1136,11 +1138,13 @@ namespace Crow
                        #if DEBUG_UPDATE
                        Debug.WriteLine (string.Format("ClippingRegistration -> {0}", this.ToString ()));
                        #endif
-                       IsQueueForRedraw = false;
-                       if (Parent == null)
-                               return;
-                       Parent.RegisterClip (LastPaintedSlot);
-                       Parent.RegisterClip (Slot);
+                       lock(CurrentInterface.LayoutMutex){
+                               IsQueueForRedraw = false;
+                               if (Parent == null)
+                                       return;
+                               Parent.RegisterClip (LastPaintedSlot);
+                               Parent.RegisterClip (Slot);
+                       }
                }
                /// <summary>
                /// Add clip rectangle to this.clipping and propagate up to root
index 10d87ab619f0d5fd1d2e9d39aec2495a1dc982bb..1b5847d497119f76573eeee2243e5162460963fa 100644 (file)
@@ -62,7 +62,7 @@ namespace Crow
             set { _multiSelect = value; }
         }
                public virtual void AddChild(GraphicObject g){
-                       lock (children) {
+                       lock (Children) {
                                g.Parent = this;
                                Children.Add (g);
                        }
@@ -79,9 +79,8 @@ namespace Crow
                                        CurrentInterface.HoverWidget = null;
                        }
 
-                       lock (children)
+                       lock (Children)
                                Children.Remove(child);
-                       child.Dispose ();
 
                        if (child == largestChild && Width == Measure.Fit)
                                searchLargestChild ();
@@ -89,9 +88,15 @@ namespace Crow
                                searchTallestChild ();
 
                        this.RegisterForLayouting (LayoutingType.Sizing | LayoutingType.ArrangeChildren);
+
+               }
+        public virtual void DeleteChild(GraphicObject child)
+               {
+                       RemoveChild (child);
+                       child.Dispose ();
         }
                public virtual void InsertChild (int idx, GraphicObject g) {
-                       lock (children) {
+                       lock (Children) {
                                g.Parent = this;
                                Children.Insert (idx, g);
                        }
@@ -99,12 +104,12 @@ namespace Crow
                        g.LayoutChanged += OnChildLayoutChanges;
                        g.RegisterForLayouting (LayoutingType.Sizing | LayoutingType.ArrangeChildren);
                }
-               public virtual void RemoveChild (int idx) {
-                       RemoveChild (children[idx]);
+               public virtual void DeleteChild (int idx) {
+                       DeleteChild (children[idx]);
                }
                public virtual void ClearChildren()
                {
-                       lock (children) {
+                       lock (Children) {
                                while (Children.Count > 0) {
                                        GraphicObject g = Children [Children.Count - 1];
                                        g.LayoutChanged -= OnChildLayoutChanges;
@@ -123,7 +128,7 @@ namespace Crow
                {
                        if (Children.Contains(w))
                        {
-                               lock (children) {
+                               lock (Children) {
                                        Children.Remove (w);
                                        Children.Add (w);
                                }
@@ -133,7 +138,7 @@ namespace Crow
                {
                        if (Children.Contains(w))
                        {
-                               lock (children) {
+                               lock (Children) {
                                        Children.Remove (w);
                                        Children.Insert (0, w);
                                }
@@ -144,7 +149,7 @@ namespace Crow
                public override void OnDataSourceChanged (object sender, DataSourceChangeEventArgs e)
                {
                        base.OnDataSourceChanged (this, e);
-                       lock (children) {
+                       lock (Children) {
                                foreach (GraphicObject g in children)
                                        if (g.localDataSourceIsNull & g.localLogicalParentIsNull)
                                                g.OnDataSourceChanged (g, e);
@@ -155,7 +160,7 @@ namespace Crow
                        if (Name == nameToFind)
                                return this;
                        GraphicObject tmp = null;
-                       lock (children) {
+                       lock (Children) {
                                foreach (GraphicObject w in Children) {
                                        tmp = w.FindByName (nameToFind);
                                        if (tmp != null)
@@ -234,7 +239,7 @@ namespace Crow
                                gr.Clip ();
                        }
 
-                       lock (children) {
+                       lock (Children) {
                                foreach (GraphicObject g in Children) {
                                        g.Paint (ref gr);
                                }
@@ -263,7 +268,7 @@ namespace Crow
                                        gr.Clip ();
                                }
 
-                               lock (children) {
+                               lock (Children) {
                                        foreach (GraphicObject c in Children) {
                                                if (!c.Visible)
                                                        continue;
@@ -374,6 +379,21 @@ namespace Crow
                        }
                        base.checkHoverWidget (e);
                }
+//             public override bool PointIsIn (ref Point m)
+//             {
+//                     if (!base.PointIsIn (ref m))
+//                             return false;
+//                     if (CurrentInterface.HoverWidget == this)
+//                             return true;
+//                     lock (Children) {
+//                             for (int i = Children.Count - 1; i >= 0; i--) {
+//                                     if (Children [i].Slot.ContainsOrIsEqual (m) && !(bool)CurrentInterface.HoverWidget?.IsOrIsInside(Children[i])) {                                                
+//                                             return false;
+//                                     }
+//                             }
+//                     }
+//                     return true;
+//             }
                #endregion
 
                protected override void Dispose (bool disposing)
index e1c8cc876d31d6f26d7ab861181fe0988bb6f843..c0754eaa7b9bc1c21bfd99104b1f3d94fe9ffda6 100644 (file)
@@ -135,7 +135,7 @@ namespace Crow
                        close ();
                }
                public static MessageBox Show (Interface iface, Type msgBoxType, string message, string okMsg = "", string cancelMsg = ""){
-                       //lock (Interface.CurrentInterface.UpdateMutex) {
+                       lock (iface.UpdateMutex) {
                                MessageBox mb = new MessageBox (iface);
                                mb.CurrentInterface.AddWidget (mb);
                                mb.MsgType = msgBoxType;
@@ -145,7 +145,7 @@ namespace Crow
                                if (!string.IsNullOrEmpty(cancelMsg))
                                        mb.CancelMessage = cancelMsg;
                                return mb;
-                       //}
+                       }
                }
        }
 }
index 8364aace72a18f7630ed489d164e6a172aa5d012..eab0cb0d170de090a419510726372225ea5e6ce3 100644 (file)
@@ -159,13 +159,13 @@ namespace Crow
                public bool HoldCursor = false;
                public override bool PointIsIn (ref Point m)
                {
-                       TabView tv = Parent as TabView;
-                       bool tmp = base.PointIsIn (ref m);
+                       if (!base.PointIsIn (ref m))
+                               return false;
 
                        if (m.Y < tabThickness)
                                return TabTitle.Slot.ContainsOrIsEqual (m);
                        else
-                               return this.isSelected && tmp;
+                               return this.isSelected;
                }
                public override void onMouseDown (object sender, MouseButtonEventArgs e)
                {
@@ -214,6 +214,10 @@ namespace Crow
                }
                public void butCloseTabClick (object sender, MouseButtonEventArgs e){                   
                        QueryClose.Raise (this, null);
+                       //if tab is used as a templated item root in a templatedGroup, local datasource
+                       //is not null, in this case, removing the data entries will delete automatically the item
+                       if (localDataSourceIsNull)
+                               (Parent as TabView).DeleteChild (this);
                }
                #endregion
 
index 3e776d3a46a5ded56e718ba3afaabd427666a4bf..c5292da72df7cabb562b544105c6a04c9978336d 100644 (file)
@@ -112,7 +112,7 @@ namespace Crow
                        SelectedTab = ti.ViewIndex = Children.Count - 1;
                }
 
-               public override void RemoveChild (GraphicObject child)
+               public override void DeleteChild (GraphicObject child)
                {
                        TabItem ti = child as TabItem;
                        if (ti == null)
@@ -124,7 +124,7 @@ namespace Crow
                        if (selectedTab > Children.Count - 2)
                                SelectedTab--;
                        
-                       base.RemoveChild (child);
+                       base.DeleteChild (child);
                }
 
                public override bool ArrangeChildren { get { return true; } }
index f2c097a202836ba3f04980237fc8dcd9af93248b..8025435d8483cd0fff8afaa04f7d74e5181b917d 100644 (file)
@@ -216,9 +216,9 @@ namespace Crow
                        if (this.isPaged) {
                                int p = e.Index / itemPerPage;
                                int i = e.Index % itemPerPage;
-                               (items.Children [p] as Group).RemoveChild (i);
+                               (items.Children [p] as Group).DeleteChild (i);
                        } else
-                               items.RemoveChild (e.Index);
+                               items.DeleteChild (e.Index);
                }
 
                void Ol_ListAdd (object sender, ListChangedEventArg e)
@@ -268,7 +268,7 @@ namespace Crow
                public virtual void RemoveItem(GraphicObject g)
                {
                        g.LogicalParent = null;
-                       items.RemoveChild (g);
+                       items.DeleteChild (g);
                        if (items.Children.Count == 0)
                                NotifyValueChanged ("HasChildren", false);
                }
@@ -375,8 +375,10 @@ namespace Crow
 //                             isPaged = true;
 //                     }
 
-                       for (int i = 0; i < _data.Count; i++) {
+                       for (int i = 0; i < _data.Count; i++) {                         
                                loadItem (_data[i], page, _dataTest);
+                               if (loadingThread.cancelRequested)
+                                       break;
                        }
 
 //                     if (page == items)
@@ -425,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 b4a5f4c4e647b0c905f24ddba46fad5322e816a8..bbfb196dc1973c1c953f5949f55585b993a0d922 100644 (file)
@@ -424,7 +424,7 @@ namespace Crow
                        if (Parent is Interface)
                                (Parent as Interface).DeleteWidget (this);
                        else if (Parent is Group)
-                               (Parent as Group).RemoveChild (this);
+                               (Parent as Group).DeleteChild (this);
                        else if (Parent is PrivateContainer)
                                (Parent as Container).Child = null;
                }
index becd37ce356f7b35ea0c1d1f1bcdd236d50131c6..ecc78de511b0512ec94a26b639bbeace418df7d0 100644 (file)
@@ -590,9 +590,8 @@ namespace Crow
                        GraphicObject g = null;
                        while (DrawingQueue.Count > 0) {
                                lock (DrawingQueue)
-                                       g = DrawingQueue.Dequeue ();
-                               lock (g)
-                                       g.ClippingRegistration ();
+                                       g = DrawingQueue.Dequeue ();                            
+                               g.ClippingRegistration ();
                        }
 
                        #if MEASURE_TIME