aboutsummaryrefslogtreecommitdiffstatsci
path: root/Tests
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2017-04-20 14:08:49 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2017-04-20 14:08:49 +0200
commit7995e83b47cd75895fbf597f6f277ab2007ca905 (patch)
tree124bdcb55cec40497a158383560b0e951c759d8b /Tests
parent34c32191fc76ab5834207e72fd17cdc478a2d935 (diff)
tests with themes, bluez controlsThemes
Diffstat (limited to 'Tests')
-rw-r--r--Tests/BasicTests.cs23
-rwxr-xr-xTests/Interfaces/Divers/0.crow8
-rwxr-xr-xTests/Interfaces/Divers/1.crow198
-rw-r--r--Tests/Tests.csproj20
-rw-r--r--Tests/Theme/Blues.style39
-rwxr-xr-xTests/Theme/bluez/CheckBox.template10
-rwxr-xr-xTests/Theme/bluez/ComboBox.template24
-rwxr-xr-xTests/Theme/bluez/RadioButton.template10
-rwxr-xr-xTests/Theme/bluez/Spinner.template16
-rw-r--r--Tests/image/screenshot--tech-frame.svg12
10 files changed, 339 insertions, 21 deletions
diff --git a/Tests/BasicTests.cs b/Tests/BasicTests.cs
index 3e8bb716..8f1b5058 100644
--- a/Tests/BasicTests.cs
+++ b/Tests/BasicTests.cs
@@ -75,20 +75,9 @@ namespace Tests
}
public IList<String> List2 = new List<string>(new string[]
{
- "string1",
- "string2",
- "string3",
-// "string4",
-// "string5",
-// "string6",
-// "string7",
-// "string8",
-// "string8",
-// "string8",
-// "string8",
-// "string8",
-// "string8",
-// "string9"
+ "Item 1",
+ "Item 2",
+ "Item 3",
}
);
public IList<String> TestList2 {
@@ -142,6 +131,7 @@ namespace Tests
//testFiles = new string [] { @"Interfaces/Unsorted/testFileDialog.crow" };
//testFiles = new string [] { @"Interfaces/Divers/colorPicker.crow" };
testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
+ testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Group", "*.crow")).ToArray ();
@@ -151,7 +141,6 @@ namespace Tests
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedGroup", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Wrapper", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Unsorted", "*.crow")).ToArray ();
object tc = Color.AirForceBlueRaf;
@@ -163,8 +152,8 @@ namespace Tests
Quit (null, null);
return;
} else if (e.Key == OpenTK.Input.Key.F1) {
- TestList.Add ("new string");
- NotifyValueChanged ("TestList", TestList);
+ GraphicObject w = Load ("Interfaces/TemplatedContainer/testMsgBox.crow");
+ w.DataSource = this;
return;
} else if (e.Key == OpenTK.Input.Key.F4) {
GraphicObject w = Load ("Interfaces/TemplatedContainer/testWindow.goml");
diff --git a/Tests/Interfaces/Divers/0.crow b/Tests/Interfaces/Divers/0.crow
index 15ab65f4..480dde3b 100755
--- a/Tests/Interfaces/Divers/0.crow
+++ b/Tests/Interfaces/Divers/0.crow
@@ -142,13 +142,13 @@
</VerticalStack>
<Splitter/>
<VerticalStack Width="30%" Margin="5">
-<!-- <Border Margin="5" Height="Fit">
+ <Border Margin="5" Height="Fit">
<Label Width="Stretched" Margin="1" Text="{../../dv.SelectedItem}"/>
- </Border>-->
-<!-- <Border Margin="5" Height="30%">
+ </Border>
+ <Border Margin="5" Height="30%">
<DirectoryView Name="dv" CurrentDirectory="/" Margin="1"/>
</Border>
- <Splitter/>-->
+ <Splitter/>
<ListBox Name="colorList" Data="{TestList}" Margin="5"
ItemTemplate="#Tests.Interfaces.colorItem.crow"
Template="#Crow.Templates.ScrollingListBox.goml"
diff --git a/Tests/Interfaces/Divers/1.crow b/Tests/Interfaces/Divers/1.crow
new file mode 100755
index 00000000..61c190b0
--- /dev/null
+++ b/Tests/Interfaces/Divers/1.crow
@@ -0,0 +1,198 @@
+<?xml version="1.0"?>
+<Window Caption="Showcase" Height="90%" Width="90%">
+ <HorizontalStack Background="Onyx" Margin="5">
+ <VerticalStack Width="30%" >
+ <GroupBox Caption="Labels" Height="Fit">
+ <VerticalStack>
+ <Label/>
+ <Label/>
+ <Label/>
+ </VerticalStack>
+ </GroupBox>
+ <GroupBox Caption="Text boxes" Height="Fit">
+ <VerticalStack>
+ <TextBox/>
+ <TextBox/>
+ <TextBox/>
+ </VerticalStack>
+ </GroupBox>
+ <GroupBox Caption="Multiline text boxe" Height="Fit">
+ <TextBox TextAlignment="TopLeft" Multiline="true" Height="60"/>
+ </GroupBox>
+ <GroupBox Caption="Check boxes" Height="Fit">
+ <VerticalStack>
+ <CheckBox/>
+ <CheckBox/>
+ <CheckBox/>
+ </VerticalStack>
+ </GroupBox>
+ <GroupBox Caption="Radio buttons" Height="Fit">
+ <VerticalStack>
+ <RadioButton/>
+ <RadioButton/>
+ <RadioButton/>
+ </VerticalStack>
+ </GroupBox>
+ <GroupBox Caption="Spinner" Height="Fit">
+ <VerticalStack>
+ <Spinner Width="60"/>
+ <Spinner/>
+ <Spinner />
+ </VerticalStack>
+ </GroupBox>
+ </VerticalStack>
+ <VerticalStack Width="30%" >
+ <GroupBox Caption="Buttons" Height="Fit">
+ <VerticalStack>
+ <Button/>
+ <Button CornerRadius="5" Background="DimGray"/>
+ <Button/>
+ </VerticalStack>
+ </GroupBox>
+ <GroupBox Caption="Expandable" Height="Fit">
+ <VerticalStack>
+ <Expandable Width="Stretched" Background="Gray">
+ <Expandable Width="Stretched" Background="LightBlue">
+ <Expandable Width="Stretched" Background="Green">
+ <Expandable Width="Stretched" Background="LimeGreen">
+ <Expandable Width="Stretched" Background="DimGray">
+ <Expandable Width="Stretched" Background="Yellow">
+ <Expandable Width="Stretched" Background="NavyBlue">
+ <Expandable Width="Stretched" Background="Blue">
+ <Expandable Width="Stretched" Background="BlueCrayola">
+ <Expandable Width="Stretched" Background="Green">
+ <Label Background="Red" Text="{fps}"/>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ <Expandable>
+ <Expandable>
+ <Expandable>
+ <Expandable>
+ <Expandable>
+ <Expandable>
+ <Expandable>
+ <Expandable>
+ <Expandable>
+ <Label Background="Red" Text="{fps}"/>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ <Expandable Width="Stretched" Background="Gray">
+ <Expandable Width="Stretched" Background="LightBlue">
+ <Expandable Width="Stretched" Background="Green">
+ <Expandable Width="Stretched" Background="LimeGreen">
+ <Expandable Width="Stretched" Background="DimGray">
+ <Expandable Width="Stretched" Background="Yellow">
+ <Expandable Width="Stretched" Background="NavyBlue">
+ <Expandable Width="Stretched" Background="Blue">
+ <Expandable Width="Stretched" Background="BlueCrayola">
+ <Expandable Width="Stretched" Background="Green">
+ <Label Background="Red" Text="{fps}"/>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </VerticalStack>
+ </GroupBox>
+ <GroupBox Caption="Popup" Height="Fit">
+ <VerticalStack>
+ <Popper Background="DimGray" >
+ <Border Fit="True" Background="DimGray" CornerRadius="5" BorderWidth="1">
+ <Image Path="#Crow.Images.Icons.crow.svg" Width="100" Height="100" Margin="10"/>
+ </Border>
+ </Popper>
+ <Popper Background="DimGray" >
+ <Border Fit="True" Background="DimGray" CornerRadius="5" BorderWidth="1">
+ <Image Path="#Crow.Images.Icons.crow.svg" Width="100" Height="100" Margin="10"/>
+ </Border>
+ </Popper>
+ <Popper Background="DimGray" >
+ <Border Fit="True" Background="DimGray" CornerRadius="5" BorderWidth="1">
+ <Image Path="#Crow.Images.Icons.crow.svg" Width="100" Height="100" Margin="10"/>
+ </Border>
+ </Popper>
+ </VerticalStack>
+ </GroupBox>
+ <GroupBox Caption="Menu" Height="Fit">
+ <Menu>
+ <MenuItem Caption="File" Width="Fit">
+ <MenuItem Caption="New" />
+ <MenuItem Caption="Open"/>
+ <MenuItem Caption="Save"/>
+ <MenuItem Caption="Quit"/>
+ </MenuItem>
+ <MenuItem Caption="Edit" Name="edit" Width="Fit">
+ <MenuItem Caption="Cut"/>
+ <MenuItem Caption="Copy"/>
+ <MenuItem Caption="Paste"/>
+ <MenuItem Caption="Special" Name="special" Width="Fit">
+ <MenuItem Caption="Cut"/>
+ <MenuItem Caption="Copy"/>
+ <MenuItem Caption="Paste"/>
+ </MenuItem>
+ <MenuItem Caption="Special2" Name="special" Width="Fit">
+ <MenuItem Caption="Cut"/>
+ <MenuItem Caption="Copy"/>
+ <MenuItem Caption="Paste"/>
+ </MenuItem>
+ </MenuItem>
+ <MenuItem Caption="Help" Width="Fit">
+ <MenuItem Caption="About"/>
+ <MenuItem Caption="Help"/>
+ </MenuItem>
+ </Menu>
+ </GroupBox>
+ <GroupBox Caption="Sliders" Height="Fit">
+ <VerticalStack>
+ <Slider Height="10" Width="90%"/>
+ <Slider Height="10" Width="90%"/>
+ <Slider Height="10" Width="90%"/>
+ </VerticalStack>
+ </GroupBox>
+ </VerticalStack>
+ <VerticalStack Width="35%">
+ <ColorPicker Background="Jet" Height="Fit"/>
+ <GroupBox Caption="Combo boxes" Height="Fit">
+ <VerticalStack>
+ <ComboBox Data="{List2}"/>
+ <ComboBox Data="{List2}" SelectedIndex="1"/>
+ <ComboBox Data="{List2}"/>
+ </VerticalStack>
+ </GroupBox>
+ <GroupBox Caption="Image" Height="Fit">
+ <Image Path="#Crow.Images.Icons.crow.svg" Width="100" Height="40" Margin="4"/>
+ </GroupBox>
+ <GroupBox Caption="List box" Height="Fit">
+ <ListBox Data="{List2}"/>
+ </GroupBox>
+ <VerticalStack Background="#Tests.image.screenshot--tech-frame.svg" Margin="16">
+ <Label Text="Tech Frame" Font="Mono bold, 12" HorizontalAlignment="Left" Background="Clear"/>
+ <VerticalStack Margin="4">
+ <Label Text="this is a tech frame"/>
+ <TextBox/>
+ <ProgressBar Height="6" Value="10"/>
+ </VerticalStack>
+ </VerticalStack>
+ </VerticalStack>
+ </HorizontalStack>
+</Window> \ No newline at end of file
diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj
index 360f4400..2371d228 100644
--- a/Tests/Tests.csproj
+++ b/Tests/Tests.csproj
@@ -322,6 +322,9 @@
<None Include="Interfaces\Wrapper\2.2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+ <None Include="Interfaces\Divers\1.crow">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
</ItemGroup>
<ItemGroup>
<Folder Include="Interfaces\" />
@@ -335,6 +338,7 @@
<Folder Include="Interfaces\TemplatedControl\" />
<Folder Include="Interfaces\TemplatedContainer\" />
<Folder Include="Interfaces\TemplatedGroup\" />
+ <Folder Include="Theme\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="image\tetra.png">
@@ -356,6 +360,22 @@
<EmbeddedResource Include="Interfaces\treeList.crow" />
<EmbeddedResource Include="Interfaces\CheckBox2.imlt" />
<EmbeddedResource Include="Interfaces\perfMsr.crow" />
+ <EmbeddedResource Include="image\screenshot--tech-frame.svg" />
+ <EmbeddedResource Include="Theme\Blues.style">
+ <LogicalName>Bluez.style</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Theme\bluez\CheckBox.template">
+ <LogicalName>Crow.CheckBox.template</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Theme\bluez\ComboBox.template">
+ <LogicalName>Crow.ComboBox.template</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Theme\bluez\RadioButton.template">
+ <LogicalName>Crow.RadioButton.template</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Theme\bluez\Spinner.template">
+ <LogicalName>Crow.Spinner.template</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Crow.csproj">
diff --git a/Tests/Theme/Blues.style b/Tests/Theme/Blues.style
new file mode 100644
index 00000000..81dc99f2
--- /dev/null
+++ b/Tests/Theme/Blues.style
@@ -0,0 +1,39 @@
+Icon {
+ Margin=1;
+ Width=14;
+ Height=14;
+}
+Border {
+ Foreground = Gray;
+}
+GroupBox {
+ Foreground = Gray;
+}
+CheckBox {
+ //Template = #Crow.Bluez.CheckBox.template;
+ Caption = Check Box;
+ CornerRadius = 5;
+ Width=Fit;
+ Background = vgradient|0:DimGray|1:Onyx;
+}
+RadioButton {
+ //Template = #Crow.Templates.bluez.RadioButton.template;
+ Caption = Radio But;
+ CornerRadius = 5;
+ Width=Fit;
+ Background = vgradient|0:DimGray|1:Onyx;
+}
+ComboBox {
+ //Template = #Crow.Templates.bluez.ComboBox.template;
+ CornerRadius = 5;
+ Width=Fit;
+ Background = vgradient|0:DimGray|1:Onyx;
+}
+Spinner {
+ //Template = #Crow.Templates.bluez.Spinner.template;
+ CornerRadius = 5;
+ Foreground = White;
+ Width=70;
+ Height=Fit;
+ Background = vgradient|0:DimGray|1:Onyx;
+} \ No newline at end of file
diff --git a/Tests/Theme/bluez/CheckBox.template b/Tests/Theme/bluez/CheckBox.template
new file mode 100755
index 00000000..5569c81b
--- /dev/null
+++ b/Tests/Theme/bluez/CheckBox.template
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<Border Foreground="Gray" CornerRadius="{./CornerRadius}" BorderWidth="1" Background="{./Background}"
+ MouseEnter="{Foreground=BlueCrayola}"
+ MouseLeave="{Foreground=Gray}">
+ <HorizontalStack Margin="1">
+ <Image Style="Icon" Path="#Crow.Images.Icons.checkbox.svg"
+ SvgSub="{./IsChecked}"/>
+ <Label Font="{./Font}" Text="{./Caption}" Foreground="{./Foreground}" Margin="2"/>
+ </HorizontalStack>
+</Border> \ No newline at end of file
diff --git a/Tests/Theme/bluez/ComboBox.template b/Tests/Theme/bluez/ComboBox.template
new file mode 100755
index 00000000..d8f3e335
--- /dev/null
+++ b/Tests/Theme/bluez/ComboBox.template
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<Popper Name="popper" PopDirection="Bottom">
+ <Template>
+ <Border Foreground="Gray" CornerRadius="{../../CornerRadius}" BorderWidth="1"
+ MouseEnter="{Foreground=BlueCrayola}"
+ MouseLeave="{Foreground=Gray}">
+ <HorizontalStack Background="{../../../Background}" Margin="1">
+ <Label Font="{./Font}" MinimumSize="80,10" Margin="2" Foreground="White" Text="{../../../../SelectedItem}"/>
+ <Image Style="Icon" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ </HorizontalStack>
+ </Border>
+ </Template>
+ <Border BorderWidth="1" Margin="1" Background="Jet"
+ MinimumSize="{../../MinimumPopupSize}" Fit="true">
+ <Scroller Name="scroller1" Margin="2" VerticalScrolling="true"
+ MaximumSize="0,200"
+ HorizontalAlignment="Left">
+ <VerticalStack
+ Height="Fit" Name="ItemsContainer" Margin="0"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Top"/>
+ </Scroller>
+ </Border>
+</Popper>
diff --git a/Tests/Theme/bluez/RadioButton.template b/Tests/Theme/bluez/RadioButton.template
new file mode 100755
index 00000000..f7988b7f
--- /dev/null
+++ b/Tests/Theme/bluez/RadioButton.template
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<Border Foreground="Gray" CornerRadius="{./CornerRadius}" BorderWidth="1"
+ MouseEnter="{Foreground=BlueCrayola}"
+ MouseLeave="{Foreground=Gray}">
+ <HorizontalStack Background="{./Background}" Margin="1">
+ <Image Style="Icon" Path="#Crow.Images.Icons.radiobutton.svg"
+ SvgSub="{./IsChecked}"/>
+ <Label Font="{./Font}" Text="{./Caption}" Foreground="{./Foreground}" Margin="2"/>
+ </HorizontalStack>
+</Border> \ No newline at end of file
diff --git a/Tests/Theme/bluez/Spinner.template b/Tests/Theme/bluez/Spinner.template
new file mode 100755
index 00000000..401bad69
--- /dev/null
+++ b/Tests/Theme/bluez/Spinner.template
@@ -0,0 +1,16 @@
+<Border Foreground="Gray" CornerRadius="{./CornerRadius}" BorderWidth="1" Background="{./Background}"
+ MouseEnter="{Foreground=BlueCrayola}"
+ MouseLeave="{Foreground=Gray}">
+ <HorizontalStack Margin="1" Spacing="1">
+ <Button MouseRepeat="true" Height="Stretched" Width="14" Margin="1" MouseClick="./onDown">
+ <Image Path="#Crow.Images.Icons.arrows.svg" SvgSub="left" Margin="1"/>
+ </Button>
+ <GraphicObject Width="1" Height="70%" Background="Gray"/>
+ <Label Foreground="{./Foreground}" Font="{./Font}" Width="Stretched"
+ Text="{./Value}" TextAlignment="Center" Margin="2"/>
+ <GraphicObject Width="1" Height="70%" Background="Gray"/>
+ <Button MouseRepeat="true" Height="Stretched" Width="14" Margin="1" MouseClick="./onUp">
+ <Image Path="#Crow.Images.Icons.arrows.svg" SvgSub="right" Margin="1"/>
+ </Button>
+ </HorizontalStack>
+</Border> \ No newline at end of file
diff --git a/Tests/image/screenshot--tech-frame.svg b/Tests/image/screenshot--tech-frame.svg
new file mode 100644
index 00000000..174772c0
--- /dev/null
+++ b/Tests/image/screenshot--tech-frame.svg
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generator: Adobe Illustrator 19.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 726.5 726.6" style="enable-background:new 0 0 726.5 726.6;" xml:space="preserve" width="396" height="396">
+<style type="text/css">
+ .st0{fill:#47C1C2;}
+</style>
+<polygon id="XMLID_5_" class="st0" points="48.2,705.5 226,705.5 204,676.2 48.2,676.2 48.2,76 41.2,83 41.2,596 24.7,608.2 24.7,685.9 "/>
+<polygon id="XMLID_6_" class="st0" points="368.7,705.5 343.7,676.2 235.6,676.2 257.5,705.5 "/>
+<polygon id="XMLID_4_" class="st0" points="390.4,697.2 371.7,676.5 655.1,676.5 678.4,655.8 678.4,333.5 705.7,350.8 705.7,445.5 684.4,463.5 684.4,652.5 637.1,697.2 "/>
+<polygon id="XMLID_8_" class="st0" points="315.2,29.9 334,50.5 49.5,50.5 27.2,71.8 27.2,393.5 0,376.2 0,281.5 21.2,263.6 21.2,74.5 68.6,29.9 "/>
+<polygon id="XMLID_2_" class="st0" points="81.8,16.7 458.2,16.7 494,50.6 661.9,50.6 678.6,66.3 678.6,315.8 695.2,325.5 695.2,79.5 660.1,45.4 515.5,45.4 478,8.4 354,8.4 346.3,0.5 98.3,0.5 "/>
+</svg> \ No newline at end of file