]> O.S.I.I.S - jp/crow.git/commitdiff
tabview debug, never set focusedIdx to -1, should find another way to known if event...
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 19 Feb 2018 11:57:52 +0000 (12:57 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 19 Feb 2018 11:57:52 +0000 (12:57 +0100)
Tests/CrowWindow.cs
Tests/Interfaces/TabItem.template
Tests/Interfaces/TemplatedContainer/testTabView.crow

index 8ce0abb375afd90806a921ba1ad95a9dc3e8b8b4..1be9bb45ea3f8b0edc00041534264d17b3d5e290 100644 (file)
@@ -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)
         {
index 26ecd47cf671f9ddb556c6850eb14e9ff08e81ed..c59576edb6a284fcfe3715c6a1fcdb61a496bc2d 100644 (file)
@@ -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">
index 59567ed4455092ef2e3ada0daeeb2308c4f8bbc8..f9934007be48313f7f4c47e903e668142360fecd 100644 (file)
@@ -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/>
                                <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>