#region CTOR
public GraphicObject ()
{
+ #if DEBUG
uid = currentUid;
currentUid++;
+ #endif
}
#endregion
internal protected virtual void initialize(){
LayoutingType registeredLayoutings = LayoutingType.All;
ILayoutable logicalParent;
ILayoutable parent;
- string name = "unamed";
+ string name;
Fill background = Color.Transparent;
Fill foreground = Color.White;
Font font = "droid, 10";
this.RegisterForRedraw ();
}
}
- [XmlAttributeAttribute()][DefaultValue("unamed")]
+ [XmlAttributeAttribute()][DefaultValue(null)]
public virtual string Name {
- get { return name; }
+ get {
+ #if DEBUG
+ return string.IsNullOrEmpty(name) ? this.GetType().Name + uid.ToString () : name;
+ #else
+ return name;
+ #endif
+ }
set {
if (name == value)
return;
name = value;
- NotifyValueChanged("Name", verticalAlignment);
+ NotifyValueChanged("Name", name);
}
}
[XmlAttributeAttribute ()][DefaultValue(VerticalAlignment.Center)]
if (!isVisible && this.Contains (CurrentInterface.HoverWidget))
CurrentInterface.HoverWidget = null;
- if (Parent is GraphicObject)
- (Parent as GraphicObject).RegisterForLayouting (LayoutingType.Sizing);
- if (Parent is GenericStack)
- (Parent as GraphicObject).RegisterForLayouting (LayoutingType.ArrangeChildren);
-
if (isVisible)
RegisterForLayouting (LayoutingType.Sizing);
- CurrentInterface.EnqueueForRepaint (this);
+ else {
+ Slot.Width = 0;
+ LayoutChanged.Raise (this, new LayoutingEventArgs (LayoutingType.Width));
+ Slot.Height = 0;
+ LayoutChanged.Raise (this, new LayoutingEventArgs (LayoutingType.Height));
+ CurrentInterface.EnqueueForRepaint (this);
+ LastSlots.Width = LastSlots.Height = 0;
+ }
+
NotifyValueChanged ("Visible", isVisible);
}
{
#if DEBUG_LAYOUTING
LayoutingQueueItem.currentLQI.Slot = LastSlots;
- LayoutingQueueItem.currentLQI.Slot = Slot;
+ LayoutingQueueItem.currentLQI.NewSlot = Slot;
#endif
switch (layoutType) {
public virtual void onDisable(object sender, EventArgs e){
Disabled.Raise (this, e);
}
- public override string ToString ()
- {
- string tmp ="";
-
- if (Parent != null)
- tmp = Parent.ToString () + tmp;
- #if DEBUG_LAYOUTING
- return Name == "unamed" ? tmp + "." + this.GetType ().Name + uid.ToString(): tmp + "." + Name;
- #else
- return Name == "unamed" ? tmp + "." + this.GetType ().Name : tmp + "." + Name;
- #endif
- }
#region Binding
public void BindMember(string _member, string _expression){
tmp.Bindings.Add (new Binding (new MemberReference (tmp, b.Source.Member), b.Expression));
return tmp;
}
+
+ public override string ToString ()
+ {
+ string tmp ="";
+
+ if (Parent != null)
+ tmp = Parent.ToString () + tmp;
+ #if DEBUG_LAYOUTING
+ return Name == "unamed" ? tmp + "." + this.GetType ().Name + uid.ToString(): tmp + "." + Name;
+ #else
+ return Name == "unamed" ? tmp + "." + this.GetType ().Name : tmp + "." + Name;
+ #endif
+ }
}
}
//position smaller objects in group when group size is fit
switch (layoutType) {
case LayoutingType.Width:
- foreach (GraphicObject c in Children)
- c.RegisterForLayouting (LayoutingType.X | LayoutingType.Width);
+ foreach (GraphicObject c in Children){
+ if (c.Width.Units == Unit.Percent)
+ c.RegisterForLayouting (LayoutingType.Width);
+ else
+ c.RegisterForLayouting (LayoutingType.X);
+ }
break;
case LayoutingType.Height:
- foreach (GraphicObject c in Children)
- c.RegisterForLayouting (LayoutingType.Y | LayoutingType.Height);
+ foreach (GraphicObject c in Children) {
+ if (c.Height.Units == Unit.Percent)
+ c.RegisterForLayouting (LayoutingType.Height);
+ else
+ c.RegisterForLayouting (LayoutingType.Y);
+ }
break;
}
}