aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-04-23 11:44:02 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2016-04-23 11:44:02 +0200
commitb3c2c1f21e96418d6b3a91ff75a182e84cb5b6a5 (patch)
tree3681153bfa5585a833a66728574dc3a7189e3cee /src/GraphicObjects
parent88769581ad8993ae9e3b1cb60ccbdc4cb5008fe7 (diff)
DEBIG_FOCUS; min size returned for base GraphObj when in Fit mode
Diffstat (limited to 'src/GraphicObjects')
-rw-r--r--src/GraphicObjects/GraphicObject.cs21
-rw-r--r--src/GraphicObjects/PrivateContainer.cs4
2 files changed, 20 insertions, 5 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index 1750e11e..4e230d4f 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -666,7 +666,9 @@ namespace Crow
}
/// <summary> return size of content + margins </summary>
protected virtual int measureRawSize (LayoutingType lt) {
- return lt == LayoutingType.Width ? Width : Height;
+ return lt == LayoutingType.Width ?
+ Width == Measure.Fit ? MinimumSize.Width : (int)Width :
+ Height == Measure.Fit ? MinimumSize.Height : (int)Height;
}
/// <summary> By default in groups, LayoutingType.ArrangeChildren is reset </summary>
public virtual void ChildrenLayoutingConstraints(ref LayoutingType layoutType){
@@ -813,7 +815,7 @@ namespace Crow
else
Slot.Width = (int)Math.Round((double)(Parent.ClientRectangle.Width * Width) / 100.0);
- if (Slot.Width == int.MinValue)
+ if (Slot.Width < 0)
return false;
//size constrain
@@ -846,7 +848,7 @@ namespace Crow
else
Slot.Height = (int)Math.Round((double)(Parent.ClientRectangle.Height * Height) / 100.0);
- if (Slot.Height == int.MinValue)
+ if (Slot.Height < 0)
return false;
//size constrain
@@ -1040,19 +1042,32 @@ namespace Crow
MouseWheelChanged.Raise (this, e);
}
public virtual void onFocused(object sender, EventArgs e){
+ #if DEBUG_FOCUS
+ Debug.WriteLine("Focused => " + this.ToString());
+ #endif
Focused.Raise (this, e);
this.HasFocus = true;
}
public virtual void onUnfocused(object sender, EventArgs e){
+ #if DEBUG_FOCUS
+ Debug.WriteLine("UnFocused => " + this.ToString());
+ #endif
+
Unfocused.Raise (this, e);
this.HasFocus = false;
}
public virtual void onMouseEnter(object sender, MouseMoveEventArgs e)
{
+ #if DEBUG_FOCUS
+ Debug.WriteLine("MouseEnter => " + this.ToString());
+ #endif
MouseEnter.Raise (this, e);
}
public virtual void onMouseLeave(object sender, MouseMoveEventArgs e)
{
+ #if DEBUG_FOCUS
+ Debug.WriteLine("MouseLeave => " + this.ToString());
+ #endif
MouseLeave.Raise (this, e);
}
#endregion
diff --git a/src/GraphicObjects/PrivateContainer.cs b/src/GraphicObjects/PrivateContainer.cs
index f4bc3aba..99b85dd2 100644
--- a/src/GraphicObjects/PrivateContainer.cs
+++ b/src/GraphicObjects/PrivateContainer.cs
@@ -96,10 +96,10 @@ namespace Crow
return base.measureRawSize (lt);
if (lt == LayoutingType.Width)
return child.RegisteredLayoutings.HasFlag(LayoutingType.Width) ?
- int.MinValue : child.Slot.Size.Width + 2 * Margin;
+ -1 : child.Slot.Size.Width + 2 * Margin;
else
return child.RegisteredLayoutings.HasFlag(LayoutingType.Height) ?
- int.MinValue : child.Slot.Size.Height + 2 * Margin;
+ -1 : child.Slot.Size.Height + 2 * Margin;
}
public override bool UpdateLayout (LayoutingType layoutType)
{