aboutsummaryrefslogtreecommitdiffstatsci
path: root/Tests
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2015-06-02 12:28:36 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2015-06-02 12:28:36 +0200
commitc54c8b8e7e369dbba890efdb35a015740d1d95ea (patch)
treef2b7ed73e93c4170e22e3713d4c66e02eeb40d76 /Tests
parentb56c22ad826a49b7ea0013c1ca78cf64169fc326 (diff)
listbox update
Diffstat (limited to 'Tests')
-rw-r--r--Tests/GOLIBTest_4.cs10
-rw-r--r--Tests/GOLIBTest_Listbox.cs97
-rwxr-xr-xTests/Interfaces/test_Listbox.goml3
-rw-r--r--Tests/Tests.csproj11
4 files changed, 111 insertions, 10 deletions
diff --git a/Tests/GOLIBTest_4.cs b/Tests/GOLIBTest_4.cs
index 9b189a92..096d249e 100644
--- a/Tests/GOLIBTest_4.cs
+++ b/Tests/GOLIBTest_4.cs
@@ -17,15 +17,7 @@ using System.Collections.Generic;
namespace test
{
- public class ClsItem
- {
- public string Field;
- public ClsItem(){
- }
- public ClsItem(string str){
- Field = str;
- }
- }
+
class GOLIBTest_4 : OpenTKGameWindow, IValueChange
{
#region IValueChange implementation
diff --git a/Tests/GOLIBTest_Listbox.cs b/Tests/GOLIBTest_Listbox.cs
new file mode 100644
index 00000000..cd7cd83a
--- /dev/null
+++ b/Tests/GOLIBTest_Listbox.cs
@@ -0,0 +1,97 @@
+#define MONO_CAIRO_DEBUG_DISPOSE
+
+
+using System;
+using System.Runtime.InteropServices;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using OpenTK.Input;
+
+using System.Diagnostics;
+
+//using GGL;
+using go;
+using System.Threading;
+using System.Collections.Generic;
+
+
+namespace test
+{
+ public class ClsItem : IValueChange
+ {
+ #region IValueChange implementation
+
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+
+ #endregion
+
+ public string field;
+
+ public string Field {
+ get {
+ return field;
+ }
+ set {
+ field = value;
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("Field", null, field));
+ }
+ }
+
+ public ClsItem(){
+ }
+ public ClsItem(string str){
+ Field = str;
+ }
+ }
+
+ class GOLIBTest_Listbox : OpenTKGameWindow, IValueChange
+ {
+ #region IValueChange implementation
+
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+
+ #endregion
+
+ public GOLIBTest_Listbox ()
+ : base(1024, 600,"test")
+ {}
+
+ public List<ClsItem> TestList = new List<ClsItem>(new ClsItem[]
+ {
+ new ClsItem("string 1"),
+ new ClsItem("string 2"),
+ new ClsItem("string 3")
+ });
+ ListBox g;
+
+ protected override void OnLoad (EventArgs e)
+ {
+ base.OnLoad (e);
+ LoadInterface("Interfaces/test_Listbox.goml", out g);
+
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", null, TestList));
+ TestList [1].Field = "test string";
+ }
+ protected override void OnRenderFrame (FrameEventArgs e)
+ {
+ GL.Clear (ClearBufferMask.ColorBufferBit);
+ base.OnRenderFrame (e);
+ SwapBuffers ();
+ }
+
+ protected override void OnUpdateFrame (FrameEventArgs e)
+ {
+ base.OnUpdateFrame (e);
+ }
+
+ [STAThread]
+ static void Main ()
+ {
+ Console.WriteLine ("starting example");
+
+ using (GOLIBTest_Listbox win = new GOLIBTest_Listbox( )) {
+ win.Run (30.0);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/Tests/Interfaces/test_Listbox.goml b/Tests/Interfaces/test_Listbox.goml
new file mode 100755
index 00000000..d336ae3c
--- /dev/null
+++ b/Tests/Interfaces/test_Listbox.goml
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+ <ListBox Data="{TestList}">
+ </ListBox>
diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj
index 2efca8ef..d19fb844 100644
--- a/Tests/Tests.csproj
+++ b/Tests/Tests.csproj
@@ -8,7 +8,7 @@
<OutputType>Exe</OutputType>
<RootNamespace>Tests</RootNamespace>
<AssemblyName>Tests</AssemblyName>
- <StartupObject>test.GOLIBTest_4</StartupObject>
+ <StartupObject>test.GOLIBTest_Listbox</StartupObject>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<OutputPath>..\bin\$(configuration)</OutputPath>
<IntermediateOutputPath>obj\$(configuration)</IntermediateOutputPath>
@@ -83,6 +83,10 @@
<LogicalName>
</LogicalName>
</Compile>
+ <Compile Include="GOLIBTest_Listbox.cs">
+ <LogicalName>
+ </LogicalName>
+ </Compile>
</ItemGroup>
<ItemGroup>
<None Include="image\u.svg">
@@ -150,6 +154,11 @@
</LogicalName>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+ <None Include="Interfaces\test_Listbox.goml">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ <LogicalName>
+ </LogicalName>
+ </None>
</ItemGroup>
<ItemGroup>
<Folder Include="Interfaces\">