]> O.S.I.I.S - jp/crow.git/commitdiff
update tests
authorjpbruyere <jp.bruyere@hotmail.com>
Wed, 3 Aug 2016 09:23:09 +0000 (11:23 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Wed, 3 Aug 2016 09:23:09 +0000 (11:23 +0200)
15 files changed:
Templates/TreeView.crow
Tests/BasicTests.cs
Tests/GOLIBTest_DirViewer.cs
Tests/Interfaces/Unsorted/0.crow [new file with mode: 0755]
Tests/Interfaces/Unsorted/test4.1.crow [deleted file]
Tests/Interfaces/Unsorted/test6.crow
Tests/Interfaces/Unsorted/testDirViewer.crow
Tests/Interfaces/Unsorted/testImage.crow
Tests/Interfaces/Unsorted/testLabel.crow [deleted file]
Tests/Interfaces/Unsorted/testMsgBox.crow
Tests/Interfaces/Unsorted/testOutOfClipUpdate.crow
Tests/Interfaces/Unsorted/testRadioButton2.crow [deleted file]
Tests/Interfaces/Unsorted/testTreeView.crow
Tests/Tests.csproj
Tests/UIEditor.cs [new file with mode: 0644]

index 32e3db2189ee9be062fdfb9b5a4b6d8483eaa6fe..82d2c3e9da92e9946d3dd464646819981b6ff7d8 100644 (file)
@@ -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>
 
index e75ed01d514a1ce001a86a6582ffcbb0e635fc90..0733f1893cb3e8046020e697151b3f30e3be55f5 100644 (file)
@@ -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
+}
index 04e46aa49063416d7e6991a74529c12f3f6fc32d..f17afb9b73714546916cf67b12a5cc149ebf2b40 100644 (file)
@@ -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 (executable)
index 0000000..4e9fb7f
--- /dev/null
@@ -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 (executable)
index 2ac55cd..0000000
+++ /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
index 532450da538479a1f1e0fe2b8a734a36d7035d9a..aa1f33e805e7bb962463f2aa9e1cd97b2bc5c1da 100755 (executable)
@@ -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"/>
index dd6f9b8a021a44d340bee6eaa29903574b6c0cdc..af170947ffd22a7bb6209b795da4dcea10c180a3 100755 (executable)
@@ -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>
index 46ffdcb6406f4f9f1cb6b8530f38087f913ab375..cfa0f113f65d4dbcb6d482d786721f344a9d7c37 100755 (executable)
@@ -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 (executable)
index 51cf97b..0000000
+++ /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
index 680f43b4bade0e103e8f2433e936c02814cb811b..953663775cbb4e998513d240d64689455c84ac80 100755 (executable)
@@ -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
index b5e29f4e6e92fad2f3435e8431d9e7f3b3db2d2e..5e4e4177ce16047e34647ffc78b9c836b464d5a6 100755 (executable)
@@ -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 (executable)
index 02231d2..0000000
+++ /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>
-
index 86bcae88460161259ef1164620753a2545bec154..9504c958b2ff8877d90b88a20bede8a46689ab20 100755 (executable)
@@ -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
index 61868849fae3adaf43dc2b2e10dbdbea2fd46526..03b2b28124014d40d4444fee30b3a30b8081fa00 100644 (file)
@@ -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">
     <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>
     <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 (file)
index 0000000..b08584d
--- /dev/null
@@ -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