diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2017-01-01 08:46:35 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2017-01-01 08:46:35 +0100 |
| commit | fa245bf07cd476bd6e63c867a4c7c38cca6c4bcc (patch) | |
| tree | 9252bc8ff803d6d40dcc3fa18032e18978b418e0 | |
| parent | f98beedb7a53244564d2207f53f9c93514a2c2d7 (diff) | |
* FileDialog.template:
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
| -rw-r--r-- | Templates/FileDialog.template | 34 | ||||
| -rw-r--r-- | Tests/BasicTests.cs | 2 | ||||
| -rw-r--r-- | Tests/OpenTKGameWindow.cs | 12 | ||||
| -rw-r--r-- | src/GraphicObjects/TemplatedGroup.cs | 21 | ||||
| -rw-r--r-- | src/Instantiator.cs | 2 |
5 files changed, 62 insertions, 9 deletions
diff --git a/Templates/FileDialog.template b/Templates/FileDialog.template index 883efd90..db145f0f 100644 --- a/Templates/FileDialog.template +++ b/Templates/FileDialog.template @@ -67,7 +67,39 @@ </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"> diff --git a/Tests/BasicTests.cs b/Tests/BasicTests.cs index afbbad24..62fc6eb5 100644 --- a/Tests/BasicTests.cs +++ b/Tests/BasicTests.cs @@ -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 (); diff --git a/Tests/OpenTKGameWindow.cs b/Tests/OpenTKGameWindow.cs index 0908ccac..359948c7 100644 --- a/Tests/OpenTKGameWindow.cs +++ b/Tests/OpenTKGameWindow.cs @@ -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++; } diff --git a/src/GraphicObjects/TemplatedGroup.cs b/src/GraphicObjects/TemplatedGroup.cs index 1801c0e8..3c1fed9e 100644 --- a/src/GraphicObjects/TemplatedGroup.cs +++ b/src/GraphicObjects/TemplatedGroup.cs @@ -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); diff --git a/src/Instantiator.cs b/src/Instantiator.cs index dfc585ab..5076b487 100644 --- a/src/Instantiator.cs +++ b/src/Instantiator.cs @@ -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 |