}
/// <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){
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
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
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
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)
{
_activeWidget = value;
if (_activeWidget != null)
+ {
_activeWidget.IsActive = true;
+ #if DEBUG_FOCUS
+ Debug.WriteLine("Active => " + _activeWidget.ToString());
+ }else
+ Debug.WriteLine("Active => null");
+ #else
+ }
+ #endif
}
}
public GraphicObject hoverWidget
if (_hoverWidget == value)
return;
_hoverWidget = value;
+ #if DEBUG_FOCUS
+ if (_hoverWidget != null)
+ Debug.WriteLine("Hover => " + _hoverWidget.ToString());
+ else
+ Debug.WriteLine("Hover => null");
+ #endif
}
}
public GraphicObject FocusedWidget {