From bd45fd655c1314660349e009e761d1b0abb68fa6 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Wed, 27 Jan 2016 14:01:18 +0100 Subject: [PATCH] test refresh of scrollbar in listbox template, add RegisterForGraphicUpdate in scroller props --- Tests/GOLIBTest_Listbox.cs | 13 ++++++-- Tests/Interfaces/test_Listbox.goml | 48 ++++++++++++++++-------------- src/GraphicObjects/Scrollbar.cs | 2 ++ 3 files changed, 38 insertions(+), 25 deletions(-) diff --git a/Tests/GOLIBTest_Listbox.cs b/Tests/GOLIBTest_Listbox.cs index 1d6b2f38..cedf695a 100644 --- a/Tests/GOLIBTest_Listbox.cs +++ b/Tests/GOLIBTest_Listbox.cs @@ -82,13 +82,21 @@ namespace test { base.OnLoad (e); - TestList = Directory.GetFileSystemEntries("/home/jp/tmp/mtgdata/a", "*.txt",SearchOption.AllDirectories).ToList(); + //TestList = Directory.GetFileSystemEntries("/home/jp/tmp/mtgdata/a", "*.txt",SearchOption.AllDirectories).ToList(); GraphicObject tlb = LoadInterface("Interfaces/test_Listbox.goml"); tlb.DataSource = this; // TestList [1].Field = "test string"; // ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList)); } + void OnClear (object sender, MouseButtonEventArgs e){ + TestList = null; + ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList)); + } + void OnLoadList (object sender, MouseButtonEventArgs e){ + TestList = Directory.GetFileSystemEntries("/home/jp/tmp/mtgdata/a", "*.txt",SearchOption.AllDirectories).ToList(); + ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList)); + } protected override void OnMouseMove (MouseMoveEventArgs e) { base.OnMouseMove (e); @@ -102,7 +110,8 @@ namespace test } protected override void OnKeyDown (KeyboardKeyEventArgs e) { - TestList.Add ("newly added list item"); + TestList = Directory.GetFileSystemEntries("/home/jp/tmp/mtgdata/a", "*.txt",SearchOption.AllDirectories).ToList(); + //TestList.Add ("newly added list item"); ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList)); } diff --git a/Tests/Interfaces/test_Listbox.goml b/Tests/Interfaces/test_Listbox.goml index 342f2909..fa4b730c 100755 --- a/Tests/Interfaces/test_Listbox.goml +++ b/Tests/Interfaces/test_Listbox.goml @@ -1,25 +1,27 @@  - -