aboutsummaryrefslogtreecommitdiffstatsci
path: root/Samples/common
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2020-04-21 15:45:23 +0200
committerj-p <jp_bruyere@hotmail.com>2020-05-10 00:50:02 +0200
commitdf2ad1e48d1aba38e93834bc89566761d56d35ff (patch)
tree235f96f4afcbfb226a9f8825e1d966a991a724ed /Samples/common
parent6b4d2ea66d5312a2494d49beb6d868da68f11e9d (diff)
add facilities for using icons for EnumSelector + path parsing documentation and test
Diffstat (limited to 'Samples/common')
-rw-r--r--Samples/common/samples.style67
-rw-r--r--Samples/common/ui/Icons/Bottom.svg7
-rw-r--r--Samples/common/ui/Icons/Center.svg7
-rw-r--r--Samples/common/ui/Icons/Top.svg7
-rw-r--r--Samples/common/ui/Interfaces/Divers/0.crow8
-rw-r--r--Samples/common/ui/Interfaces/Divers/testShape.crow9
-rw-r--r--Samples/common/ui/Interfaces/GraphicObject/5.crow2
-rw-r--r--Samples/common/ui/Interfaces/TemplatedControl/testEnumSelector.crow16
-rw-r--r--Samples/common/ui/images/valign.svg9
-rw-r--r--Samples/common/ui/templates/CheckBox2.imlt2
-rw-r--r--Samples/common/ui/templates/enumGetIcons.itmp11
-rw-r--r--Samples/common/ui/templates/enumSingleSVG.itmp4
-rw-r--r--Samples/common/ui/templates/test.style50
13 files changed, 132 insertions, 67 deletions
diff --git a/Samples/common/samples.style b/Samples/common/samples.style
new file mode 100644
index 00000000..ff956325
--- /dev/null
+++ b/Samples/common/samples.style
@@ -0,0 +1,67 @@
+FpsLabel {
+ Width = "30";
+ Font = "droid, 10";
+ Margin = "0";
+ TextAlignment = "Center";
+}
+FpsDisp {
+ Font = "droid bold, 10";
+ Width = "60";
+ Margin = "0";
+ CornerRadius = "3";
+ TextAlignment = "Center";
+ Background = "MediumSeaGreen";
+}
+HStackMeasure {
+ Margin = "2";
+ Width = "Fit";
+ Height = "Fit";
+ Background = "DimGrey";
+}
+CheckBox2 {
+ Template= "Interfaces/CheckBox2.imlt";
+ Background = "Jet";
+ Checked="{Background=MediumSeaGreen}";
+ Unchecked = "{Background=Jet}";
+}
+CheckBox3 {
+ Template= "Interfaces/CheckBox2.imlt";
+ Background = "Jet";
+ Width = "Stretched";
+ Height = "Fit";
+ CornerRadius = "5";
+ Checked="{Background=MediumSeaGreen}";
+ Unchecked = "{Background=Jet}";
+}
+labPerf {
+ Font = "droid, 8";
+ Width = "50%";
+}
+labPerfVal{
+ Font = "droid, 8";
+ Width = "50%";
+}
+DbgLogViewer{
+ Background = "Onyx";
+ Font = "mono, 8";
+ Foreground = "LightGrey";
+ Focusable = "true";
+}
+DockWindow{
+ Background = "0.1,0.1,0.1,0.5";
+}
+
+valignStyle {
+ Template="#ui.enumSingleSVG.itmp";
+ Checked="{Background=MediumSeaGreen}";
+ Unchecked = "{Background=Black}";
+ //Initialized="GetDrawModeIcon";
+ //Initialized="{Background=Blue}";
+}
+valignStyle2 {
+ Template="#ui.enumGetIcons.itmp";
+ Checked="{Background=MediumSeaGreen}";
+ Unchecked = "{Background=Black}";
+ //Initialized="GetDrawModeIcon";
+ //Initialized="{Background=Blue}";
+} \ No newline at end of file
diff --git a/Samples/common/ui/Icons/Bottom.svg b/Samples/common/ui/Icons/Bottom.svg
new file mode 100644
index 00000000..38e5fa62
--- /dev/null
+++ b/Samples/common/ui/Icons/Bottom.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generated by IcoMoon.io -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
+<rect fill="#00000000" stroke="#444444" stroke-width="1" x="0.5" y="0.5" width="15" height="15"/>
+<line id="Bottom" fill="#00000000" stroke="#444444" stroke-width="4" x1="1.5" y1="12.5" x2="14.5" y2="12.5" />
+</svg>
diff --git a/Samples/common/ui/Icons/Center.svg b/Samples/common/ui/Icons/Center.svg
new file mode 100644
index 00000000..ac2efdb8
--- /dev/null
+++ b/Samples/common/ui/Icons/Center.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generated by IcoMoon.io -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
+<rect fill="#00000000" stroke="#444444" stroke-width="1" x="0.5" y="0.5" width="15" height="15"/>
+<line id="Center" fill="#00000000" stroke="#444444" stroke-width="4" x1="1.5" y1="8" x2="14.5" y2="8" />
+</svg>
diff --git a/Samples/common/ui/Icons/Top.svg b/Samples/common/ui/Icons/Top.svg
new file mode 100644
index 00000000..01d11d52
--- /dev/null
+++ b/Samples/common/ui/Icons/Top.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generated by IcoMoon.io -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
+<rect fill="#00000000" stroke="#444444" stroke-width="1" x="0.5" y="0.5" width="15" height="15"/>
+<line id="Top" fill="#00000000" stroke="#444444" stroke-width="4" x1="1.5" y1="3.5" x2="14.5" y2="3.5" />
+</svg>
diff --git a/Samples/common/ui/Interfaces/Divers/0.crow b/Samples/common/ui/Interfaces/Divers/0.crow
index 8850e26d..c98d6410 100644
--- a/Samples/common/ui/Interfaces/Divers/0.crow
+++ b/Samples/common/ui/Interfaces/Divers/0.crow
@@ -64,10 +64,10 @@
</VerticalStack>
<Splitter />
<VerticalStack Width="50%">
- <RadioButton Style="RadioButton2" />
- <RadioButton Style="RadioButton2" />
- <RadioButton Style="RadioButton2" />
- <RadioButton Style="RadioButton2" />
+ <RadioButton Style="CheckBox2" />
+ <RadioButton Style="CheckBox2" />
+ <RadioButton Style="CheckBox2" />
+ <RadioButton Style="CheckBox2" />
</VerticalStack>
</HorizontalStack>
</GroupBox>
diff --git a/Samples/common/ui/Interfaces/Divers/testShape.crow b/Samples/common/ui/Interfaces/Divers/testShape.crow
index 99b89b07..14af0f21 100644
--- a/Samples/common/ui/Interfaces/Divers/testShape.crow
+++ b/Samples/common/ui/Interfaces/Divers/testShape.crow
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
-<Container Fit="true" Background="Red" Tooltip="test tooltip" >
- <Shape Foreground="Transparent" Background="DimGrey" Size="11,11" Path="M 5.5,0.5 L 10.5,10.5 L 0.5,10.5 Z"
- MouseEnter="{Background=hgradient|0:DimGrey|0.5:RoyalBlue|1:Black}"
- MouseLeave="{Background=DimGrey}"/>
-</Container> \ No newline at end of file
+<VerticalStack>
+ <TextBox Text="{²../shape.Path}"/>
+ <Shape Margin="0" Width="400" Height="400" Name="shape" Foreground="Blue" Background="DimGrey" Size="100,100" Path="M 5.5,0.5 L 10.5,10.5 L 0.5,10.5 Z G"/>
+</VerticalStack> \ No newline at end of file
diff --git a/Samples/common/ui/Interfaces/GraphicObject/5.crow b/Samples/common/ui/Interfaces/GraphicObject/5.crow
index 0e0560fc..8fdf887d 100644
--- a/Samples/common/ui/Interfaces/GraphicObject/5.crow
+++ b/Samples/common/ui/Interfaces/GraphicObject/5.crow
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<HorizontalStack Width="Stretched" Height="Fit" Margin="5" Background="Mantis">
+<HorizontalStack Width="Stretched" Height="Fit" Margin="5" Background="RoyalBlue">
<Widget Background="Carmine" Width="10%" Height="20"/>
<Widget Background="Carmine" Width="Stretched" Height="20"/>
<Widget Background="Carmine" Width="10%" Height="20"/>
diff --git a/Samples/common/ui/Interfaces/TemplatedControl/testEnumSelector.crow b/Samples/common/ui/Interfaces/TemplatedControl/testEnumSelector.crow
new file mode 100644
index 00000000..303f5432
--- /dev/null
+++ b/Samples/common/ui/Interfaces/TemplatedControl/testEnumSelector.crow
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<VerticalStack Spacing="5" Margin="5">
+ <Image Path="#images.valign.svg" Fit="True" Background="White" Margin="5" SvgSub="{²CurrentVAlign}"/>
+ <Border Height="100" Width="Fit" Background="Jet">
+ <Label Margin="5" Text="vertical aligned text" VerticalAlignment="{CurrentVAlign}" Background="DarkBlue"/>
+ </Border>
+ <EnumSelector Name="valign" Caption="Vertical Alignment" EnumValue="{²CurrentVAlign}" />
+ <EnumSelector RadioButtonStyle="CheckBox3" Name="valign" Caption="Vertical Alignment" EnumValue="{²CurrentVAlign}" >
+ <Template>
+ <VerticalStack Name="Content" Width="100"/>
+ </Template>
+ </EnumSelector>
+ <EnumSelector RadioButtonStyle="CheckBox2" Name="valign" Caption="Vertical Alignment" EnumValue="{²CurrentVAlign}" />
+ <EnumSelector RadioButtonStyle="valignStyle" Name="valign1" Caption="Vertical Alignment" EnumValue="{²CurrentVAlign}" />
+ <EnumSelector RadioButtonStyle="valignStyle2" Name="valign2" Caption="Vertical Alignment" EnumValue="{²CurrentVAlign}" />
+</VerticalStack> \ No newline at end of file
diff --git a/Samples/common/ui/images/valign.svg b/Samples/common/ui/images/valign.svg
new file mode 100644
index 00000000..b24cf26b
--- /dev/null
+++ b/Samples/common/ui/images/valign.svg
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generated by IcoMoon.io -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
+<rect fill="#00000000" stroke="#444444" stroke-width="1" x="0.5" y="0.5" width="15" height="15"/>
+<line id="Top" fill="#00000000" stroke="#444444" stroke-width="4" x1="1.5" y1="3.5" x2="14.5" y2="3.5" />
+<line id="Center" fill="#00000000" stroke="#444444" stroke-width="4" x1="1.5" y1="8" x2="14.5" y2="8" />
+<line id="Bottom" fill="#00000000" stroke="#444444" stroke-width="4" x1="1.5" y1="12.5" x2="14.5" y2="12.5" />
+</svg>
diff --git a/Samples/common/ui/templates/CheckBox2.imlt b/Samples/common/ui/templates/CheckBox2.imlt
index c2bfe8da..048d495b 100644
--- a/Samples/common/ui/templates/CheckBox2.imlt
+++ b/Samples/common/ui/templates/CheckBox2.imlt
@@ -1,4 +1,4 @@
-<Label Font="{./Font}" Text="{./Caption}" Height="{./HeightPolicy}" Width="{./WidthPolicy}"
+<Label Font="{./Font}" Text="{./Caption}" CornerRadius="{./CornerRadius}"
Margin="3"
Background="{./Background}"
Foreground="DimGrey"
diff --git a/Samples/common/ui/templates/enumGetIcons.itmp b/Samples/common/ui/templates/enumGetIcons.itmp
index 048d495b..63f6fdbd 100644
--- a/Samples/common/ui/templates/enumGetIcons.itmp
+++ b/Samples/common/ui/templates/enumGetIcons.itmp
@@ -1,7 +1,4 @@
-<Label Font="{./Font}" Text="{./Caption}" CornerRadius="{./CornerRadius}"
- Margin="3"
- Background="{./Background}"
- Foreground="DimGrey"
- TextAlignment="Center"
- MouseEnter="{Foreground=White}"
- MouseLeave="{Foreground=DimGrey}"/> \ No newline at end of file
+<Border Foreground="Grey" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Grey}">
+ <Image Path="{./Tag}" Fit="True" Margin="1" CornerRadius="{./CornerRadius}"
+ Background="{./Background}"/>
+</Border> \ No newline at end of file
diff --git a/Samples/common/ui/templates/enumSingleSVG.itmp b/Samples/common/ui/templates/enumSingleSVG.itmp
new file mode 100644
index 00000000..83bcfa33
--- /dev/null
+++ b/Samples/common/ui/templates/enumSingleSVG.itmp
@@ -0,0 +1,4 @@
+<Border Foreground="Grey" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Grey}">
+ <Image Path="#images.valign.svg" Fit="True" Margin="1" SvgSub="{./Caption}" CornerRadius="{./CornerRadius}"
+ Background="{./Background}"/>
+</Border> \ No newline at end of file
diff --git a/Samples/common/ui/templates/test.style b/Samples/common/ui/templates/test.style
index 6f5dc8fb..5f282702 100644
--- a/Samples/common/ui/templates/test.style
+++ b/Samples/common/ui/templates/test.style
@@ -1,49 +1 @@
-FpsLabel {
- Width = "30";
- Font = "droid, 10";
- Margin = "0";
- TextAlignment = "Center";
-}
-FpsDisp {
- Font = "droid bold, 10";
- Width = "60";
- Margin = "0";
- CornerRadius = "3";
- TextAlignment = "Center";
- Background = "MediumSeaGreen";
-}
-HStackMeasure {
- Margin = "2";
- Width = "Fit";
- Height = "Fit";
- Background = "DimGrey";
-}
-CheckBox2 {
- Template= "Interfaces/CheckBox2.imlt";
- Background = "Jet";
- Checked="{Background=MediumSeaGreen}";
- Unchecked = "{Background=Jet}";
-}
-RadioButton2 {
- Template="Interfaces/CheckBox2.imlt";
- Background = "Jet";
- Checked = "{Background=MediumSeaGreen}";
- Unchecked = "{Background=Jet}";
-}
-labPerf {
- Font = "droid, 8";
- Width = "50%";
-}
-labPerfVal{
- Font = "droid, 8";
- Width = "50%";
-}
-DbgLogViewer{
- Background = "Onyx";
- Font = "mono, 8";
- Foreground = "LightGrey";
- Focusable = "true";
-}
-DockWindow{
- Background = "0.1,0.1,0.1,0.5";
-}
+ \ No newline at end of file