From: Jean-Philippe Bruyère Date: Mon, 19 Feb 2018 11:57:52 +0000 (+0100) Subject: tabview debug, never set focusedIdx to -1, should find another way to known if event... X-Git-Tag: 0.7.0~4 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=6e9926f52debcd2c2ef8495534f0b5e9db3103f2;p=jp%2Fcrow.git tabview debug, never set focusedIdx to -1, should find another way to known if event have to be routed up to the Opentk app --- diff --git a/Tests/CrowWindow.cs b/Tests/CrowWindow.cs index 8ce0abb3..1be9bb45 100644 --- a/Tests/CrowWindow.cs +++ b/Tests/CrowWindow.cs @@ -116,11 +116,7 @@ namespace Crow /// public Interface CurrentInterface { get { - if (ifaceControl.Count == 0) {//create default orthogonal interface - addInterfaceControler (new InterfaceControler ( - new Rectangle (0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height))); - focusedIdx = 0; - } + checkDefaultIFace (); return ifaceControl [focusedIdx].CrowInterface; } } @@ -218,9 +214,11 @@ namespace Crow /// check if a default interface exists, create one if not /// void checkDefaultIFace (){ - if (ifaceControl.Count == 0)//create default orthogonal interface + if (ifaceControl.Count == 0) {//create default orthogonal interface addInterfaceControler (new InterfaceControler ( - new Rectangle (0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height))); + new Rectangle (0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height))); + focusedIdx = 0; + } } /// /// Load the content of the IML file pointed by path and add it to the current interface @@ -345,20 +343,17 @@ namespace Crow } protected virtual void GL_Mouse_Move(object sender, OpenTK.Input.MouseMoveEventArgs otk_e) { - if (activeIdx == -2) { - focusedIdx = -1; + if (activeIdx == -2) { for (int i = 0; i < ifaceControl.Count; i++) { if (ifaceControl [i].ProcessMouseMove (otk_e.X, otk_e.Y)) { focusedIdx = i; return; } } - } else if (focusedIdx >= 0) { - ifaceControl [focusedIdx].ProcessMouseMove (otk_e.X, otk_e.Y); - return; - } - if (focusedIdx < 0) - CrowMouseMove.Raise (sender, otk_e); + } if (ifaceControl [focusedIdx].ProcessMouseMove (otk_e.X, otk_e.Y)) + return; + + CrowMouseMove.Raise (sender, otk_e); } protected virtual void GL_Mouse_ButtonUp(object sender, OpenTK.Input.MouseButtonEventArgs otk_e) { diff --git a/Tests/Interfaces/TabItem.template b/Tests/Interfaces/TabItem.template index 26ecd47c..c59576ed 100644 --- a/Tests/Interfaces/TabItem.template +++ b/Tests/Interfaces/TabItem.template @@ -1,10 +1,10 @@  diff --git a/Tests/Interfaces/TemplatedContainer/testTabView.crow b/Tests/Interfaces/TemplatedContainer/testTabView.crow index 59567ed4..f9934007 100644 --- a/Tests/Interfaces/TemplatedContainer/testTabView.crow +++ b/Tests/Interfaces/TemplatedContainer/testTabView.crow @@ -4,8 +4,8 @@ - - + + @@ -13,20 +13,20 @@ - - + + - + - +