aboutsummaryrefslogtreecommitdiffstatsci
path: root/Tests
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-17 00:53:59 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-17 00:53:59 +0100
commita8a5562df0358b314197f3685fc7622ecfd307d0 (patch)
tree02cdd70b6b0f999dd2a2eab7bf8018da03ffdd9f /Tests
parent61d1d07d37a5cc9d6ae1c4fcc333ec8ae644aca3 (diff)
splitted measure with fault checking, changing default template sizing to 0, lots of bugs.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/GOLIBTests.cs10
-rwxr-xr-xTests/Interfaces/TmpExpandable.goml14
-rwxr-xr-xTests/Interfaces/testAll.goml6
-rwxr-xr-xTests/Interfaces/testCheckbox.goml35
-rwxr-xr-xTests/Interfaces/testColorList.crow10
-rwxr-xr-xTests/Interfaces/testDirViewer.goml10
-rwxr-xr-xTests/Interfaces/testExpandable.goml2
-rwxr-xr-xTests/Interfaces/testRadioButton2.goml4
-rw-r--r--Tests/Interfaces/testTabView.crow62
-rwxr-xr-xTests/Interfaces/testWindow2.goml12
-rwxr-xr-xTests/Interfaces/testWindow3.goml2
-rwxr-xr-xTests/Interfaces/test_Listbox.goml10
12 files changed, 110 insertions, 67 deletions
diff --git a/Tests/GOLIBTests.cs b/Tests/GOLIBTests.cs
index c508c0e1..3d6e619f 100644
--- a/Tests/GOLIBTests.cs
+++ b/Tests/GOLIBTests.cs
@@ -37,6 +37,7 @@ namespace test
int frameCpt = 0;
int idx = 0;
string[] testFiles = {
+ "testCheckbox.goml",
"testTabView.crow",
"testExpandable.goml",
"0.crow",
@@ -73,7 +74,6 @@ namespace test
"testWindow2.goml",
"testWindow3.goml",
- "testCheckbox.goml",
"testLabel.goml",
"testAll.goml",
// "testSpinner.goml",
@@ -239,7 +239,13 @@ namespace test
{
Console.WriteLine ("button clicked:" + send.ToString());
}
-
+ void onAddTabButClick(object sender, MouseButtonEventArgs e){
+
+ TabView tv = this.FindByName("tabview1") as TabView;
+ if (tv == null)
+ return;
+ tv.AddChild (new TabItem () { Caption = "NewTab" });
+ }
[STAThread]
static void Main ()
{
diff --git a/Tests/Interfaces/TmpExpandable.goml b/Tests/Interfaces/TmpExpandable.goml
index ee0884ff..1cd05fd7 100755
--- a/Tests/Interfaces/TmpExpandable.goml
+++ b/Tests/Interfaces/TmpExpandable.goml
@@ -1,12 +1,12 @@
<?xml version="1.0"?>
-<!--<VerticalStack Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" MouseClick="../onMouseClick">
- <Label Text="{../../Caption}" Width="{../../TemplatedWidth}"/>
- <Container Name="Content" Visible="false" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}"/>
+<!--<VerticalStack Height="{../HeightPolicy}" Width="{../WidthPolicy}" MouseClick="../onMouseClick">
+ <Label Text="{../../Caption}" Width="{../../WidthPolicy}"/>
+ <Container Name="Content" Visible="false" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}"/>
</VerticalStack>-->
-<Group BorderWidth="1" Foreground="LightGray" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}"
+<Group BorderWidth="1" Foreground="LightGray" Height="{../HeightPolicy}" Width="{../WidthPolicy}"
MouseClick="../onMouseClick">
- <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
- <Label Text="{../../../Caption}" Width="{../../../TemplatedWidth}"/>
- <Container Name="Content" Visible="false" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>
+ <VerticalStack Height="{../../HeightPolicy}" Width="{../../WidthPolicy}">
+ <Label Text="{../../../Caption}" Width="{../../../WidthPolicy}"/>
+ <Container Name="Content" Visible="false" Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"/>
</VerticalStack>
</Group> \ No newline at end of file
diff --git a/Tests/Interfaces/testAll.goml b/Tests/Interfaces/testAll.goml
index 1959bf4a..6f5be081 100755
--- a/Tests/Interfaces/testAll.goml
+++ b/Tests/Interfaces/testAll.goml
@@ -14,11 +14,11 @@
</Groupbox>-->
<GroupBox Background="DarkGreen">
<!-- <Template>
- <Group Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
+ <Group Height="{../HeightPolicy}" Width="{../WidthPolicy}">
<Border CornerRadius="5" BorderWidth="1" Margin="0"
- Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
+ Height="{../../HeightPolicy}" Width="{../../WidthPolicy}">
<Container Name="Content" Margin="0"
- Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>
+ Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"/>
</Border>
<Label Text="{../../Title}" VerticalAlignment="Top" Left="15"
Background="Clear" Margin="1"/>
diff --git a/Tests/Interfaces/testCheckbox.goml b/Tests/Interfaces/testCheckbox.goml
index a8cc4eea..4db4393b 100755
--- a/Tests/Interfaces/testCheckbox.goml
+++ b/Tests/Interfaces/testCheckbox.goml
@@ -1,3 +1,36 @@
<?xml version="1.0"?>
-<CheckBox Width="-1" Height="-1" Caption="Checkbox" Background="DimGray" IsChecked="true"/>
+<VerticalStack Fit="true" Margin="10" Background="DimGray" >
+<!-- <Label Text="label1" Width="0" Height="0"/>
+ <Label Text="label2" Width="0" Height="0"/>-->
+ <CheckBox Background="Gray"/>
+ <CheckBox Background="Gray"/>
+ <CheckBox Background="Gray"/>
+ <CheckBox Background="Gray"/>
+ <CheckBox Background="Gray"/>
+<!-- <CheckBox Background="Gray"/>-->
+<!-- <HorizontalStack Fit="true" Margin="5" Background="Green">
+ <Label Background="Red"/>
+ <Label Background="Red"/>
+ </HorizontalStack>-->
+ <DummyTemplate Fit="true"/>
+ <DummyTemplate/>
+ <DummyTemplate/>
+ <DummyTemplate/>
+ <DummyTemplate/>
+ <DummyTemplate/>
+ <DummyTemplate Height="-1"/>
+<!-- <Label Margin="5" Background="Red"/>
+ <Label Background="Red"/>
+ <Container Width="100" Height="50" Margin="5" Background="Green">
+ <Label Width="0" Height="0" Background="Red"/>
+ </Container>
+
+ <Container Fit="true" Margin="5" Background="Green">
+ <Label Background="Red" Height="5"/>
+ </Container>
+ <HorizontalStack Margin="5" Background="Red" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
+ <Label Background="Green"/>
+ <Label Background="Green"/>
+ </HorizontalStack>-->
+</VerticalStack>
diff --git a/Tests/Interfaces/testColorList.crow b/Tests/Interfaces/testColorList.crow
index fc5e023d..76bf8d6e 100755
--- a/Tests/Interfaces/testColorList.crow
+++ b/Tests/Interfaces/testColorList.crow
@@ -5,18 +5,18 @@
HorizontalAlignment="Center" Width="-1" Height="350" Margin="5"
ItemTemplate="#Tests.Interfaces.colorItem.crow">
<Template>
- <Border BorderWidth="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
- <HorizontalStack Margin="1" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}" >
- <Scroller Name="scroller1" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"
+ <Border BorderWidth="1" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
+ <HorizontalStack Margin="1" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}" >
+ <Scroller Name="scroller1" Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"
Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Value}"
ValueChanged="../../../_scroller_ValueChanged">
- <VerticalStack Width="{../../../../TemplatedWidth}" Height="-1" MinimumSize="100;100"
+ <VerticalStack Width="{../../../../WidthPolicy}" Height="-1" MinimumSize="100;100"
Name="List" Margin="0" VerticalAlignment="Top"
LayoutChanged="../../../../_list_LayoutChanged"/>
</Scroller>
<ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
- Width="14" Height="{../../../TemplatedHeight}" />
+ Width="14" Height="{../../../HeightPolicy}" />
</HorizontalStack>
</Border>
</Template>
diff --git a/Tests/Interfaces/testDirViewer.goml b/Tests/Interfaces/testDirViewer.goml
index 1e3ebd31..22787c3e 100755
--- a/Tests/Interfaces/testDirViewer.goml
+++ b/Tests/Interfaces/testDirViewer.goml
@@ -9,14 +9,14 @@
SelectedItemChanged="OnSelectedItemChanged"
ItemTemplate="Interfaces/tmpDirItem.goml" >
<Template>
- <Border BorderWidth="1" MinimumSize="20;20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
- <HorizontalStack Margin="1" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
- <Scroller Name="scroller1" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"
+ <Border BorderWidth="1" MinimumSize="20;20" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
+ <HorizontalStack Margin="1" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}">
+ <Scroller Name="scroller1" Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"
Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Scroll}">
- <VerticalStack Width="{../../../../TemplatedWidth}" Height="-1" Name="List" Margin="0" VerticalAlignment="Top"/>
+ <VerticalStack Width="{../../../../WidthPolicy}" Height="-1" Name="List" Margin="0" VerticalAlignment="Top"/>
</Scroller>
<Scrollbar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" MaximumScroll="{../scroller1.MaximumScroll}"
- Orientation="Vertical" Width="10" Height="{../../../TemplatedHeight}" />
+ Orientation="Vertical" Width="10" Height="{../../../HeightPolicy}" />
</HorizontalStack>
</Border>
</Template>
diff --git a/Tests/Interfaces/testExpandable.goml b/Tests/Interfaces/testExpandable.goml
index d46f4831..8c2787fb 100755
--- a/Tests/Interfaces/testExpandable.goml
+++ b/Tests/Interfaces/testExpandable.goml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<Expandable Caption="Test expandable" Background="DimGray">
- <VerticalStack Width="-1" Height="-1">
+ <VerticalStack Margin="5" Background="Green">
<CheckBox Name="chk1" Background="Red"/>
<CheckBox Name="chk2" IsChecked="true"/>
<CheckBox Name="chk3"/>
diff --git a/Tests/Interfaces/testRadioButton2.goml b/Tests/Interfaces/testRadioButton2.goml
index 1c97f16f..d32c46d0 100755
--- a/Tests/Interfaces/testRadioButton2.goml
+++ b/Tests/Interfaces/testRadioButton2.goml
@@ -5,9 +5,9 @@
<RadioButton Caption="Radio3"/>
<RadioButton Caption="Radio4">
<Template>
- <HorizontalStack Spacing="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
+ <HorizontalStack Spacing="1" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
<Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>
- <Label Text="{../../Caption}" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}"/>
+ <Label Text="{../../Caption}" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}"/>
</HorizontalStack>
</Template>
</RadioButton>
diff --git a/Tests/Interfaces/testTabView.crow b/Tests/Interfaces/testTabView.crow
index 953dd8c1..3a081597 100644
--- a/Tests/Interfaces/testTabView.crow
+++ b/Tests/Interfaces/testTabView.crow
@@ -1,34 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?>
<HorizontalStack Fit="true">
- <TabView Margin="20"
- Width="400" Height="200" Orientation="Horizontal" Spacing="20">
- <TabItem Name="TabItem1" Caption="tab item 1" Width="0" Height="0" Margin="0">
- <VerticalStack Fit="true">
- <CheckBox/>
- <CheckBox/>
- <CheckBox/>
- <CheckBox/>
- <Label Text="{fps}" HorizontalAlignment="Right" Foreground="Black" Background="Yellow"/>
- </VerticalStack>
- </TabItem>
- <TabItem Name="TabItem2" Caption="tab item 2" Width="0" Height="0" Margin="0" Background="Gray">
- <VerticalStack Fit="true">
- <RadioButton/>
- <RadioButton/>
- <RadioButton/>
- <RadioButton/>
- <Label Text="{fps}" HorizontalAlignment="Left" Background="LimeGreen"/>
- </VerticalStack>
- </TabItem>
- <TabItem Name="TabItem2" Caption="tab item 3" Width="0" Height="0" Margin="0" Background="Gray">
- <Container Margin="5" CornerRadius="2" Width="0" Height="0">
- <TextBox Margin="5" Width="0" Height="0" Multiline="true" TextAlignment="TopLeft"/>
- </Container>
- </TabItem>
- <TabItem Name="TabItem2" Caption="tab item 4" Width="0" Height="0" Margin="0" Background="Gray">
- <TextBox/>
- </TabItem>
- </TabView>
+ <VerticalStack Fit="true">
+ <TabView Name="tabview1"
+ Width="400" Height="200" Orientation="Horizontal" Spacing="20">
+ <TabItem Name="TabItem1" Caption="tab item 1" Margin="0">
+ <VerticalStack Fit="true">
+ <CheckBox/>
+ <CheckBox/>
+ <CheckBox/>
+ <CheckBox/>
+<!-- <Label Text="{fps}" HorizontalAlignment="Right" Foreground="Black" Background="Yellow"/>-->
+ </VerticalStack>
+ </TabItem>
+ <TabItem Name="TabItem2" Caption="tab item 2" Width="0" Height="0" Margin="0" Background="Gray">
+ <VerticalStack Fit="true">
+ <RadioButton/>
+ <RadioButton/>
+ <RadioButton/>
+ <RadioButton/>
+<!-- <Label Text="{fps}" HorizontalAlignment="Left" Background="LimeGreen"/>-->
+ </VerticalStack>
+ </TabItem>
+ <TabItem Name="TabItem2" Caption="tab item 3" Width="0" Height="0" Margin="0" Background="Gray">
+ <Container Margin="5" CornerRadius="2" Width="0" Height="0">
+ <TextBox Margin="5" Width="0" Height="0" Multiline="true" TextAlignment="TopLeft"/>
+ </Container>
+ </TabItem>
+ <TabItem Name="TabItem2" Caption="tab item 4" Width="0" Height="0" Margin="0" Background="Gray">
+ <TextBox/>
+ </TabItem>
+ </TabView>
+ <Button Background="vgradient|0:DimGray|1:Black" HorizontalAlignment="Right"
+ Caption="Add new tab" Width="-1" Height="30" MouseClick="onAddTabButClick"/>
+ </VerticalStack>
<TabView CacheEnabled="false" Width="200" Height="200" Orientation="Horizontal" Spacing="20" Margin="0">
<TabItem
Name="TabItem1" Caption="tab 1" Width="0" Height="0" Margin="0" Background="Gray">
diff --git a/Tests/Interfaces/testWindow2.goml b/Tests/Interfaces/testWindow2.goml
index 25ea8f30..20d5ba62 100755
--- a/Tests/Interfaces/testWindow2.goml
+++ b/Tests/Interfaces/testWindow2.goml
@@ -2,14 +2,14 @@
<Window Name="window1" Left="10" Top="10" Title="Test window" Width="200" Height="200" Background="0,5;0,5;0,5;0,8"
Focusable="True" CornerRadius="20" MinimumSize="100;100" MaximumSize="500;500">
<Template>
- <Border BorderWidth="1" Foreground="White" CornerRadius="20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
- <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
- <Border BorderWidth="1" Foreground="White" Width="{../../../TemplatedWidth}" Height="-1"
+ <Border BorderWidth="1" Foreground="White" CornerRadius="20" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
+ <VerticalStack Height="{../../HeightPolicy}" Width="{../../WidthPolicy}">
+ <Border BorderWidth="1" Foreground="White" Width="{../../../WidthPolicy}" Height="-1"
Background="0,1;0,5;1,0;0,5">
- <HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{../../../../TemplatedWidth}" Height="-1" >
+ <HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{../../../../WidthPolicy}" Height="-1" >
<GraphicObject Width="5"/>
<Image Margin="1" Width="12" Height="12" Path="{../../../../../Icon}"/>
- <Label Foreground="White" Width="{../../../../../TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{../../../../../Title}" />
+ <Label Foreground="White" Width="{../../../../../WidthPolicy}" Margin="1" TextAlignment="Center" Text="{../../../../../Title}" />
<Border CornerRadius="6" BorderWidth="1" Foreground="Transparent" Height="12" Width="12"
MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
<Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#Crow.Images.Icons.exit2.svg"
@@ -18,7 +18,7 @@
<GraphicObject Width="5"/>
</HorizontalStack>
</Border>
- <Container Name="Content" Height="{../../../../TemplatedHeight}" Width="{../../../../TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>
+ <Container Name="Content" Height="{../../../../HeightPolicy}" Width="{../../../../WidthPolicy}" Background="0,5;0,5;0,5;0,5"/>
</VerticalStack>
</Border>
</Template>
diff --git a/Tests/Interfaces/testWindow3.goml b/Tests/Interfaces/testWindow3.goml
index ffcf4625..1c150471 100755
--- a/Tests/Interfaces/testWindow3.goml
+++ b/Tests/Interfaces/testWindow3.goml
@@ -2,7 +2,7 @@
<Window Left="10" Top="10" Title="Test window" Width="200" Height="200" Background="0,5;0,5;0,5;0,8"
Focusable="True" CornerRadius="20" MinimumSize="100;100" MaximumSize="500;500">
<Template>
- <Container Margin="20" Name="Content" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>
+ <Container Margin="20" Name="Content" Height="{../HeightPolicy}" Width="{../WidthPolicy}" Background="0,5;0,5;0,5;0,5"/>
</Template>
<!-- <Group Background="Green">-->
<GraphicObject Height="50" Width="50" Background="Red" Margin="5"/>
diff --git a/Tests/Interfaces/test_Listbox.goml b/Tests/Interfaces/test_Listbox.goml
index 8c9eaa09..71afb828 100755
--- a/Tests/Interfaces/test_Listbox.goml
+++ b/Tests/Interfaces/test_Listbox.goml
@@ -8,16 +8,16 @@
<ListBox Data="{TestList}" Background="0,5;0,5;0,5;0,5"
HorizontalAlignment="Center" Width="-1" Height="150" Margin="5">
<Template>
- <Border BorderWidth="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
- <HorizontalStack Margin="1" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}" >
- <Scroller Name="scroller1" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"
+ <Border BorderWidth="1" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
+ <HorizontalStack Margin="1" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}" >
+ <Scroller Name="scroller1" Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"
Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Value}">
- <VerticalStack Width="{../../../../TemplatedWidth}" Height="-1" MinimumSize="100;100"
+ <VerticalStack Width="{../../../../WidthPolicy}" Height="-1" MinimumSize="100;100"
Name="List" Margin="0" VerticalAlignment="Top" />
</Scroller>
<ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
- Width="10" Height="{../../../TemplatedHeight}" />
+ Width="10" Height="{../../../HeightPolicy}" />
</HorizontalStack>
</Border>
</Template>