From c45ce80e0e4298afcbeee9215ee2d1d30c4c3be8 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Sat, 6 Aug 2016 17:48:03 +0200 Subject: [PATCH] * Crow.csproj: * Label.cs: update * GraphicObject.cs: key up * ListBox.cs: IMLStream instanciing * PrivateContainer.cs: Clear child Changes * Scroller.cs: scroller have VerticalSrcrolling by default * TemplatedControl.cs: remove unused hostClass attribute * IMLStream.cs: IMLStream instance and source properties * Interface.cs: removed unused hostClass Only putOnTop Window widget when focused KeyboardState key up and down * TreeView.crow: no border in default template * BasicTests.cs: IMLEditor PropLessBinding test * Tests.csproj: * 2.crow: * 0.crow: * test5.crow: * 2.crow: * testTreeView.crow: update tests * Bindings.cs: * MemberReference.cs: * CompilerServices.cs: property less bindings debug --- Crow.csproj | 2 + Templates/TreeView.crow | 17 ++--- Tests/BasicTests.cs | 35 ++++++++- Tests/Interfaces/Divers/2.crow | 22 ------ Tests/Interfaces/Divers/test5.crow | 27 +------ Tests/Interfaces/Expandable/2.crow | 13 ---- Tests/Interfaces/Unsorted/0.crow | 4 +- Tests/Interfaces/Unsorted/testTreeView.crow | 80 ++++++++++----------- Tests/Tests.csproj | 12 +++- src/CompilerServices/Bindings.cs | 63 ++++++++-------- src/CompilerServices/CompilerServices.cs | 4 +- src/CompilerServices/MemberReference.cs | 4 ++ src/GraphicObjects/GraphicObject.cs | 3 + src/GraphicObjects/Label.cs | 2 +- src/GraphicObjects/ListBox.cs | 2 +- src/GraphicObjects/PrivateContainer.cs | 3 +- src/GraphicObjects/Scroller.cs | 2 +- src/GraphicObjects/TemplatedControl.cs | 6 +- src/IMLStream.cs | 19 +++++ src/Interface.cs | 23 +++--- 20 files changed, 172 insertions(+), 171 deletions(-) delete mode 100755 Tests/Interfaces/Expandable/2.crow diff --git a/Crow.csproj b/Crow.csproj index 3f6f6b2d..7dde305f 100644 --- a/Crow.csproj +++ b/Crow.csproj @@ -135,6 +135,7 @@ + @@ -227,6 +228,7 @@ + diff --git a/Templates/TreeView.crow b/Templates/TreeView.crow index db6533e3..fe083072 100644 --- a/Templates/TreeView.crow +++ b/Templates/TreeView.crow @@ -1,10 +1,7 @@ - - - - - - + + + diff --git a/Tests/BasicTests.cs b/Tests/BasicTests.cs index 0c515aa6..2a82bd23 100644 --- a/Tests/BasicTests.cs +++ b/Tests/BasicTests.cs @@ -70,6 +70,16 @@ namespace Tests } get { return testList; } } + string curSources = ""; + public string CurSources { + get { return curSources; } + set { + if (value == curSources) + return; + curSources = value; + NotifyValueChanged ("CurSources", curSources); + } + } #endregion void OnClear (object sender, MouseButtonEventArgs e) => TestList = null; @@ -113,6 +123,10 @@ namespace Tests GraphicObject w = CrowInterface.LoadInterface ("Interfaces/Divers/testWindow2.goml"); w.DataSource = this; return; + }else if (e.Key == OpenTK.Input.Key.F6) { + GraphicObject w = CrowInterface.LoadInterface ("Interfaces/Divers/imlEditor.crow"); + w.DataSource = this; + return; } else if (e.Key == OpenTK.Input.Key.F2) idx--; else if (e.Key == OpenTK.Input.Key.F3) @@ -131,7 +145,20 @@ namespace Tests GraphicObject obj = CrowInterface.LoadInterface(testFiles[idx]); obj.DataSource = this; } - + void Tv_SelectedItemChanged (object sender, SelectionChangeEventArgs e) + { + FileInfo fi = e.NewValue as FileInfo; + if (fi == null) + return; + if (fi.Extension == ".crow" || fi.Extension == ".goml") { + IMLStream imls = new IMLStream (fi.FullName); + lock (CrowInterface.UpdateMutex) { + (CrowInterface.FindByName ("crowContainer") as Container).SetChild + (imls.Instance); + CurSources = imls.Source; + } + } + } void onButClick(object send, MouseButtonEventArgs e) { Console.WriteLine ("button clicked:" + send.ToString()); @@ -150,5 +177,11 @@ namespace Tests BasicTests win = new BasicTests (); win.Run (30); } + protected override void OnUpdateFrame (OpenTK.FrameEventArgs e) + { + base.OnUpdateFrame (e); + string test = e.Time.ToString (); + NotifyValueChanged ("PropertyLessBinding", test); + } } } diff --git a/Tests/Interfaces/Divers/2.crow b/Tests/Interfaces/Divers/2.crow index 5b4d9c75..b4a06b68 100755 --- a/Tests/Interfaces/Divers/2.crow +++ b/Tests/Interfaces/Divers/2.crow @@ -10,26 +10,4 @@