aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-08-03 11:23:09 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2016-08-03 11:23:09 +0200
commitad004bcd3a03e0002f9ce2aae5f3f1da941e9a5a (patch)
treef4199cc40b73260916660419a74e0b35909304bf
parentc601f875010332cb4189a206a2c5ffa5fd6e8bea (diff)
update tests
-rw-r--r--Templates/TreeView.crow4
-rw-r--r--Tests/BasicTests.cs4
-rw-r--r--Tests/GOLIBTest_DirViewer.cs10
-rwxr-xr-xTests/Interfaces/Unsorted/0.crow4
-rwxr-xr-xTests/Interfaces/Unsorted/test4.1.crow98
-rwxr-xr-xTests/Interfaces/Unsorted/test6.crow2
-rwxr-xr-xTests/Interfaces/Unsorted/testDirViewer.crow4
-rwxr-xr-xTests/Interfaces/Unsorted/testImage.crow8
-rwxr-xr-xTests/Interfaces/Unsorted/testLabel.crow6
-rwxr-xr-xTests/Interfaces/Unsorted/testMsgBox.crow6
-rwxr-xr-xTests/Interfaces/Unsorted/testOutOfClipUpdate.crow2
-rwxr-xr-xTests/Interfaces/Unsorted/testRadioButton2.crow15
-rwxr-xr-xTests/Interfaces/Unsorted/testTreeView.crow2
-rw-r--r--Tests/Tests.csproj12
-rw-r--r--Tests/UIEditor.cs59
15 files changed, 83 insertions, 153 deletions
diff --git a/Templates/TreeView.crow b/Templates/TreeView.crow
index 32e3db21..82d2c3e9 100644
--- a/Templates/TreeView.crow
+++ b/Templates/TreeView.crow
@@ -1,7 +1,7 @@
<Border Background="DimGray" BorderWidth="1" Margin="1" MinimumSize="100,100"
Width="{../WidthPolicy}" Height="{../HeightPolicy}">
- <VerticalStack
- Height="0" Width="0" Name="List" Margin="0" VerticalAlignment="Top"/>
+ <VerticalStack Width="{../WidthPolicy}" Height="{../HeightPolicy}"
+ Name="List" Margin="0" VerticalAlignment="Top"/>
</Border>
diff --git a/Tests/BasicTests.cs b/Tests/BasicTests.cs
index e75ed01d..0733f189 100644
--- a/Tests/BasicTests.cs
+++ b/Tests/BasicTests.cs
@@ -79,7 +79,6 @@ namespace Tests
this.KeyDown += KeyboardKeyDown1;
testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Unsorted", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
//testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/basicTests", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
@@ -88,6 +87,7 @@ namespace Tests
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Expandable", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray ();
+ testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Unsorted", "*.crow")).ToArray ();
this.Title = testFiles [idx] + ". Press <F3> to switch example.";
CrowInterface.LoadInterface(testFiles[idx]).DataSource = this;
@@ -143,4 +143,4 @@ namespace Tests
win.Run (30);
}
}
-} \ No newline at end of file
+}
diff --git a/Tests/GOLIBTest_DirViewer.cs b/Tests/GOLIBTest_DirViewer.cs
index 04e46aa4..f17afb9b 100644
--- a/Tests/GOLIBTest_DirViewer.cs
+++ b/Tests/GOLIBTest_DirViewer.cs
@@ -19,16 +19,8 @@ using System.Collections.Generic;
namespace test2
{
- class GOLIBTest_DirViewer : OpenTKGameWindow, IValueChange
+ class GOLIBTest_DirViewer : OpenTKGameWindow
{
- #region IValueChange implementation
- public event EventHandler<ValueChangeEventArgs> ValueChanged;
- public void NotifyValueChanged(string name, object value)
- {
- ValueChanged.Raise (this, new ValueChangeEventArgs (name, value));
- }
- #endregion
-
public GOLIBTest_DirViewer ()
: base(1024, 600,"test")
{}
diff --git a/Tests/Interfaces/Unsorted/0.crow b/Tests/Interfaces/Unsorted/0.crow
new file mode 100755
index 00000000..4e9fb7f4
--- /dev/null
+++ b/Tests/Interfaces/Unsorted/0.crow
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<Container>
+<Button Caption="m" />
+</Container> \ No newline at end of file
diff --git a/Tests/Interfaces/Unsorted/test4.1.crow b/Tests/Interfaces/Unsorted/test4.1.crow
deleted file mode 100755
index 2ac55cd0..00000000
--- a/Tests/Interfaces/Unsorted/test4.1.crow
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0"?>
-<Group Name="MainGrp"
- Width="800" Height="500"
- Background="0.5,0.5,0.5,0.5" Foreground="White"
- Margin="10" >
- <Border
- BorderWidth="2" Foreground="Transparent"
- Focusable="True"
- MouseEnter="{Foreground = White}"
- MouseLeave="{Foreground = Transparent}">
-
- <HorizontalStack Name="hs0" Fit="true"
- WidgetSpacing="10"
- VerticalAlignment="Center"
- Background="0.5,0.5,0.5,0.5">
- <VerticalStack Name="vs1"
- Margin="20" Width="400" Height="Fit">
- <Label Name="labMouse" Text="MousePos"/>
- <HorizontalStack Name="hsPbar" Fit="true">
- <ProgressBar Name="pbBar"
- Width="100" Height="20"
- Value="50"
- Foreground="BlueCrayola" Background="DarkGray"
- BorderWidth="2" Foreground="White"/>
-<!-- <Label Name="labPb"
- Width="20"
- TextAlignment="Right"/>
- <ProgressBar Name="pbBar"
- Width="100" Height="10"
- Value="30"/>-->
- </HorizontalStack>
- <HorizontalStack Name="hsFocus" Fit="true">
- <Label Text="Focused:"/>
- <Label Name="labFocus" />
- </HorizontalStack>
- <HorizontalStack Fit="true">
- <Label Text="Active:" Name="hsActive"/>
- <Label Name="labActive"/>
- </HorizontalStack>
- <HorizontalStack Fit="true">
- <Label Text="Hover:" Name="hsHover"/>
- <Label Name="labHover" />
- </HorizontalStack>
- <Button Margin="5" BorderWidth="0" Background="Gray" Width="Fit" Height="Fit">
- <Label FontSize="10" Text="This is a test" Margin="5" FontColor="White" Foreground="White" />
- </Button>
- <TextBoxWidget TextAlignment="Left" Font="droid,14"
- Width="300" Height="Fit" Margin="2"
- Foreground="White" BorderWidth="1"
- Text="editable text"/>
- <GroupBox Title="Group Box" Width="300" Height="100"
- Foreground="White" BorderWidth="2" Margin="3">
- <Label Name="labValue" FontSize="14" Text="000" TextAlignment="Center"/>
- </GroupBox>
- <Slider Height="10" Width="300" BorderWidth="1" Background="Transparent" />
- <GraduatedSlider Name="slider" Height="30" Width="300" Foreground="BlueBell"/>
- </VerticalStack>
-<!-- <VerticalStack Width="Fit" Height="Fit" BorderWidth="1" Margin="5" WidgetSpacing="4">
- <Button Width="Fit" Height="Fit" Margin="15">
- <Image Path="/mnt/data/Images/130px-Blason_ville_fr_Aubure_(Haut-Rhin).svg.png"/>
- </Button>
- <HorizontalStack>
- <Label Text="Update" FontColor="White" VerticalAlignment="Center" />
- <Label Name="labUpdate" Text="xxxx" FontSize="16" Width="60" TextAlignment="Center" Background="DarkGreen"/>
- </HorizontalStack>
- <HorizontalStack>
- <Label Text="Fps:" Width = "30" VerticalAlignment="Center" TextAlignment="Left"/>
- <Label Name="labFps" Text="xxxx" Font="droid bold, 14"
- TextAlignment="Center" Background="AoEnglish"/>
- </HorizontalStack>
- <HorizontalStack>
- <Label Text="Min:" Width = "30" />
- <Label Name="labFpsMin" Text="xxxx" Font="droid bold, 14"
- TextAlignment="Center" Background="AoEnglish"/>
- </HorizontalStack>
- <HorizontalStack>
- <Label Text="Max:" Width = "30"/>
- <Label Name="labFpsMax" Text="xxxx" Font="droid bold, 14"
- TextAlignment="Center" Background="AoEnglish"/>
- </HorizontalStack>
- </VerticalStack>
-
- <Scroller Background="DimGray" Height="350" Width="300"
- Margin="5" VerticalScrolling="true">
- <VerticalStack Name="colors" VerticalAlignment="Top" Margin="5">
- <ProgressBar Name="pbBar2" Width="100" Height="20" Value="50"
- BorderWidth="2" Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/>
- </VerticalStack>
- </Scroller>-->
-
- </HorizontalStack>
-
- <Slider
- Height="20" Width="300"
- Background="Transparent"
- VerticalAlignment="Bottom" />
- </Border>
-</Group> \ No newline at end of file
diff --git a/Tests/Interfaces/Unsorted/test6.crow b/Tests/Interfaces/Unsorted/test6.crow
index 532450da..aa1f33e8 100755
--- a/Tests/Interfaces/Unsorted/test6.crow
+++ b/Tests/Interfaces/Unsorted/test6.crow
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Border BorderWidth="1" Foreground="White" CornerRadius="10" Width="500" Height="300">
<VerticalStack Height="Stretched" Background="0.4,0.4,0.4,0.4">
- <Border BorderWidth="1" Foreground="White" Height="20" Background="0.1,0.5;1,0,0.5">
+ <Border BorderWidth="1" Foreground="White" Height="20" Background="0.1,0.5,1,0,0.5">
<HorizontalStack Name="hs" Margin="1" Spacing="1" Height="Fit" >
<GraphicObject Width="5"/>
<Image Name="Image" Margin="1" Width="12" Height="12" Path="#go.Images.Icons.tetra.png"/>
diff --git a/Tests/Interfaces/Unsorted/testDirViewer.crow b/Tests/Interfaces/Unsorted/testDirViewer.crow
index dd6f9b8a..af170947 100755
--- a/Tests/Interfaces/Unsorted/testDirViewer.crow
+++ b/Tests/Interfaces/Unsorted/testDirViewer.crow
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
- <VerticalStack Height="Fit" Width="Fit" Name="hstack" Margin="0" Spacing="Stretched">
+ <VerticalStack Height="Fit" Width="Fit" Name="hstack" Margin="0" Spacing="0">
<Border Height="Fit" Width="200" BorderWidth="2" CornerRadius="10">
<Label Name="labName" Text="{Name}" Width="Stretched" Height="Fit"/>
</Border>
@@ -15,7 +15,7 @@
Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Scroll}">
<VerticalStack Width="{../../../../WidthPolicy}" Height="Fit" Name="List" Margin="0" VerticalAlignment="Top"/>
</Scroller>
- <Scrollbar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" MaximumScroll="{../scroller1.MaximumScroll}"
+ <ScrollBar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" MaximumScroll="{../scroller1.MaximumScroll}"
Orientation="Vertical" Width="10" Height="{../../../HeightPolicy}" />
</HorizontalStack>
</Border>
diff --git a/Tests/Interfaces/Unsorted/testImage.crow b/Tests/Interfaces/Unsorted/testImage.crow
index 46ffdcb6..cfa0f113 100755
--- a/Tests/Interfaces/Unsorted/testImage.crow
+++ b/Tests/Interfaces/Unsorted/testImage.crow
@@ -3,7 +3,7 @@
<HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" Margin="5">
<Label Text="SCALED PROPORTIONNAL" Width="150"/>
<Image Width="50%" Height="Fit" Background="vgradient|0:SkyBlue|1:White" Path="#Tests.image.crow0.svg"/>
-<!-- <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Path="#Tests.image.crow0.svg" />
+ <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Path="#Tests.image.crow0.svg" />
<Image Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Tests.image.crow0.svg" />
<Image Margin="2" Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Tests.image.crow0.svg" />
<Image Background="vgradient|0:SkyBlue|1:White" Width="50" Height="100" Path="#Tests.image.crow0.svg" />
@@ -11,9 +11,9 @@
<Image Background="vgradient|0:SkyBlue|1:White" Width="100" Height="50" Path="#Tests.image.crow0.svg" />
<Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="100" Height="50" Path="#Tests.image.crow0.svg" />
<Image Background="vgradient|0:SkyBlue|1:White" Width="50" Height="Fit" Path="#Tests.image.crow0.svg" />
- <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="50" Height="Fit" Path="#Tests.image.crow0.svg" />-->
+ <Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Width="50" Height="Fit" Path="#Tests.image.crow0.svg" />
</HorizontalStack>
-<!-- <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" Margin="5">
+ <HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" Margin="5">
<Label Text="SCALED NOT PROPORTIONNAL" Width="150"/>
<Image KeepProportions="false" Background="vgradient|0:SkyBlue|1:White" Path="#Tests.image.crow0.svg" />
<Image KeepProportions="false" Margin="10" Background="vgradient|0:SkyBlue|1:White" Path="#Tests.image.crow0.svg" />
@@ -83,5 +83,5 @@
<Image Margin="10" Background="White" Path="#Tests.image.crow0.svg" />
<Image Background="White" Width="20" Height="10" Path="#Tests.image.crow0.svg" />
<Image Margin="1" Background="White" Width="20" Height="10" Path="#Tests.image.crow0.svg" />
- </HorizontalStack>-->
+ </HorizontalStack>
</VerticalStack> \ No newline at end of file
diff --git a/Tests/Interfaces/Unsorted/testLabel.crow b/Tests/Interfaces/Unsorted/testLabel.crow
deleted file mode 100755
index 51cf97b6..00000000
--- a/Tests/Interfaces/Unsorted/testLabel.crow
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?>
-<VerticalStack>
- <TextRun Multiline="true" WordWrap="true" Width="Stretched" Height="100" Background="DimGray"
- Text="This is a long text to test text wrapping, and so here is another statement to add to this meaningless text only designed to make a small test" />
- <Label Name="labFps" Text="{fps}" Font="droid bold, 12" TextAlignment="Center" Background="AoEnglish" />
-</VerticalStack> \ No newline at end of file
diff --git a/Tests/Interfaces/Unsorted/testMsgBox.crow b/Tests/Interfaces/Unsorted/testMsgBox.crow
index 680f43b4..95366377 100755
--- a/Tests/Interfaces/Unsorted/testMsgBox.crow
+++ b/Tests/Interfaces/Unsorted/testMsgBox.crow
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
-<MessageBox Title="message" Message="this is a message box"
- Ok="onMsgBoxOk"
- Cancel="onMsgBoxCancel"/> \ No newline at end of file
+<MessageBox Title="message" Message="this is a message box"/>
+<!-- Ok="onMsgBoxOk"
+ Cancel="onMsgBoxCancel"/>--> \ No newline at end of file
diff --git a/Tests/Interfaces/Unsorted/testOutOfClipUpdate.crow b/Tests/Interfaces/Unsorted/testOutOfClipUpdate.crow
index b5e29f4e..5e4e4177 100755
--- a/Tests/Interfaces/Unsorted/testOutOfClipUpdate.crow
+++ b/Tests/Interfaces/Unsorted/testOutOfClipUpdate.crow
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<Container Width="200" Height="100" Background="DimGray" Margin="5">
- <Container Width="Stretched" Height="300" Background="DarkBlue">
+ <Container Width="Stretched" Height="800" Background="DarkBlue">
<Label Text="{fps}" Background="BlueCrayola" VerticalAlignment="Center"/>
</Container>
</Container>
diff --git a/Tests/Interfaces/Unsorted/testRadioButton2.crow b/Tests/Interfaces/Unsorted/testRadioButton2.crow
deleted file mode 100755
index 02231d25..00000000
--- a/Tests/Interfaces/Unsorted/testRadioButton2.crow
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0"?>
-<VerticalStack Width="200" Height="Fit" Margin="20" Background="DimGray">
- <RadioButton Caption="Radio1"/>
- <RadioButton Caption="Radio2" IsChecked="true"/>
- <RadioButton Caption="Radio3"/>
- <RadioButton Caption="Radio4">
- <Template>
- <HorizontalStack Spacing="1" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
- <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>
- <Label Text="{../../Caption}" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}"/>
- </HorizontalStack>
- </Template>
- </RadioButton>
-</VerticalStack>
-
diff --git a/Tests/Interfaces/Unsorted/testTreeView.crow b/Tests/Interfaces/Unsorted/testTreeView.crow
index 86bcae88..9504c958 100755
--- a/Tests/Interfaces/Unsorted/testTreeView.crow
+++ b/Tests/Interfaces/Unsorted/testTreeView.crow
@@ -1,2 +1,2 @@
<?xml version="1.0"?>
-<TreeView Height="400" Width="200" Data="{List2}" ItemTemplate="#Crow.Templates.TreeViewItem.crow"/> \ No newline at end of file
+<TreeView Height="400" Width="200" Data="{List2}" ItemTemplate="#Crow.Templates.TreeItem.crow"/> \ No newline at end of file
diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj
index 61868849..03b2b281 100644
--- a/Tests/Tests.csproj
+++ b/Tests/Tests.csproj
@@ -52,7 +52,6 @@
</Reference>
<Reference Include="glib-sharp">
<HintPath>$(SolutionDir)packages\GtkSharp.3.1.3\lib\net45\glib-sharp.dll</HintPath>
- <Package>glib-sharp-3.0</Package>
</Reference>
<Reference Include="OpenTK">
<HintPath>$(SolutionDir)packages\OpenTK.Next.1.2.2336.6514-pre\lib\net20\OpenTK.dll</HintPath>
@@ -69,6 +68,7 @@
<Compile Include="OpenGL\Texture.cs" />
<Compile Include="HelloWorld.cs" />
<Compile Include="HelloCube.cs" />
+ <Compile Include="UIEditor.cs" />
</ItemGroup>
<ItemGroup>
<None Include="image\u.svg">
@@ -323,9 +323,6 @@
<None Include="Interfaces\Unsorted\test6.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Unsorted\test4.1.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="Interfaces\Unsorted\testMsgBox.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -347,13 +344,10 @@
<None Include="Interfaces\Unsorted\testTypeViewer.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Unsorted\testLabel.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="Interfaces\Unsorted\testRadioButton2.crow">
+ <None Include="Interfaces\Unsorted\testTreeView.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Unsorted\testTreeView.crow">
+ <None Include="Interfaces\Unsorted\0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
diff --git a/Tests/UIEditor.cs b/Tests/UIEditor.cs
new file mode 100644
index 00000000..b08584d4
--- /dev/null
+++ b/Tests/UIEditor.cs
@@ -0,0 +1,59 @@
+//
+// HelloCube.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
+//
+// Copyright (c) 2016 jp
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+using System;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using Crow;
+
+namespace Tests
+{
+ class UIEditor : OpenTKGameWindow
+ {
+ [STAThread]
+ static void Main ()
+ {
+ UIEditor win = new UIEditor ();
+ win.Run (30);
+ }
+
+ public UIEditor ()
+ : base(800, 600,"UIEditor")
+ {
+ }
+
+ protected override void OnLoad (EventArgs e)
+ {
+ base.OnLoad (e);
+
+ CrowInterface.AddWidget(
+ new Window ()
+ {
+ Title = "Hello World"
+ }
+ );
+ }
+ public override void OnRender (FrameEventArgs e)
+ {
+ base.OnRender (e);
+ }
+ }
+} \ No newline at end of file