aboutsummaryrefslogtreecommitdiffstatsci
path: root/Tests
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-19 16:10:32 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-03-01 05:08:23 +0100
commit70bcdc77ff42c74fcd8e6e7dffd4eb6b16f24f39 (patch)
tree3aca61b2a64d3d01c396a75d239934d902da3405 /Tests
parent328c6d4eab1127cd9799540f253deda66060b68a (diff)
GtkCrowContainer test, functionnal, keyboard issue
Diffstat (limited to 'Tests')
-rw-r--r--Tests/GOLIBTests.cs65
-rwxr-xr-xTests/Interfaces/testCheckbox.goml15
-rw-r--r--Tests/Tests.csproj27
3 files changed, 68 insertions, 39 deletions
diff --git a/Tests/GOLIBTests.cs b/Tests/GOLIBTests.cs
index a0c8a84c..c3622ef4 100644
--- a/Tests/GOLIBTests.cs
+++ b/Tests/GOLIBTests.cs
@@ -30,7 +30,7 @@ namespace test
public GOLIBTests ()
: base(800, 600,"test: press spacebar to toogle test files")
{
- VSync = VSyncMode.Off;
+ //VSync = VSyncMode.Off;
}
int frameCpt = 0;
@@ -45,12 +45,20 @@ namespace test
"1.crow",
"5.crow",
"testCheckbox.goml",
+ "testWindow.goml",
+ "fps.goml",
"testTabView.crow",
"0.crow",
"testImage.crow",
"testOutOfClipUpdate.crow",
+<<<<<<< 328c6d4eab1127cd9799540f253deda66060b68a
"testTreeView.crow",
"testWindow.goml",
+=======
+// "test_Listbox.goml",
+// "testTreeView.crow",
+ "1.crow",
+>>>>>>> GtkCrowContainer test, functionnal, keyboard issue
"clip4.crow",
"clip3.crow",
"clip2.crow",
@@ -67,7 +75,6 @@ namespace test
"testBorder.goml",
// "testButton2.crow",
"test2WayBinding.crow",
- "fps.goml",
"test4.goml",
"2.crow",
"test1.goml",
@@ -188,12 +195,11 @@ namespace test
{
base.OnLoad (e);
//this.AddWidget(new test4());
- KeyboardKeyDown += GOLIBTests_KeyboardKeyDown1;;
+ //KeyboardKeyDown += GOLIBTests_KeyboardKeyDown1;;
GraphicObject obj = LoadInterface("Interfaces/" + testFiles[idx]);
obj.DataSource = this;
}
-
void GOLIBTests_KeyboardKeyDown1 (object sender, OpenTK.Input.KeyboardKeyEventArgs e)
{
if (e.Key == OpenTK.Input.Key.Escape) {
@@ -217,23 +223,23 @@ namespace test
obj.DataSource = this;
}
- protected override void OnUpdateFrame (FrameEventArgs e)
- {
- //if (frameCpt % 8 == 0)
- base.OnUpdateFrame (e);
-
- fps = (int)RenderFrequency;
-
-
- if (frameCpt > 50) {
- resetFps ();
- frameCpt = 0;
- GC.Collect();
- GC.WaitForPendingFinalizers();
- NotifyValueChanged("memory", GC.GetTotalMemory (false).ToString());
- }
- frameCpt++;
- }
+// protected override void OnUpdateFrame (FrameEventArgs e)
+// {
+// //if (frameCpt % 8 == 0)
+// base.OnUpdateFrame (e);
+//
+// fps = (int)RenderFrequency;
+//
+//
+// if (frameCpt > 50) {
+// resetFps ();
+// frameCpt = 0;
+// GC.Collect();
+// GC.WaitForPendingFinalizers();
+// NotifyValueChanged("memory", GC.GetTotalMemory (false).ToString());
+// }
+// frameCpt++;
+// }
void onButClick(object send, MouseButtonEventArgs e)
{
Console.WriteLine ("button clicked:" + send.ToString());
@@ -249,10 +255,11 @@ namespace test
static void Main ()
{
Console.WriteLine ("starting example");
+ Gtk.Application.Init ();
+ GOLIBTests win = new GOLIBTests ();
+ win.KeyPressEvent += win.Win_KeyPressEvent;
- using (GOLIBTests win = new GOLIBTests( )) {
- win.Run (30.0);
- }
+ Gtk.Application.Run ();
}
void onMsgBoxOk(object sender, EventArgs e){
Debug.WriteLine ("OK");
@@ -261,5 +268,15 @@ namespace test
{
Debug.WriteLine ("cancel");
}
+ void Win_KeyPressEvent (object o, Gtk.KeyPressEventArgs args)
+ {
+ ClearInterface ();
+ idx++;
+ if (idx == testFiles.Length)
+ idx = 0;
+ this.Title = testFiles [idx];
+ GraphicObject obj = LoadInterface("Interfaces/" + testFiles[idx]);
+ obj.DataSource = this;
+ }
}
}
diff --git a/Tests/Interfaces/testCheckbox.goml b/Tests/Interfaces/testCheckbox.goml
index f1af1b39..ddde673d 100755
--- a/Tests/Interfaces/testCheckbox.goml
+++ b/Tests/Interfaces/testCheckbox.goml
@@ -1,9 +1,12 @@
<?xml version="1.0"?>
-<VerticalStack Margin="10" Background="DimGray" Style="test">
- <CheckBox IsChecked="true"/>
- <CheckBox Background="Gray"/>
-<!-- <CheckBox Background="Gray"/>
- <CheckBox Background="Gray"/>
- <CheckBox Background="Gray"/>-->
+<VerticalStack Fit="true" Margin="100" Background="DimGray" >
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
</VerticalStack>
diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj
index d913c6ee..ec90518c 100644
--- a/Tests/Tests.csproj
+++ b/Tests/Tests.csproj
@@ -44,13 +44,23 @@
<Reference Include="OpenTK">
<HintPath>..\..\opentk\Binaries\OpenTK\Release\OpenTK.dll</HintPath>
</Reference>
- <Reference Include="Mono.Cairo" />
+ <Reference Include="cairo-sharp, Version=1.10.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756">
+ <Package>gtk-sharp-3.0</Package>
+ </Reference>
+ <Reference Include="gio-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+ <Package>gio-sharp-3.0</Package>
+ </Reference>
+ <Reference Include="glib-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+ <Package>glib-sharp-3.0</Package>
+ </Reference>
+ <Reference Include="gtk-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+ <Package>gtk-sharp-3.0</Package>
+ </Reference>
+ <Reference Include="atk-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+ <Package>gtk-sharp-3.0</Package>
+ </Reference>
</ItemGroup>
<ItemGroup>
- <Compile Include="GOLIBTest_Listbox.cs" />
- <Compile Include="GOLIBTest_0.cs" />
- <Compile Include="GOLIBTest_TypeViewer.cs" />
- <Compile Include="GOLIBTest_DirViewer.cs" />
<Compile Include="GOLIBTests.cs" />
<Compile Include="Interfaces\testBorder.goml.cs" />
<Compile Include="..\bin\Debug\Interfaces\testContainer.goml.cs">
@@ -203,7 +213,6 @@
<None Include="Interfaces\testTextBox.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="GOLIBTest_5.cs" />
<None Include="Interfaces\0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -269,9 +278,9 @@
<Project>{C2980F9B-4798-4C05-99E2-E174810F7C7B}</Project>
<Name>Crow</Name>
</ProjectReference>
- <ProjectReference Include="..\OTKCrow\OTKCrow.csproj">
- <Project>{350D4F49-9901-4998-9903-BCA7D48DA58C}</Project>
- <Name>OTKCrow</Name>
+ <ProjectReference Include="..\GtkCrow\GtkCrow.csproj">
+ <Project>{D6F98B08-56B8-405C-9212-F9D26097E35F}</Project>
+ <Name>GtkCrow</Name>
</ProjectReference>
</ItemGroup>
</Project>