}
MenuItem {
Width = Stretched;
+ Height = Fit;
Background = Transparent;
Foreground = LightGray;
MouseEnter = {Background = vgradient|0:UnitedNationsBlue|1:Onyx;Foreground=White;}
get {
if (currentInterface == null) {
currentInterface = Interface.CurrentInterface;
- initialize ();
+ Initialize ();
}
return currentInterface;
}
#endif
}
#endregion
- internal protected virtual void initialize(){
+
+ /// <summary>
+ /// Initialize this Graphic object instance by setting style and default values and loading template if required
+ /// </summary>
+ public virtual void Initialize(){
+ if (currentInterface == null)
+ currentInterface = Interface.CurrentInterface;
loadDefaultValues ();
}
#region private fields
LayoutChanged.Raise (this, new LayoutingEventArgs (LayoutingType.Width));
Slot.Height = 0;
LayoutChanged.Raise (this, new LayoutingEventArgs (LayoutingType.Height));
- CurrentInterface.EnqueueForRepaint (this);
+ if (this.parent != null)
+ CurrentInterface.EnqueueForRepaint (this);
LastSlots.Width = LastSlots.Height = 0;
}
Content.Visible = true;
if (Content.Parent == null)
CurrentInterface.AddWidget (Content, true);
+ if (Content.LogicalParent != this)
+ Content.LogicalParent = this;
CurrentInterface.PutOnTop (Content, true);
_content_LayoutChanged (this, new LayoutingEventArgs (LayoutingType.Sizing));
}
public TemplatedContainer () : base(){}
#endregion
- [XmlIgnore]public abstract GraphicObject Content{ get; set;}
+ [XmlAttributeAttribute]public virtual GraphicObject Content{ get; set;}
#region GraphicObject overrides
public override GraphicObject FindByName (string nameToFind)
}
#endregion
- internal protected override void initialize ()
+ public override void Initialize ()
{
loadTemplate ();
- base.initialize ();
+ base.Initialize ();
}
string _template;
}else if (typeof(GenericStack).IsAssignableFrom (items.GetType ())) {
GenericStack gs = new GenericStack ();
gs.CurrentInterface = items.CurrentInterface;
- gs.initialize ();
+ gs.Initialize ();
gs.Orientation = (items as GenericStack).Orientation;
gs.Width = items.Width;
gs.Height = items.Height;