diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-06 17:48:03 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-06 17:48:03 +0200 |
| commit | c45ce80e0e4298afcbeee9215ee2d1d30c4c3be8 (patch) | |
| tree | ec659a28153b9df8406736d9f8df6ee255b8cb7e /src/Interface.cs | |
| parent | f42cabddc008529eddc0a43cad3be2b39b6790ee (diff) | |
* 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
Diffstat (limited to 'src/Interface.cs')
| -rw-r--r-- | src/Interface.cs | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/Interface.cs b/src/Interface.cs index 99ea974b..df595275 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -218,7 +218,7 @@ namespace Crow xs.Serialize (s, graphicObject, xn); } } - public static GraphicObject Load (string path, object hostClass = null) + public static GraphicObject Load (string path) { System.Globalization.CultureInfo savedCulture = Thread.CurrentThread.CurrentCulture; Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; @@ -226,7 +226,7 @@ namespace Crow GraphicObject tmp = null; try { using (Stream stream = GetStreamFromPath (path)) { - tmp = Load(stream, GetTopContainerOfXMLStream(stream), hostClass); + tmp = Load(stream, GetTopContainerOfXMLStream(stream)); } } catch (Exception ex) { throw new Exception ("Error loading <" + path + ">:", ex); @@ -236,11 +236,7 @@ namespace Crow return tmp; } - internal static GraphicObject Load (IMLStream stream, object hostClass = null){ - stream.Seek (0, SeekOrigin.Begin); - return Load(stream, stream.RootType, hostClass); - } - internal static GraphicObject Load (Stream stream, Type type, object hostClass = null) + internal static GraphicObject Load (Stream stream, Type type) { #if DEBUG_LOAD Stopwatch loadingTime = new Stopwatch (); @@ -257,7 +253,6 @@ namespace Crow XmlSerializer xs = new XmlSerializer (type); result = (GraphicObject)xs.Deserialize (stream); - //result.DataSource = hostClass; CurrentInterface.XmlLoading = false; #if DEBUG_LOAD @@ -277,7 +272,7 @@ namespace Crow public GraphicObject LoadInterface (string path) { lock (UpdateMutex) { - GraphicObject tmp = Interface.Load (path, this); + GraphicObject tmp = Interface.Load (path); AddWidget (tmp); return tmp; @@ -644,7 +639,8 @@ namespace Crow GraphicObject g = GraphicTree[i]; if (g.MouseIsIn (e.Position)) { g.checkHoverWidget (e); - PutOnTop (g); + if (g is Window) + PutOnTop (g); return true; } } @@ -716,6 +712,7 @@ namespace Crow #region Keyboard public bool ProcessKeyDown(int Key){ + Keyboard.SetKeyState((Crow.Key)Key,true); if (_focusedWidget == null) return false; KeyboardKeyEventArgs e = new KeyboardKeyEventArgs((Crow.Key)Key, false, Keyboard); @@ -723,9 +720,11 @@ namespace Crow return true; } public bool ProcessKeyUp(int Key){ - if (_activeWidget == null) + Keyboard.SetKeyState((Crow.Key)Key,false); + if (_focusedWidget == null) return false; - //KeyboardKeyEventArgs e = new KeyboardKeyEventArgs((Crow.Key)Key, false, Keyboard); + KeyboardKeyEventArgs e = new KeyboardKeyEventArgs((Crow.Key)Key, false, Keyboard); + _focusedWidget.onKeyUp (this, e); return true; } public bool ProcessKeyPress(char Key){ |