aboutsummaryrefslogtreecommitdiffstatsci
path: root/Samples/common/ui/Interfaces
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-04-22 18:12:14 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-04-22 18:12:14 +0200
commita515e31998f64f537e29cd30fdb7e9bfc7d4a02f (patch)
tree22dc8a0c6414b23dfb36fd3716e44ba342d3ae0e /Samples/common/ui/Interfaces
parentd7bd85c20b11c4a3eb53b708524457a18e7ac025 (diff)
IToggle for TemplatedGroup recursion, Popper without checkbox in template, commands files split
Diffstat (limited to 'Samples/common/ui/Interfaces')
-rw-r--r--Samples/common/ui/Interfaces/Experimental/colorTable.crow6
-rw-r--r--Samples/common/ui/Interfaces/Experimental/fitPopup.crow11
-rw-r--r--Samples/common/ui/Interfaces/Experimental/spinner.crow2
-rw-r--r--Samples/common/ui/Interfaces/TemplatedGroup/1.crow40
-rw-r--r--Samples/common/ui/Interfaces/menutest.crow73
-rw-r--r--Samples/common/ui/Interfaces/menutest2.crow59
6 files changed, 143 insertions, 48 deletions
diff --git a/Samples/common/ui/Interfaces/Experimental/colorTable.crow b/Samples/common/ui/Interfaces/Experimental/colorTable.crow
index 6da2b04a..29790261 100644
--- a/Samples/common/ui/Interfaces/Experimental/colorTable.crow
+++ b/Samples/common/ui/Interfaces/Experimental/colorTable.crow
@@ -1,6 +1,8 @@
-<ListBox Data="{TestList}" >
+<ListBox Data="{TestList}" >
<Template>
- <Table Name="ItemsContainer" Columns="name,Stretched;color,100"/>
+ <Scroller>
+ <Table Name="ItemsContainer" Columns="name,Fit;color,100" Height="Fit" Width="Stretched" VerticalAlignment="Top"/>
+ </Scroller>
</Template>
<ItemTemplate>
<TableRow>
diff --git a/Samples/common/ui/Interfaces/Experimental/fitPopup.crow b/Samples/common/ui/Interfaces/Experimental/fitPopup.crow
new file mode 100644
index 00000000..44eef9fd
--- /dev/null
+++ b/Samples/common/ui/Interfaces/Experimental/fitPopup.crow
@@ -0,0 +1,11 @@
+<Popper Width="Fit">
+ <Template>
+ <Label Text="{./Caption}"/>
+ </Template>
+ <VerticalStack Width="Fit" Height="Fit" Background="Grey">
+ <Label Width="Stretched"/>
+ <Label Text="mljdqslfkj" Width="Stretched"/>
+ <Label Width="Stretched"/>
+ <Label Text="mljdqslfkjqsdfhjsdqfkljhsdqfkljhs" Width="Stretched"/>
+ </VerticalStack>
+</Popper> \ No newline at end of file
diff --git a/Samples/common/ui/Interfaces/Experimental/spinner.crow b/Samples/common/ui/Interfaces/Experimental/spinner.crow
index ac32e78d..4b5e66f0 100644
--- a/Samples/common/ui/Interfaces/Experimental/spinner.crow
+++ b/Samples/common/ui/Interfaces/Experimental/spinner.crow
@@ -1,6 +1,6 @@
<NumericControl Value="50" Height="Fit" Width="200" Background="DarkGrey">
<Template>
- <Border Style="ControlBorder" Background="{./Background}" CornerRadius="{./CornerRadius}" Margin="0">
+ <Border Style="ControlBorder" Background="{./Background}" CornerRadius="{./CornerRadius}" Margin="1">
<VerticalStack Spacing="0">
<HorizontalStack Spacing="5">
diff --git a/Samples/common/ui/Interfaces/TemplatedGroup/1.crow b/Samples/common/ui/Interfaces/TemplatedGroup/1.crow
index c74bcedd..9823da4d 100644
--- a/Samples/common/ui/Interfaces/TemplatedGroup/1.crow
+++ b/Samples/common/ui/Interfaces/TemplatedGroup/1.crow
@@ -3,28 +3,24 @@
<MenuItem Caption="File" Fit="true">
<MenuItem Caption="New">
<Template>
-<Popper Font="{./Font}" Caption="{./Caption}" Background="{./Background}" PopDirection="{./PopDirection}"
- Foreground = "{./Foreground}" CanPop="{./HasChildren}"
- IsPopped="{²./IsOpened}" PopWidth="{./PopWidth}" PopHeight="{./PopHeight}">
- <Template>
- <CheckBox IsChecked="{²./IsPopped}" Caption="{./Caption}" Background="{./Background}" Foreground="{./Foreground}">
- <Template>
- <Border Name="border1"
- MinimumSize = "60,0"
- Foreground="Transparent"
- Background="{./Background}">
- <Label Text="{./Caption}"
- Foreground="{./Foreground}"
- Margin="2" HorizontalAlignment="Left"
- Font="{./Font}" />
- </Border>
- </Template>
- </CheckBox>
- </Template>
- <Border Foreground="DimGrey" Width="{../PopWidth}" Height="{../PopHeight}" Background="${MenuBackground}">
- <VerticalStack Name="ItemsContainer"/>
- </Border>
-</Popper>
+ <Popper Font="{./Font}" Caption="{./Caption}" Background="{./Background}" PopDirection="{./PopDirection}"
+ Foreground = "{./Foreground}" CanPop="{./HasChildren}"
+ IsPopped="{²./IsOpened}" PopWidth="{./PopWidth}" PopHeight="{./PopHeight}">
+ <Template>
+ <Border Name="border1"
+ MinimumSize = "60,0"
+ Foreground="Transparent"
+ Background="{./Background}">
+ <Label Text="{./Caption}"
+ Foreground="{./Foreground}"
+ Margin="2" HorizontalAlignment="Left"
+ Font="{./Font}" />
+ </Border>
+ </Template>
+ <Border Foreground="DimGrey" Width="{../PopWidth}" Height="{../PopHeight}" Background="${MenuBackground}">
+ <VerticalStack Name="ItemsContainer"/>
+ </Border>
+ </Popper>
</Template>
</MenuItem>
</MenuItem>
diff --git a/Samples/common/ui/Interfaces/menutest.crow b/Samples/common/ui/Interfaces/menutest.crow
index 6498f644..eca923e5 100644
--- a/Samples/common/ui/Interfaces/menutest.crow
+++ b/Samples/common/ui/Interfaces/menutest.crow
@@ -1,31 +1,58 @@
-<Menu Data="{Commands}">
- <ItemTemplate>
-<MenuItem Command="{}" Width="150" PopWidth="120" IsEnabled="{CanExecute}">
+<?xml version="1.0"?>
+<Menu Data="{AllCommands}">
+ <ItemTemplate DataType="Crow.Command">
+ <Button Command="{}">
<Template>
- <Popper Font="{./Font}" Caption="{./Caption}" Background="{./Background}" PopDirection="{./PopDirection}"
- Foreground = "{./Foreground}" CanPop="{./HasChildren}" MouseDown="./onMI_Click"
- IsPopped="{²./IsOpened}" PopWidth="{./PopWidth}" PopHeight="{./PopHeight}">
+ <Label Text="{./Caption}" Width="Stretched" Height="Stretched" Margin="3"
+ MouseEnter="{Background=${ControlHighlight}}"
+ MouseLeave="{Background=Transparent}"/>
+ </Template>
+ </Button>
+ </ItemTemplate>
+ <ItemTemplate DataType="Crow.CommandGroup" >
+ <MenuItem Data="{Commands}" Width="Fit" IsEnabled="{CanExecute}">
+ <Template>
+ <Popper PopDirection="Bottom" Caption="{Caption}"
+ MouseEnter="{Background=${ControlHighlight}}"
+ MouseLeave="{Background=Transparent}">
<Template>
- <Border Name="border1"
- CornerRadius="0"
- MouseEnter="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}"
- MouseLeave="{Foreground=Transparent}"
- MouseDown="{Foreground=vgradient|0:Black|0.05:Grey|0.85:Grey|1:White}"
- MouseUp="{Foreground=vgradient|0:White|0.2:Grey|0.9:Grey|1:Black}"
- MinimumSize = "60,0"
- Foreground="Transparent"
- Background="{./Background}">
- <Label Text="{./Caption}"
- Foreground="{./Foreground}"
- Margin="1" HorizontalAlignment="Left"
- Font="{./Font}" />
- </Border>
+ <Label Text="{./Caption}" Width="Stretched" Height="Fit" Margin="3"
+ Background="{./Background}"/>
</Template>
- <Border Foreground="DimGrey" Width="{../PopWidth}" Height="{../PopHeight}" Background="DimGrey">
- <VerticalStack Name="ItemsContainer"/>
- </Border>
+ <VerticalStack Name="ItemsContainer" Fit="true" Background="Jet"/>
</Popper>
</Template>
+ <ItemTemplate DataType="Crow.Command">
+ <Label Text="{Caption}" HorizontalAlignment="Left" Width="Stretched" Height="Fit" Margin="0"
+ MouseEnter="{Background=${ControlHighlight}}"
+ MouseLeave="{Background=Transparent}"/>
+ </ItemTemplate>
+ <ItemTemplate DataType="Crow.CommandGroup" >
+ <MenuItem Data="{Commands}" Width="Stretched" IsEnabled="{CanExecute}">
+ <Template>
+ <Popper PopDirection="Right" Caption="{Caption}"
+ MouseEnter="{Background=${ControlHighlight}}"
+ MouseLeave="{Background=Transparent}">
+ <Template>
+ <Label Text="{./Caption}" Width="Stretched" Height="Stretched" Margin="3"
+ Background="{./Background}"/>
+ </Template>
+ <Border Foreground="DimGrey" Width="{../PopWidth}" Height="{../PopHeight}" Background="DarkGrey">
+ <VerticalStack Name="ItemsContainer"/>
+ </Border>
+ </Popper>
+ </Template>
+ <ItemTemplate DataType="Crow.Command">
+ <Button Command="{}" Width="Stretched">
+ <Template>
+ <Label Text="{./Caption}" Width="Stretched" Height="Stretched" Margin="3"
+ MouseEnter="{Background=${ControlHighlight}}"
+ MouseLeave="{Background=Transparent}"/>
+ </Template>
+ </Button>
+ </ItemTemplate>
+ </MenuItem>
+ </ItemTemplate>
</MenuItem>
</ItemTemplate>
</Menu> \ No newline at end of file
diff --git a/Samples/common/ui/Interfaces/menutest2.crow b/Samples/common/ui/Interfaces/menutest2.crow
new file mode 100644
index 00000000..32e841ea
--- /dev/null
+++ b/Samples/common/ui/Interfaces/menutest2.crow
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<Menu Data="{AllCommands}">
+ <ItemTemplate DataType="CommandGroup" >
+ <MenuItem Data="{Commands}" Width="Fit" IsEnabled="{CanExecute}">
+ <Template>
+ <Popper PopDirection="Bottom" Caption="{Caption}"
+ PopWidth="{./PopWidth}" PopHeight="{./PopHeight}"
+ MouseEnter="{Background=${ControlHighlight}}"
+ MouseLeave="{Background=Transparent}">
+ <Template>
+ <Label Text="{./Caption}" Width="Stretched" Height="Stretched" Margin="3"
+ Background="{./Background}"/>
+ </Template>
+ <VerticalStack Name="ItemsContainer" Fit="true" Background="DarkGrey"/>
+ </Popper>
+ </Template>
+ <ItemTemplate DataType="Command" >
+ <Button Command="{}" Width="Stretched">
+ <Template>
+ <HorizontalStack Margin="3" HorizontalAlignment="Left"
+ MouseEnter="{Background=${ControlHighlight}}"
+ MouseLeave="{Background=Transparent}">
+ <Image Width="10" Height="10" Margin="1" Path="{./Icon}" />
+ <Label Text="{./Caption}" />
+ </HorizontalStack>
+ </Template>
+ </Button>
+ </ItemTemplate>
+ <ItemTemplate DataType="CommandGroup" >
+ <MenuItem Data="{Commands}" Width="Stretched" IsEnabled="{CanExecute}">
+ <Template>
+ <Popper PopDirection="Right" Caption="{Caption}"
+ PopWidth="{./PopWidth}" PopHeight="{./PopHeight}"
+ MouseEnter="{Background=${ControlHighlight}}"
+ MouseLeave="{Background=Transparent}">
+ <Template>
+ <Label Text="{./Caption}" Width="Stretched" Height="Stretched" Margin="3"
+ Background="{./Background}"/>
+ </Template>
+ <VerticalStack Name="ItemsContainer" Fit="true" Background="DarkGrey"/>
+ </Popper>
+ </Template>
+ <ItemTemplate DataType="Command">
+ <Button Command="{}" Width="Stretched">
+ <Template>
+ <HorizontalStack Margin="3" HorizontalAlignment="Left"
+ MouseEnter="{Background=${ControlHighlight}}"
+ MouseLeave="{Background=Transparent}">
+ <Image Width="10" Height="10" Margin="1" Path="{./Icon}" />
+ <Label Text="{./Caption}" />
+ </HorizontalStack>
+ </Template>
+ </Button>
+ </ItemTemplate>
+ </MenuItem>
+ </ItemTemplate>
+ </MenuItem>
+ </ItemTemplate>
+</Menu> \ No newline at end of file