aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/TabItem.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-15 14:06:13 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-15 14:06:13 +0100
commit0eb9fb424f826da3cf03bf03e2844ed61df9f594 (patch)
treed3258e3e433ce82241f34bd27eb220e5c69be901 /src/GraphicObjects/TabItem.cs
parent2def04e1eec8b2ae2ee1cf952a2975f8ca6e8b05 (diff)
draw selected tab last, try mouseIsIn
Diffstat (limited to 'src/GraphicObjects/TabItem.cs')
-rw-r--r--src/GraphicObjects/TabItem.cs32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/GraphicObjects/TabItem.cs b/src/GraphicObjects/TabItem.cs
index 1f0389d3..3ecce217 100644
--- a/src/GraphicObjects/TabItem.cs
+++ b/src/GraphicObjects/TabItem.cs
@@ -21,19 +21,27 @@
using System;
using System.Xml.Serialization;
using System.ComponentModel;
+using System.Diagnostics;
namespace Crow
{
[DefaultTemplate("#Crow.Templates.TabItem.crow")]
public class TabItem : TemplatedContainer
{
+ #region Private fields
string caption;
Container _contentContainer;
GraphicObject _tabTitle;
+ int tabOffset;
+ #endregion
+ #region CTOR
public TabItem () : base()
{
}
+ #endregion
+
+ #region TemplatedControl overrides
public override GraphicObject Content {
get {
return _contentContainer == null ? null : _contentContainer.Child;
@@ -56,16 +64,17 @@ namespace Crow
_tabTitle = this.child.FindByName ("TabTitle");
}
internal GraphicObject TabTitle { get { return _tabTitle; }}
+ #endregion
#region GraphicObject overrides
- [XmlAttributeAttribute()][DefaultValue(true)]
+ [XmlAttributeAttribute()][DefaultValue(false)]
public override bool Focusable
{
get { return base.Focusable; }
set { base.Focusable = value; }
}
#endregion
- int tabOffset;
+
[XmlAttributeAttribute()][DefaultValue(0)]
public virtual int TabOffset {
get { return tabOffset; }
@@ -86,6 +95,25 @@ namespace Crow
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;
+ }
protected override void onDraw (Cairo.Context gr)
{
int spacing = (Parent as TabView).Spacing;