<?xml version="1.0" encoding="UTF-8" ?>
-<GenericStack Orientation="Vertical" Spacing="0"
+<GenericStack Orientation="Vertical" Spacing="0" Hoverable="false"
Width="{../../WidthPolicy}" Height="{../../HeightPolicy}">
<Label Margin="5" Name="TabTitle" Width="-1"
HorizontalAlignment="Left"
Height="{../../../TabThickness}"
Left="{../../TabOffset}"
LayoutChanged="../../../TabTitleLayoutChanged"/>
- <Container Background="LightGray"
+ <Container
Name="Content" Width="{../../../WidthPolicy}" Height="{../../../HeightPolicy}"/>
</GenericStack>
<?xml version="1.0" encoding="UTF-8" ?>
-<TabView Orientation="Horizontal" Spacing="20" Margin="0">
- <TabItem Name="TabItem1" Caption="tab 1" Width="0" Height="0" Margin="0" Background="Gray"
- MouseEnter="{Background=Red}"
- MouseLeave="{Background=Gray}">
- <Label Text="tab content test 1"/>
- </TabItem>
- <TabItem Name="TabItem2" Caption="tab 2" Width="0" Height="0" Margin="0" Background="Gray"
- MouseEnter="{Background=Red}"
- MouseLeave="{Background=Gray}">
- <Label Text="tab content test 2"/>
- </TabItem>
-
-</TabView>
+<HorizontalStack>
+ <TabView CacheEnabled="false" Width="200" Height="200" Orientation="Horizontal" Spacing="20" Margin="0">
+ <TabItem Hoverable="false" Name="TabItem1" Caption="tab 1" Width="0" Height="0" Margin="0" Background="Gray">
+ <VerticalStack Fit="true">
+ <CheckBox/>
+ <CheckBox/>
+ <CheckBox/>
+ <CheckBox/>
+ <Label Text="tab content test 1"/>
+ </VerticalStack>
+ </TabItem>
+ <TabItem Hoverable="false" Name="TabItem2" Caption="tab 2" Width="0" Height="0" Margin="0" Background="Gray">
+ <VerticalStack Fit="true">
+ <RadioButton/>
+ <RadioButton/>
+ <RadioButton/>
+ <RadioButton/>
+ <Label Text="tab content test 2"/>
+ </VerticalStack>
+ </TabItem>
+ </TabView>
+ <TabView CacheEnabled="false" Width="200" Height="200" Orientation="Horizontal" Spacing="20" Margin="0">
+ <TabItem Hoverable="false" Name="TabItem1" Caption="tab 1" Width="0" Height="0" Margin="0" Background="Gray">
+ <VerticalStack Fit="true">
+ <CheckBox/>
+ <CheckBox/>
+ <CheckBox/>
+ <CheckBox/>
+ <Label Text="tab content test 1"/>
+ </VerticalStack>
+ </TabItem>
+ <TabItem Hoverable="false" Name="TabItem2" Caption="tab 2" Width="0" Height="0" Margin="0" Background="Gray">
+ <VerticalStack Fit="true">
+ <RadioButton/>
+ <RadioButton/>
+ <RadioButton/>
+ <RadioButton/>
+ <Label Text="tab content test 2"/>
+ </VerticalStack>
+ </TabItem>
+ </TabView>
+</HorizontalStack>
double _cornerRadius = 0;
int _margin = 0;
bool _focusable = false;
+ bool hoverable = true;
bool _hasFocus = false;
bool _isActive = false;
bool _mouseRepeat;
Bounds.Width = Bounds.Height = -1;
}
}
+ /// <summary>
+ /// used to handle mouse hover in children instead of the whole container
+ /// </summary>
+ [XmlAttributeAttribute()][DefaultValue(true)]
+ public virtual bool Hoverable {
+ get { return hoverable; }
+ set {
+ if (hoverable == value)
+ return;
+ hoverable = value;
+ NotifyValueChanged ("Hoverable", hoverable);
+ }
+ }
[XmlAttributeAttribute()][DefaultValue(false)]
public virtual bool Focusable {
get { return _focusable; }
if (ScreenCoordinates (Slot).ContainsOrIsEqual (m)) {
Scroller scr = Parent as Scroller;
if (scr == null)
- return true;
+ return Hoverable;
return scr.MouseIsIn (scr.savedMousePos);
}
return false;
#region Mouse handling
+ public override bool MouseIsIn (Point m)
+ {
+ if (Hoverable)
+ return base.MouseIsIn (m);
+ for (int i = Children.Count - 1; i >= 0; i--) {
+ if (Children[i].MouseIsIn(m))
+ return true;
+ }
+ return false;
+ }
public override void checkHoverWidget (MouseMoveEventArgs e)
{
if (HostContainer.hoverWidget != this) {
#endregion
#region Mouse handling
+ public override bool MouseIsIn (Point m)
+ {
+ if (Hoverable || child == null)
+ return base.MouseIsIn (m);
+ return child.MouseIsIn (m);
+ }
public override void checkHoverWidget (MouseMoveEventArgs e)
{
base.checkHoverWidget (e);
if (child != null)
- if (child.MouseIsIn (e.Position))
- child.checkHoverWidget (e);
+ if (child.MouseIsIn (e.Position))
+ child.checkHoverWidget (e);
}
#endregion
NotifyValueChanged ("Caption", caption);
}
}
- public override bool MouseIsIn (Point m)
- {
- if (!Visible)
- return false;
-
- Debug.WriteLine ("Mouse Testing " + this.ToString ());
-
- if (TabTitle.MouseIsIn (m)){
- Debug.WriteLine ("Mouse is in title of " + this.ToString ());
- return true;
- }
- if (Content.MouseIsIn (m)){
- Debug.WriteLine ("Mouse is in content of " + this.ToString ());
- return true;
- }
-
- Debug.WriteLine ("Mouse is not in " + this.ToString ());
- return false;
- }
+// public override bool MouseIsIn (Point m)
+// {
+// if (!Visible)
+// return false;
+//
+// Debug.WriteLine ("Mouse Testing " + this.ToString ());
+//
+// if (TabTitle.MouseIsIn (m)){
+// Debug.WriteLine ("Mouse is in title of " + this.ToString ());
+// return true;
+// }
+// if (Content.MouseIsIn (m)){
+// Debug.WriteLine ("Mouse is in content of " + this.ToString ());
+// return true;
+// }
+//
+// Debug.WriteLine ("Mouse is not in " + this.ToString ());
+// return false;
+// }
protected override void onDraw (Cairo.Context gr)
{
int spacing = (Parent as TabView).Spacing;
return;
selectedTab = value;
NotifyValueChanged ("SelectedTab", selectedTab);
+ Debug.WriteLine ("selected tab: " + (selectedTab + 1).ToString ());
registerForGraphicUpdate ();
}
}
void Ti_MouseDown (object sender, OpenTK.Input.MouseButtonEventArgs e)
{
SelectedTab = Children.IndexOf (sender as GraphicObject);
- Debug.WriteLine ("selected tab: " + (selectedTab + 1).ToString ());
}
}
}