diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-02-19 12:57:52 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-02-19 12:57:52 +0100 |
| commit | 62b7da7bd90207c6747b643b40ab80e095fa8b50 (patch) | |
| tree | 21fcba2dd11da3035537e3ac1b3db3911f6b4bb5 | |
| parent | b5310f4458fe089b3df2667e90f9eb925d59a762 (diff) | |
tabview debug, never set focusedIdx to -1, should find another way to known if event have to be routed up to the Opentk app
| -rw-r--r-- | Tests/CrowWindow.cs | 25 | ||||
| -rw-r--r-- | Tests/Interfaces/TabItem.template | 4 | ||||
| -rw-r--r-- | Tests/Interfaces/TemplatedContainer/testTabView.crow | 12 |
3 files changed, 18 insertions, 23 deletions
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 /// </summary> 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 /// </summary> 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; + } } /// <summary> /// 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 @@ <?xml version="1.0"?> <GenericStack Orientation="Vertical" Spacing="0" - Background="Onyx" + Background="{./Background}" MouseEnter="{/caption.Foreground=White}" MouseLeave="{/caption.Foreground=Gray}"> <HorizontalStack Margin="2" Left="{./TabOffset}" - Name="TabTitle" + Name="TabTitle" Background="{./Background}" HorizontalAlignment="Left" Height="{./TabThickness}" Width="Fit"> 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 @@ <Label Text="Selected Tab:"/> <Label Text="{../../tabview1.SelectedTab}"/> </HorizontalStack> - <TabView Name="tabview1" Orientation="Horizontal" Spacing="24" Margin="50"> - <TabItem Name="TabItem1" Caption="tab item 1" > + <TabView Name="tabview1" Background="Onyx" Orientation="Horizontal" Spacing="14" Margin="50"> + <TabItem Name="TabItem1" Caption="tab item 1" Background="Onyx"> <VerticalStack Margin="20"> <CheckBox/> <CheckBox/> @@ -13,20 +13,20 @@ <CheckBox/> </VerticalStack> </TabItem> - <TabItem Name="TabItem2" Caption="tab item 2" Background="Gray"> - <VerticalStack Background="DimGray" Height="Fit" Margin="10"> + <TabItem Name="TabItem2" Caption="tab item 2" Background="Onyx"> + <VerticalStack Height="Fit" Margin="10"> <RadioButton Fit="true"/> <RadioButton/> <RadioButton/> <RadioButton/> </VerticalStack> </TabItem> - <TabItem Name="TabItem3" Caption="tab item 3" Background="Gray"> + <TabItem Name="TabItem3" Background="Onyx" Caption="tab item 3"> <Container Margin="5" CornerRadius="2" > <TextBox Margin="5" Multiline="true" TextAlignment="TopLeft"/> </Container> </TabItem> - <TabItem Name="TabItem4" Caption="tab item 4" Margin="0" Background="Gray"> + <TabItem Name="TabItem4" Background="Onyx" Caption="tab item 4" Margin="0"> <TextBox/> </TabItem> </TabView> |