]> O.S.I.I.S - jp/crow.git/commitdiff
try to make tg loading multithreaded, thread sync probs
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 19 Feb 2018 07:51:40 +0000 (08:51 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 19 Feb 2018 07:51:40 +0000 (08:51 +0100)
Templates/ComboBox.template
Tests/BasicTests.cs
src/GraphicObjects/Group.cs
src/GraphicObjects/TemplatedGroup.cs

index 4a209023d8892da8e0e46f8c468e747d752ccd28..aed500aba15220c710b1faa7be4ff5e12c0cc766 100755 (executable)
@@ -1,16 +1,20 @@
 <?xml version="1.0"?>
-<Popper Name="popper" PopDirection="Bottom">
+<Popper Caption="{./SelectedItem}" Name="popper" PopDirection="Bottom" Foreground="{./Foreground}" Background="{./Background}">
        <Template>
-               <Border CornerRadius="0" Foreground="LightGray">
-                       <HorizontalStack Margin="0" Spacing="1">
-                               <TextBox MinimumSize="80,10" Margin="1" Foreground="Black" Background="White"
-                                       Text="{../../../../SelectedItem}"/>
-                               <Button Width="14" Height="14" Focusable="false"
-                                       Template="#Crow.Templates.ArrowBut.template">
-                                       <Image Margin="0"  Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
-                               </Button>
-                       </HorizontalStack>
-               </Border>
+               <CheckBox Caption="{./Caption}" IsChecked="{²./IsPopped}" Foreground="{./Foreground}" Background="{./Background}">
+                       <Template>
+                               <Border CornerRadius="0" Foreground="LightGray">
+                                       <HorizontalStack Margin="0" Spacing="1">
+                                               <TextBox MinimumSize="80,10" Margin="1" Foreground="Black" Background="White"
+                                                       Text="{./Caption}"/>
+                                               <Button Width="14" Height="14" Focusable="false"
+                                                       Template="#Crow.Templates.ArrowBut.template">
+                                                       <Image Margin="0"  Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+                                               </Button>
+                                       </HorizontalStack>
+                               </Border>
+                       </Template>
+               </CheckBox>
        </Template>
        <Border Background="DimGray" BorderWidth="1" Margin="1"
                MinimumSize="{../../MinimumPopupSize}" Fit="true">
index 8c851286cecbeb683cebceef50bc4bea1ee540b6..97469591f9abc69f7c12b564c3da0766654c3a01 100644 (file)
@@ -164,22 +164,23 @@ namespace Tests
 
                        //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/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/DragAndDrop/0.crow" };
                        //testFiles = new string [] { @"Interfaces/TemplatedControl/testItemTemplateTag.crow" };
-                       testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/DragAndDrop", "*.crow")).ToArray ();
+                       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/DragAndDrop", "*.crow")).ToArray ();
                        testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Unsorted", "*.crow")).ToArray ();
 
                        Load(testFiles[idx]).DataSource = this;
index 3802a4d993bef98386ad69fd3128e7e95eb6a017..10d87ab619f0d5fd1d2e9d39aec2495a1dc982bb 100644 (file)
@@ -263,7 +263,7 @@ namespace Crow
                                        gr.Clip ();
                                }
 
-                               lock (Children) {
+                               lock (children) {
                                        foreach (GraphicObject c in Children) {
                                                if (!c.Visible)
                                                        continue;
index 264c9e80dcc863bbe7fa93ad256835abbff1dd4d..f2c097a202836ba3f04980237fc8dcd9af93248b 100644 (file)
@@ -176,7 +176,7 @@ namespace Crow
                                if (value == data)
                                        return;
 
-                               //cancelLoadingThread ();
+                               cancelLoadingThread ();
 
                                if (data is IObservableList) {
                                        IObservableList ol = data as IObservableList;
@@ -200,11 +200,9 @@ namespace Crow
                                if (data == null)
                                        return;
 
-//                             loadingThread = new CrowThread (this, loading);
-//                             loadingThread.Finished += (object sender, EventArgs e) => (sender as TemplatedGroup).Loaded.Raise (sender, e);
-//                             loadingThread.Start ();
-
-                               loadPage (data, items, dataTest);
+                               loadingThread = new CrowThread (this, loading);
+                               loadingThread.Finished += (object sender, EventArgs e) => (sender as TemplatedGroup).Loaded.Raise (sender, e);
+                               loadingThread.Start ();
 
                                NotifyValueChanged ("SelectedIndex", _selectedIndex);
                                NotifyValueChanged ("SelectedItem", SelectedItem);
@@ -327,7 +325,9 @@ namespace Crow
                /// <summary>
                /// Items loading thread
                /// </summary>
-//             void loading(){
+               void loading(){
+                       loadPage (data, items, dataTest);
+               }
 //                     //if (!ItemTemplates.ContainsKey ("default"))
 //                     //      ItemTemplates ["default"] = Interface.GetItemTemplate (ItemTemplate);
 //