]> O.S.I.I.S - jp/crow.git/commitdiff
* FileDialog.template:
authorjpbruyere <jp.bruyere@hotmail.com>
Sun, 1 Jan 2017 07:46:35 +0000 (08:46 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Sun, 1 Jan 2017 07:46:35 +0000 (08:46 +0100)
  right pane

* BasicTests.cs:
  divers

* OpenTKGameWindow.cs:
  sleep removed from update loop

* TemplatedGroup.cs:
  replace .clone with quick prop affectations

* Instantiator.cs:
  prop less debug

Templates/FileDialog.template
Tests/BasicTests.cs
Tests/OpenTKGameWindow.cs
src/GraphicObjects/TemplatedGroup.cs
src/Instantiator.cs

index 883efd90902b7b504e43ebace67cb48342558abe..db145f0fc065649420e3879417f26477cd693308 100644 (file)
                                                </Template>
                                        </DirectoryView>
                                        <Splitter/>
-
+                                       <DirectoryView ShowFiles="true" Name="dv" CurrentDirectory="{../dv.SelectedItem}" 
+                                               Width="50%" Margin="1">
+                                               <Template>
+                                                       <ListBox Name="fileView" Data="{./FileSystemEntries}">
+                                                               <Template>
+                                                                       <Border BorderWidth="1" Margin="1" MinimumSize="10,10">
+                                                                               <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true">
+                                                                                       <Wrapper Orientation="Horizontal" Height="Fit"
+                                                                                               Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
+                                                                               </Scroller>
+                                                                       </Border>
+                                                               </Template>
+                                                               <ItemTemplate DataType="System.IO.FileInfo">
+                                                                       <HorizontalStack Focusable="true"  Height="Fit"   >
+                                                                               <Image Margin="2" Width="14" Height="14"
+                                                                                       Path="#Crow.Images.Icons.file.svg"/>
+                                                                               <Label Text="{Name}"
+                                                                                       MouseEnter="{Background=BlueCrayola}"
+                                                                                       MouseLeave="{Background=Transparent}"/>
+                                                                       </HorizontalStack>
+                                                               </ItemTemplate>
+                                                               <ItemTemplate DataType="System.IO.DirectoryInfo">
+                                                                       <HorizontalStack Focusable="true"  Height="Fit" >
+                                                                               <Image Margin="2" Width="14" Height="14"
+                                                                                       Path="#Crow.Images.Icons.folder.svg"/>
+                                                                               <Label Text="{Name}"
+                                                                                       MouseEnter="{Background=BlueCrayola}"
+                                                                                       MouseLeave="{Background=Transparent}"/>
+                                                                       </HorizontalStack>
+                                                               </ItemTemplate>
+                                                       </ListBox>
+                                               </Template>
+                                       </DirectoryView>
                                </HorizontalStack>
                                <TextBox Text="{../../dv.SelectedItem}"/>
                                <HorizontalStack Fit="true" HorizontalAlignment="Right">
index afbbad24144b32db60fb7367fa5de32f0882fae6..62fc6eb59a3f70abd726860d65e3dbbf145571b7 100644 (file)
@@ -130,6 +130,8 @@ namespace Tests
                        //testFiles = new string [] { @"Interfaces/Divers/colorPicker.crow" };
                        testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
                        //testFiles = new string [] { @"Interfaces/Divers/test2WayBinding.crow" };
+                       //testFiles = new string [] { @"Interfaces/Divers/testPropLess.crow" };
+                       testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Wrapper", "*.crow")).ToArray ();
                        testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray ();
                        testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
                        testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
index 0908ccac9aa60605e64d3637651f3e45394e2564..359948c7c083e14ca4cfe86543f60b179098fa9f 100644 (file)
@@ -117,7 +117,7 @@ namespace Crow
                        
                        while (true) {
                                CrowInterface.Update ();
-                               Thread.Sleep (1);
+                               //Thread.Sleep (1);
                        }
                }
 
@@ -253,11 +253,11 @@ namespace Crow
                        if (frameCpt > 500) {
                                resetFps ();
                                frameCpt = 0;
-                               #if DEBUG
-                               GC.Collect();
-                               GC.WaitForPendingFinalizers();
-                               NotifyValueChanged("memory", GC.GetTotalMemory (false).ToString());
-                               #endif
+//                             #if DEBUG
+//                             GC.Collect();
+//                             GC.WaitForPendingFinalizers();
+//                             NotifyValueChanged("memory", GC.GetTotalMemory (false).ToString());
+//                             #endif
                        }
                        frameCpt++;
                }
index 1801c0e83b9fd1707c5851238c892965228458a1..3c1fed9e976ea8e730444878ebb2f07e55e0c1d9 100644 (file)
@@ -306,6 +306,7 @@ namespace Crow
                                if (cancelLoading)
                                        return;
                                loadPage (i);
+                               Thread.Sleep (1);
                        }
                }
                void cancelLoadingThread(){
@@ -324,7 +325,23 @@ namespace Crow
                        loadingTime.Start ();
                        #endif
 
-                       Group page = items.Clone () as Group;
+                       Group page;
+                       if (typeof(Wrapper).IsAssignableFrom (items.GetType ())){
+                               page = items;
+                               itemPerPage = int.MaxValue;
+                       }else if (typeof(GenericStack).IsAssignableFrom (items.GetType ())) {
+                               GenericStack gs = new GenericStack ();
+                               gs.CurrentInterface = items.CurrentInterface;
+                               gs.initialize ();
+                               gs.Orientation = (items as GenericStack).Orientation;
+                               gs.Width = items.Width;
+                               gs.Height = items.Height;
+                               gs.VerticalAlignment = items.VerticalAlignment;
+                               gs.HorizontalAlignment = items.HorizontalAlignment;
+                               page = gs;
+
+                       }else
+                               page = Activator.CreateInstance (items.GetType ()) as Group;                    
 
                        page.Name = "page" + pageNum;
 
@@ -337,6 +354,8 @@ namespace Crow
                                loadItem (i, page);
                        }
 
+                       if (page == items)
+                               return;
                        lock (CurrentInterface.LayoutMutex)
                                items.AddChild (page);
 
index dfc585ab98ccb33c112bfa3b80682a99136651b8..5076b487c3ea4a9251cb82cd6024fc74af04fa08 100644 (file)
@@ -868,7 +868,7 @@ namespace Crow
                                il.Emit (OpCodes.Call, typeof(CompilerServices).GetMethod("getMemberInfoWithReflexion", BindingFlags.Static | BindingFlags.Public));
                                il.Emit (OpCodes.Stloc_1);//save memberInfo
                                il.Emit (OpCodes.Ldloc_1);//push mi for test if null
-                               il.Emit (OpCodes.Brfalse, cancel);
+                               il.Emit (OpCodes.Brfalse, cancelInit);//propertyLessBinding
                        }
 
                        il.Emit (OpCodes.Ldarg_1);//load source of dataSourceChanged which is the dest instance