diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-10-26 08:23:19 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-10-26 08:23:19 +0200 |
| commit | c706b713a716e8b7fd29508ccf88e5de5041d1d4 (patch) | |
| tree | c71fcc73e4f28c9248eece7df8a2c70225cc498c /Samples | |
| parent | 942155da0d427b7c4f98fa91da390461b5f1dd9f (diff) | |
rename all 'GraphicObject' to 'Widget', move to netcoreapp3.0 for crow library to use LoadContext for native dll resolutionFileDialogImprove
Diffstat (limited to 'Samples')
25 files changed, 279 insertions, 158 deletions
diff --git a/Samples/BasicTests/BasicTests.cs b/Samples/BasicTests/BasicTests.cs index 3b4e6bb2..59b0e1ca 100644 --- a/Samples/BasicTests/BasicTests.cs +++ b/Samples/BasicTests/BasicTests.cs @@ -38,7 +38,7 @@ namespace Samples //testFiles = new string [] { @"Interfaces/Stack/StretchedInFit4.crow" }; //testFiles = new string [] { @"Interfaces/TemplatedGroup/1.crow" }; //testFiles = new string [] { @"Interfaces/Divers/colorPicker2.crow" }; - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray (); + testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Widget", "*.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 (); diff --git a/Samples/HelloWorld/HelloWorld.csproj b/Samples/HelloWorld/HelloWorld.csproj index 7ceb582d..178d4537 100644 --- a/Samples/HelloWorld/HelloWorld.csproj +++ b/Samples/HelloWorld/HelloWorld.csproj @@ -1,9 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk"> + <PropertyGroup> + <TargetFramework>netcoreapp3.1</TargetFramework> + <OutputType>Exe</OutputType> + </PropertyGroup> <ItemGroup> - <EmbeddedResource Include="ui\**\*.*"> - <LogicalName>HelloWorld.%(Filename)%(Extension)</LogicalName> - </EmbeddedResource> + <PackageReference Include="Crow" /> </ItemGroup> </Project>
\ No newline at end of file diff --git a/Samples/HelloWorld/main.cs b/Samples/HelloWorld/main.cs index dc5e2a13..e60b9782 100644 --- a/Samples/HelloWorld/main.cs +++ b/Samples/HelloWorld/main.cs @@ -4,21 +4,10 @@ using Samples; namespace HelloWorld { - class Program : SampleBase { - public CommandGroup CMDTest = new CommandGroup ( - new ActionCommand("Action", ()=> Console.WriteLine ("Action executed")) - ); + class Program { static void Main (string[] args) { - DbgLogger.IncludedEvents.AddRange ( new DbgEvtType[] { - DbgEvtType.MouseEnter, - DbgEvtType.MouseLeave, - DbgEvtType.WidgetMouseDown, - DbgEvtType.WidgetMouseUp, - DbgEvtType.WidgetMouseClick, - DbgEvtType.HoverWidget - }); - using (Interface app = new Program ()) { - app.Initialized += (sender, e) => (sender as Interface).Load ("#HelloWorld.helloworld.crow").DataSource = sender; + using (Interface app = new Interface ()) { + app.Initialized += (sender, e) => app.LoadIMLFragment (@"<Label Text='Hello World'/>"); app.Run (); } } diff --git a/Samples/HelloWorld/ui/helloworld.crow b/Samples/HelloWorld/ui/helloworld.crow deleted file mode 100644 index a9dad40c..00000000 --- a/Samples/HelloWorld/ui/helloworld.crow +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0"?> -<VerticalStack Margin="50" Spacing="20"> - <HorizontalStack Height="Fit"> - <Label Text="Hover:" Width="50" Foreground="Grey"/> - <Label Text="{HoverWidget}" Font="mono, 8"/> - </HorizontalStack> - <HorizontalStack Height="Fit"> - <Label Text="Focus:" Width="50" Foreground="Grey"/> - <Label Text="{FocusedWidget}" Font="mono, 8"/> - </HorizontalStack> - <HorizontalStack Height="Fit"> - <Label Text="Active:" Width="50" Foreground="Grey"/> - <Label Text="{ActiveWidget}" Font="mono, 8"/> - </HorizontalStack> - <Border Height="Fit" Margin="2" Background="Blue" ContextCommands="{CMDTest}" Focusable="true" - MouseEnter="{Background=Red}" - MouseLeave="{Background=Blue}"> - <Label Margin="5" Text="Hello World" /> - </Border> - <Border Height="Fit" Margin="2" Background="Blue" ContextCommands="{CMDTest}" Focusable="true" - MouseEnter="{Background=Red}" - MouseLeave="{Background=Blue}"> - <Label Margin="5" Text="Hello World" /> - </Border> - <Border Height="Fit" Margin="2" Background="Blue" ContextCommands="{CMDTest}" Focusable="true" - MouseEnter="{Background=Red}" - MouseLeave="{Background=Blue}"> - <Label Margin="5" Text="Hello World" /> - </Border> - <Border Height="Fit" Margin="2" Background="Blue" ContextCommands="{CMDTest}" Focusable="true" - MouseEnter="{Background=Red}" - MouseLeave="{Background=Blue}"> - <Label Margin="5" Text="Hello World" /> - </Border> - <Border Height="Fit" Margin="2" Background="Blue" ContextCommands="{CMDTest}" Focusable="true" - MouseEnter="{Background=Red}" - MouseLeave="{Background=Blue}"> - <Label Margin="5" Text="Hello World" /> - </Border> -</VerticalStack> diff --git a/Samples/ShowCase/ShowCase.cs b/Samples/ShowCase/ShowCase.cs index 71556f01..9d257160 100644 --- a/Samples/ShowCase/ShowCase.cs +++ b/Samples/ShowCase/ShowCase.cs @@ -37,6 +37,8 @@ namespace ShowCase app.SetWindowIcon ("#Crow.Icons.crow.png"); //app.Theme = @"C:\Users\Jean-Philippe\source\Crow\Themes\TestTheme"; CurrentProgramInstance = app; + Interface.UPDATE_INTERVAL = 50; + Interface.POLLING_INTERVAL = 5; app.Run (); } diff --git a/Samples/common/src/SampleBase.cs b/Samples/common/src/SampleBase.cs index 3e0ef714..ce043b37 100644 --- a/Samples/common/src/SampleBase.cs +++ b/Samples/common/src/SampleBase.cs @@ -11,31 +11,13 @@ using System.Runtime.InteropServices; using System.Threading; using Crow.Drawing; +using System.Diagnostics; namespace Samples { public class SampleBase : Interface { -#if NETCOREAPP - static IntPtr resolveUnmanaged(Assembly assembly, String libraryName) - { - switch (libraryName) - { - case "glfw3": - return NativeLibrary.Load("glfw", assembly, null); - case "rsvg-2.40": - return NativeLibrary.Load("rsvg-2", assembly, null); - } - Console.WriteLine($"[UNRESOLVE] {assembly} {libraryName}"); - return IntPtr.Zero; - } - - static SampleBase() - { - System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly()).ResolvingUnmanagedDll += resolveUnmanaged; - } -#endif public SampleBase(IntPtr hWin) : base(800, 600, hWin) { } public SampleBase() : base(800, 600, true, true) { } public SampleBase(int width, int height, bool startUIThread, bool createSurface) : @@ -436,5 +418,63 @@ namespace Samples } return base.OnKeyDown(e); } + public IEnumerable<RandomProgress> RandomProgressList { + get { + for (int i=0; i< RandomProgressItemCount; i++) + yield return new RandomProgress (); + } + } + int randomProgressItemCount = 10; + public int RandomProgressItemCount { + get => randomProgressItemCount; + set { + if (randomProgressItemCount == value) + return; + randomProgressItemCount = value; + NotifyValueChanged (randomProgressItemCount); + NotifyValueChanged ("RandomProgressList", RandomProgressList); + } + } + + public class RandomProgress : IValueChange { + static Random rnd = new Random(); + public event EventHandler<ValueChangeEventArgs> ValueChanged; + public void NotifyValueChanged(object _value, [CallerMemberName] string caller = null) + => ValueChanged.Raise(this, new ValueChangeEventArgs(caller, _value)); + public void NotifyValueChanged(string membername, object _value) + => ValueChanged.Raise(this, new ValueChangeEventArgs(membername, _value)); + public RandomProgress () { + step = rnd.Next (10); + max = rnd.Next (100, 1000); + sleep = rnd.Next (2,200); + Thread t = new Thread(increment); + t.IsBackground = true; + t.Start (); + + NotifyValueChanged ("Maximum", max); + } + int val, step, max, sleep; + public int Value { + get => val; + set { + if (val == value) + return; + val = value; + NotifyValueChanged (val); + } + } + public int Maximum => max; + + void increment() { + Stopwatch sw = Stopwatch.StartNew(); + while (sw.ElapsedMilliseconds < 10000) { + Value += step; + if (Value > max) + Value = 0; + Thread.Sleep (sleep); + } + Value = max; + } + } } }
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Container/3.crow b/Samples/common/ui/Interfaces/Container/3.crow index 4d6d1ec3..79df9e91 100644 --- a/Samples/common/ui/Interfaces/Container/3.crow +++ b/Samples/common/ui/Interfaces/Container/3.crow @@ -1,4 +1,10 @@ <?xml version="1.0"?> <Container Background="Blue" Margin="10" Fit="true"> - <Label Text="test" Margin="10" Fit="true" Background="SeaGreen"/> + <Label Multiline="true" Text="this is a test of a multiline textbox +and another line +and another line +and another line a little bit longuer +and another line +and another line +" Margin="10" Fit="true" Background="SeaGreen" TextAlignment="Center"/> </Container>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Divers/testFileDialogTemplate.crow b/Samples/common/ui/Interfaces/Divers/testFileDialogTemplate.crow new file mode 100644 index 00000000..7aed370f --- /dev/null +++ b/Samples/common/ui/Interfaces/Divers/testFileDialogTemplate.crow @@ -0,0 +1,91 @@ +<?xml version="1.0"?> +<FileDialog Caption="Open File" CurrentDirectory="/" SearchPattern="*.*"> + <Template> + <Border Name="SizeHandle" Style="winBorder" CornerRadius="{./CornerRadius}" Background="{./Background}"> + <VerticalStack Spacing="0"> + <HorizontalStack Background="${WindowTitleBarBackground}" Margin="0" Spacing="0" Height="Fit"> + <Widget Width="5"/> + <Image Margin="1" Width="12" Height="12" Path="{./Icon}"/> + <Label Name="MoveHandle" Width="Stretched" Foreground="${WindowTitleBarForeground" Margin="2" TextAlignment="Center" Text="{./Caption}" /> + <Border CornerRadius="0" BorderWidth="1" Foreground="Transparent" Height="12" Width="12" + MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}"> + <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Icons.exit2.svg" + MouseClick="./onQuitPress"/> + </Border> + <Widget Width="5"/> + </HorizontalStack> + <Container Name="Content" MinimumSize="50,50" Background="Jet"> + <VerticalStack Margin="1"> + <HorizontalStack Height="Fit"> + <Button Fit="true" Caption="Up" MouseClick="./goUpDirClick"> + <Image Margin="2" Width="14" Height="14" + Path="#Crow.Icons.level-up.svg"/> + </Button> + <TextBox Style="TxtInFileDialog" Text="{²./CurrentDirectory}"/> + </HorizontalStack> + <DirectoryView ShowHidden="{²../cbShowHidden.IsChecked}" FileMask="{²../txtFileMask.Text}" ShowFiles="{²../cbShowFiles.IsChecked}" + Name="fv" CurrentDirectory="{./CurrentDirectory}" SelectedItemChanged="./onFVSelectedItemChanged" + Width="100%" Margin="0" MouseDoubleClick="./onFileSelectDblClick"> + <Template> + <ListBox Name="fileView" Data="{./FileSystemEntries}" + SelectedItemChanged="./onSelectedItemChanged"> + <Template> + <HorizontalStack> + <Scroller Name="scroller1"> + <VerticalStack Height="Fit" VerticalAlignment="Top" + Name="ItemsContainer" Margin="0" Spacing="1"/> + </Scroller> + <ScrollBar Name="scrollbar1" Orientation="Vertical" + Value="{²../scroller1.ScrollY}" Maximum="{../scroller1.MaxScrollY}" + CursorRatio="{../scroller1.ChildHeightRatio}" + LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30" + Width="14" /> + </HorizontalStack> + </Template> + <ItemTemplate> + <Widget Height="16" Background="Red"/> + </ItemTemplate> + <ItemTemplate DataType="System.IO.FileInfo"> + <ListItem Height="Fit" + Selected = "{Background=${ControlHighlight}}" + Unselected = "{Background=Transparent}"> + <HorizontalStack> + <Image Margin="2" Width="16" Height="16" Path="#Crow.Icons.file.svg"/> + <Label Text="{Name}" Width="Stretched"/> + </HorizontalStack> + </ListItem> + </ItemTemplate> + <ItemTemplate DataType="System.IO.DirectoryInfo"> + <ListItem Height="Fit" + Selected = "{Background=${ControlHighlight}}" + Unselected = "{Background=Transparent}"> + <HorizontalStack> + <Image Margin="2" Width="16" Height="16" Path="#Crow.Icons.folder.svg"/> + <Label Text="{Name}" Width="Stretched"/> + <Label Text="{LastAccessTime}" /> + </HorizontalStack> + </ListItem> + </ItemTemplate> + </ListBox> + </Template> + </DirectoryView> + <HorizontalStack Height="Fit"> + <TextBox Style="TxtInFileDialog" Text="{²./SelectedFile}"/> + <TextBox Style="TxtInFileDialog" Width="50" Name="txtFileMask" Text="{²./SearchPattern}"/> + </HorizontalStack> + <HorizontalStack Margin="5" Fit="true" HorizontalAlignment="Right"> + <CheckBox Style="CheckBoxAlt" Name="cbShowFiles" Caption="Show Files" IsChecked="{²./ShowFiles}"/> + <CheckBox Style="CheckBoxAlt" Name="cbShowHidden" Caption="Show Hidden" IsChecked="{²./ShowHidden}"/> + </HorizontalStack> + <HorizontalStack Fit="true" HorizontalAlignment="Right" Margin="3" Spacing="3"> + <Button Caption="Ok" Command="{./CMDOk}"/> + <Button Caption="Cancel" Command="{./CMDCancel}"/> + </HorizontalStack> + </VerticalStack> + </Container> + </VerticalStack> + </Border> + + </Template> +</FileDialog> + diff --git a/Samples/common/ui/Interfaces/Experimental/directoryView2-dyn.crow b/Samples/common/ui/Interfaces/Experimental/directoryView2-dyn.crow new file mode 100644 index 00000000..811b3dba --- /dev/null +++ b/Samples/common/ui/Interfaces/Experimental/directoryView2-dyn.crow @@ -0,0 +1,5 @@ +<VerticalStack> + <EnumSelector Caption="View Style" EnumValue="{²../dv.ViewStyle}"/> + <Spinner Value="{²../dv.IconSize}" SmallIncrement="1" LargeIncrement="1"/> + <DirectoryView2 Name="dv" CurrentDirectory="/mnt/devel" MouseDoubleClick="./onFileSelectDblClick"/> +</VerticalStack>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/directoryView2.crow b/Samples/common/ui/Interfaces/Experimental/directoryView2.crow index 8035f749..9bfebe72 100644 --- a/Samples/common/ui/Interfaces/Experimental/directoryView2.crow +++ b/Samples/common/ui/Interfaces/Experimental/directoryView2.crow @@ -1,7 +1,8 @@ -<DirectoryView2 CurrentDirectory="/mnt/devel" Data="{/FileSystemEntries}"> - <Template> - <VerticalStack> - <Spinner Value="{²./IconSize}" SmallIncrement="1" LargeIncrement="1"/> +<VerticalStack> + <EnumSelector Caption="View Style" EnumValue="{²../dv.ViewStyle}"/> + <Spinner Value="{²../dv.IconSize}" SmallIncrement="1" LargeIncrement="1"/> + <DirectoryView2 UseLoadingThread="false" Name="dv" CurrentDirectory="/mnt/devel" Data="{/FileSystemEntries}"> + <Template> <HorizontalStack Background="Grey" Margin="5"> <Scroller Name="scroller1"> <Wrapper Orientation="Vertical" Height="Fit" VerticalAlignment="Top" @@ -13,8 +14,7 @@ LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30" Width="14" /> </HorizontalStack> - </VerticalStack> - </Template> + </Template> <ItemTemplate DataType="System.IO.FileInfo"> <ListItem Width="70" Height="60" BubbleEvents="All" Tooltip="{Name}" @@ -37,4 +37,5 @@ </VerticalStack> </ListItem> </ItemTemplate> -</DirectoryView2>
\ No newline at end of file +</DirectoryView2> +</VerticalStack>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/directoryView3.crow b/Samples/common/ui/Interfaces/Experimental/directoryView3.crow index 1dd1d88d..45d811a2 100644 --- a/Samples/common/ui/Interfaces/Experimental/directoryView3.crow +++ b/Samples/common/ui/Interfaces/Experimental/directoryView3.crow @@ -1,35 +1,38 @@ -<DirectoryView2 CurrentDirectory="/mnt/devel" Data="{/FileSystemEntries}"> - <Template> - <VerticalStack> - <Spinner Value="{²./IconSize}" SmallIncrement="1" LargeIncrement="1"/> - <VerticalStack Background="Grey" Margin="5"> - <Scroller Name="scroller1"> - <Wrapper Orientation="Horizontal" Height="Stretched" Width="Fit" HorizontalAlignment="Left" - Name="ItemsContainer" Margin="0" Spacing="2"/> - </Scroller> +<VerticalStack> + <EnumSelector Caption="View Style" EnumValue="{²../dv.ViewStyle}"/> + <Spinner Value="{²../dv.IconSize}" SmallIncrement="1" LargeIncrement="1"/> + <DirectoryView2 Name="dv" CurrentDirectory="/mnt/devel" Data="{/FileSystemEntries}"> + <Template> + <VerticalStack> + <VerticalStack Background="Grey" Margin="5"> + <Scroller Name="scroller1"> + <Wrapper Orientation="Horizontal" Height="Stretched" Width="Fit" HorizontalAlignment="Left" + Name="ItemsContainer" Margin="0" Spacing="2"/> + </Scroller> + </VerticalStack> </VerticalStack> - </VerticalStack> - </Template> - <ItemTemplate DataType="System.IO.FileInfo"> - <ListItem Width="Fit" Height="Fit" - BubbleEvents="All" Tooltip="{Name}" - Selected = "{Background=${ControlHighlight}}" - Unselected = "{Background=Transparent}"> - <HorizontalStack Spacing="5"> - <Image Margin="0" Width="16" Height="16" Path="${FileIcon}" Scaled="true"/> - <Label Text="{Name}" Width="Fit" Font="sans,9" /> - </HorizontalStack> - </ListItem> - </ItemTemplate> - <ItemTemplate DataType="System.IO.DirectoryInfo"> - <ListItem Width="Fit" Height="Fit" - BubbleEvents="All" Tooltip="{Name}" - Selected = "{Background=${ControlHighlight}}" - Unselected = "{Background=Transparent}"> - <HorizontalStack Spacing="5"> - <Image Margin="0" Width="16" Height="16" Path="${FolderIcon}" Scaled="true"/> - <Label Text="{Name}" Width="Fit" Font="sans,9"/> - </HorizontalStack> - </ListItem> - </ItemTemplate> -</DirectoryView2>
\ No newline at end of file + </Template> + <ItemTemplate DataType="System.IO.FileInfo"> + <ListItem Width="Fit" Height="Fit" + BubbleEvents="All" Tooltip="{Name}" + Selected = "{Background=${ControlHighlight}}" + Unselected = "{Background=Transparent}"> + <HorizontalStack Spacing="5"> + <Image Margin="0" Width="16" Height="16" Path="${FileIcon}" Scaled="true"/> + <Label Text="{Name}" Width="Fit" Font="sans,9" /> + </HorizontalStack> + </ListItem> + </ItemTemplate> + <ItemTemplate DataType="System.IO.DirectoryInfo"> + <ListItem Width="Fit" Height="Fit" + BubbleEvents="All" Tooltip="{Name}" + Selected = "{Background=${ControlHighlight}}" + Unselected = "{Background=Transparent}"> + <HorizontalStack Spacing="5"> + <Image Margin="0" Width="16" Height="16" Path="${FolderIcon}" Scaled="true"/> + <Label Text="{Name}" Width="Fit" Font="sans,9"/> + </HorizontalStack> + </ListItem> + </ItemTemplate> + </DirectoryView2> +</VerticalStack>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/directoryView5.crow b/Samples/common/ui/Interfaces/Experimental/directoryView5.crow index 62b743ab..5b59a0f6 100644 --- a/Samples/common/ui/Interfaces/Experimental/directoryView5.crow +++ b/Samples/common/ui/Interfaces/Experimental/directoryView5.crow @@ -1,36 +1,40 @@ -<DirectoryView2 CurrentDirectory="/mnt/devel" Data="{/FileSystemEntries}"> - <Template> - <VerticalStack> - <Spinner Value="{²./IconSize}" SmallIncrement="1" LargeIncrement="1"/> - <VerticalStack Background="DarkGrey" Margin="0"> - <Scroller Name="scroller1"> - <Table Columns=",20;Name,Stretched;Size,100;Accessed,Fit" Height="Fit" Width="Stretched" VerticalAlignment="Top" - Name="ItemsContainer" Margin="0" Spacing="0" RowsMargin="0" ColumnSpacing="10" - HorizontalLineWidth="0" VerticalLineWidth="1" /> - </Scroller> +<VerticalStack> + <EnumSelector Caption="View Style" EnumValue="{²../dv.ViewStyle}"/> + <Spinner Value="{²../dv.IconSize}" SmallIncrement="1" LargeIncrement="1"/> + <DirectoryView2 Name="dv" CurrentDirectory="/mnt/devel" Data="{/FileSystemEntries}"> + <Template> + <VerticalStack> + <Spinner Value="{²./IconSize}" SmallIncrement="1" LargeIncrement="1"/> + <VerticalStack Background="DarkGrey" Margin="0"> + <Scroller Name="scroller1"> + <Table Columns=",20;Name,Stretched;Size,100;Accessed,Fit" Height="Fit" Width="Stretched" VerticalAlignment="Top" + Name="ItemsContainer" Margin="0" Spacing="0" RowsMargin="0" ColumnSpacing="10" + HorizontalLineWidth="0" VerticalLineWidth="1" /> + </Scroller> + </VerticalStack> </VerticalStack> - </VerticalStack> - </Template> - <ItemTemplate DataType="System.IO.DirectoryInfo"> - <TableRow Width="Stretched" Height="Fit" Focusable="true" - BubbleEvents="All" Tooltip="{Name}" - Selected="{Background=${ControlHighlight}}" - Unselected="{Background=Transparent}"> - <Image Width="Stretched" Height="Stretched" Path="${FolderIcon}" Margin="0" /> - <Label Text="{Name}" Width="Fit" Font="sans,11" Margin="3"/> - <Label Text="" Font="sans,9"/> - <Label Text="{LastAccessTime}" Font="sans,9"/> - </TableRow> - </ItemTemplate> - <ItemTemplate DataType="System.IO.FileInfo"> - <TableRow Width="Stretched" Height="Fit" Focusable="true" - BubbleEvents="All" Tooltip="{Name}" - Selected="{Background=${ControlHighlight}}" - Unselected="{Background=Transparent}"> - <Image Width="Stretched" Height="Stretched" Path="${FileIcon}" Margin="2" /> - <Label Text="{Name}" Width="Fit" Font="sans,11" Margin="3"/> - <Label Text="{Length}" Font="sans,9" TextAlignment="Right"/> - <Label Text="{LastAccessTime}" Font="sans,9"/> - </TableRow> - </ItemTemplate> -</DirectoryView2>
\ No newline at end of file + </Template> + <ItemTemplate DataType="System.IO.DirectoryInfo"> + <TableRow Width="Stretched" Height="Fit" Focusable="true" + BubbleEvents="All" Tooltip="{Name}" + Selected="{Background=${ControlHighlight}}" + Unselected="{Background=Transparent}"> + <Image Width="Stretched" Height="Stretched" Path="${FolderIcon}" Margin="0" /> + <Label Text="{Name}" Width="Fit" Font="sans,11" Margin="3"/> + <Label Text="" Font="sans,9"/> + <Label Text="{LastAccessTime}" Font="sans,9"/> + </TableRow> + </ItemTemplate> + <ItemTemplate DataType="System.IO.FileInfo"> + <TableRow Width="Stretched" Height="Fit" Focusable="true" + BubbleEvents="All" Tooltip="{Name}" + Selected="{Background=${ControlHighlight}}" + Unselected="{Background=Transparent}"> + <Image Width="Stretched" Height="Stretched" Path="${FileIcon}" Margin="2" /> + <Label Text="{Name}" Width="Fit" Font="sans,11" Margin="3"/> + <Label Text="{Length}" Font="sans,9" TextAlignment="Right"/> + <Label Text="{LastAccessTime}" Font="sans,9"/> + </TableRow> + </ItemTemplate> + </DirectoryView2> +</VerticalStack>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/fileDialog.crow b/Samples/common/ui/Interfaces/Experimental/fileDialog.crow index 977cbf31..c26e3a7a 100644 --- a/Samples/common/ui/Interfaces/Experimental/fileDialog.crow +++ b/Samples/common/ui/Interfaces/Experimental/fileDialog.crow @@ -12,7 +12,7 @@ <Label Text="{ActiveWidget}" Font="mono, 8"/> </HorizontalStack> <Container> - <FileDialog Focusable="true" Resizable="true"> + <FileDialog Focusable="true" Resizable="true" Width="80%" Height="80%"> <Template> <Border Name="SizeHandle" Style="winBorder" CornerRadius="{./CornerRadius}" Background="{./Background}"> <VerticalStack Spacing="0"> @@ -65,7 +65,7 @@ Selected = "{Background=${ControlHighlight}}" Unselected = "{Background=Transparent}"> <HorizontalStack Spacing="5"> - <Image Width="20" Height="20" Path="#Crow.Icons.file.svg"/> + <Image Width="16" Height="16" Path="#Crow.Icons.file.svg"/> <Label Margin="2" Text="{Name}" Width="Stretched"/> </HorizontalStack> </ListItem> @@ -76,7 +76,7 @@ Selected = "{Background=${ControlHighlight}}" Unselected = "{Background=Transparent}"> <HorizontalStack Spacing="5"> - <Image Width="20" Height="20" Path="#Crow.Icons.folder.svg"/> + <Image Width="16" Height="16" Path="#Crow.Icons.folder.svg"/> <Label Margin="2" Text="{Name}" Width="Stretched"/> <Label Margin="2" Text="{LastAccessTime}" /> </HorizontalStack> diff --git a/Samples/common/ui/Interfaces/Experimental/randomProgress.crow b/Samples/common/ui/Interfaces/Experimental/randomProgress.crow new file mode 100644 index 00000000..9b63b81a --- /dev/null +++ b/Samples/common/ui/Interfaces/Experimental/randomProgress.crow @@ -0,0 +1,18 @@ +<VerticalStack> + <VerticalStack Width="Fit" Background="DarkSlateGrey" Margin="10" Height="Fit"> + <HorizontalStack Height="Fit" Spacing="10"> + <Label Text="Value:"/> + <Label Text="{../../slider.Value}" Background="Onyx" Margin="1" Width="40" TextAlignment="Right"/> + </HorizontalStack> + <Slider Name="slider" Height="10" Width="200" Background="DarkGrey" LargeIncrement="20" SmallIncrement="5" + Minimum="10" Maximum="1000" Value="{²RandomProgressItemCount}"/> + </VerticalStack> + <ListBox UseLoadingThread="false" Data="{RandomProgressList}"> + <Template> + <Wrapper Name="ItemsContainer"/> + </Template> + <ItemTemplate> + <ProgressBar Maximum="{Maximum}" Value="{Value}" Height="10" Width="50"/> + </ItemTemplate> + </ListBox> +</VerticalStack>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/GraphicObject/0.crow b/Samples/common/ui/Interfaces/Widget/0.crow index a58dcb8d..a58dcb8d 100644 --- a/Samples/common/ui/Interfaces/GraphicObject/0.crow +++ b/Samples/common/ui/Interfaces/Widget/0.crow diff --git a/Samples/common/ui/Interfaces/GraphicObject/1.crow b/Samples/common/ui/Interfaces/Widget/1.crow index d74f4949..d74f4949 100644 --- a/Samples/common/ui/Interfaces/GraphicObject/1.crow +++ b/Samples/common/ui/Interfaces/Widget/1.crow diff --git a/Samples/common/ui/Interfaces/GraphicObject/2.crow b/Samples/common/ui/Interfaces/Widget/2.crow index af2998ac..af2998ac 100644 --- a/Samples/common/ui/Interfaces/GraphicObject/2.crow +++ b/Samples/common/ui/Interfaces/Widget/2.crow diff --git a/Samples/common/ui/Interfaces/GraphicObject/4.crow b/Samples/common/ui/Interfaces/Widget/4.crow index 81d386c9..81d386c9 100644 --- a/Samples/common/ui/Interfaces/GraphicObject/4.crow +++ b/Samples/common/ui/Interfaces/Widget/4.crow diff --git a/Samples/common/ui/Interfaces/GraphicObject/5.crow b/Samples/common/ui/Interfaces/Widget/5.crow index 535623a3..535623a3 100644 --- a/Samples/common/ui/Interfaces/GraphicObject/5.crow +++ b/Samples/common/ui/Interfaces/Widget/5.crow diff --git a/Samples/common/ui/Interfaces/GraphicObject/6.crow b/Samples/common/ui/Interfaces/Widget/6.crow index f537a71d..f537a71d 100644 --- a/Samples/common/ui/Interfaces/GraphicObject/6.crow +++ b/Samples/common/ui/Interfaces/Widget/6.crow diff --git a/Samples/common/ui/Interfaces/GraphicObject/7.crow b/Samples/common/ui/Interfaces/Widget/7.crow index 0ac9b19f..0ac9b19f 100644 --- a/Samples/common/ui/Interfaces/GraphicObject/7.crow +++ b/Samples/common/ui/Interfaces/Widget/7.crow diff --git a/Samples/common/ui/Interfaces/GraphicObject/blueLine.crow b/Samples/common/ui/Interfaces/Widget/blueLine.crow index 32d5c166..32d5c166 100644 --- a/Samples/common/ui/Interfaces/GraphicObject/blueLine.crow +++ b/Samples/common/ui/Interfaces/Widget/blueLine.crow diff --git a/Samples/common/ui/Interfaces/GraphicObject/label.crow b/Samples/common/ui/Interfaces/Widget/label.crow index ad47ccf7..ad47ccf7 100644 --- a/Samples/common/ui/Interfaces/GraphicObject/label.crow +++ b/Samples/common/ui/Interfaces/Widget/label.crow diff --git a/Samples/common/ui/Interfaces/GraphicObject/textBox.crow b/Samples/common/ui/Interfaces/Widget/textBox.crow index 2094de4b..2094de4b 100644 --- a/Samples/common/ui/Interfaces/GraphicObject/textBox.crow +++ b/Samples/common/ui/Interfaces/Widget/textBox.crow diff --git a/Samples/common/ui/templates/testWindow.goml.sav b/Samples/common/ui/templates/testWindow.goml.sav index 42b4b744..268f7af4 100644 --- a/Samples/common/ui/templates/testWindow.goml.sav +++ b/Samples/common/ui/templates/testWindow.goml.sav @@ -7,7 +7,7 @@ <HorizontalStack Width="0" Height="-1" Margin="10" Background="BlueCrayola"> <Checkbox Height="-1" Width="80"/> - <GraphicObject Width="0"/> + <Widget Width="0"/> <Checkbox Height="-1" Width="80"/> </HorizontalStack> <Groupbox Text="test" Height="-1" Width="-1" Margin="5"> |