aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-02-19 10:23:56 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-02-19 10:23:56 +0100
commitb5310f4458fe089b3df2667e90f9eb925d59a762 (patch)
treed94f8becb20003545ed27b19584bf170a8223124 /src/GraphicObjects
parentc4ba610f43b9302ae5ece7741ad12fd3ab4b1fac (diff)
update tabview with new mouse is in test
Diffstat (limited to 'src/GraphicObjects')
-rw-r--r--src/GraphicObjects/GraphicObject.cs6
-rw-r--r--src/GraphicObjects/TabItem.cs17
2 files changed, 13 insertions, 10 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index 65f8ed26..9857d198 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -1527,6 +1527,12 @@ namespace Crow
#endregion
#region Mouse handling
+ /// <summary>
+ /// Recursive local coordinate point test.
+ /// After test on parent, point m is in local coord system.
+ /// </summary>
+ /// <returns>return true, if point is in the bounds of this control</returns>
+ /// <param name="m">by ref point to test, init value is not kept</param>
public virtual bool PointIsIn(ref Point m)
{
if (!(Visible & isEnabled)||IsDragged)
diff --git a/src/GraphicObjects/TabItem.cs b/src/GraphicObjects/TabItem.cs
index d811ea54..8364aace 100644
--- a/src/GraphicObjects/TabItem.cs
+++ b/src/GraphicObjects/TabItem.cs
@@ -157,18 +157,15 @@ namespace Crow
#region Mouse Handling
public bool HoldCursor = false;
-
- public override bool MouseIsIn (Point m)
+ public override bool PointIsIn (ref Point m)
{
- if (!(Visible & IsEnabled) || IsDragged)
- return false;
-
- bool mouseIsInTitle = TabTitle.ScreenCoordinates (TabTitle.Slot).ContainsOrIsEqual (m);
- if (!IsSelected)
- return mouseIsInTitle;
+ TabView tv = Parent as TabView;
+ bool tmp = base.PointIsIn (ref m);
- return _contentContainer.ScreenCoordinates (_contentContainer.Slot).ContainsOrIsEqual (m)
- || mouseIsInTitle;
+ if (m.Y < tabThickness)
+ return TabTitle.Slot.ContainsOrIsEqual (m);
+ else
+ return this.isSelected && tmp;
}
public override void onMouseDown (object sender, MouseButtonEventArgs e)
{