diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2017-01-30 12:09:57 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2017-01-30 12:09:57 +0100 |
| commit | 2d1fd70ffa422dfdcf25a8c39ae9f4806c57c6ed (patch) | |
| tree | 5863ec9bca19d06daacc12b131073877f4b8b930 /src | |
| parent | dc603ff31253879bb8effb6d529f266ff78e9f3e (diff) | |
make publi Initialize func of GraphicObj, test logical parent in popper to allow shared content, test parent == null on visible changed
Diffstat (limited to 'src')
| -rw-r--r-- | src/GraphicObjects/GraphicObject.cs | 13 | ||||
| -rw-r--r-- | src/GraphicObjects/Popper.cs | 2 | ||||
| -rw-r--r-- | src/GraphicObjects/TemplatedContainer.cs | 2 | ||||
| -rw-r--r-- | src/GraphicObjects/TemplatedControl.cs | 4 | ||||
| -rw-r--r-- | src/GraphicObjects/TemplatedGroup.cs | 2 |
5 files changed, 16 insertions, 7 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 574870f8..f7e193e1 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -23,7 +23,7 @@ namespace Crow get { if (currentInterface == null) { currentInterface = Interface.CurrentInterface; - initialize (); + Initialize (); } return currentInterface; } @@ -53,7 +53,13 @@ namespace Crow #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 @@ -513,7 +519,8 @@ namespace Crow 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; } diff --git a/src/GraphicObjects/Popper.cs b/src/GraphicObjects/Popper.cs index 8c79ce24..0b022842 100644 --- a/src/GraphicObjects/Popper.cs +++ b/src/GraphicObjects/Popper.cs @@ -229,6 +229,8 @@ namespace Crow 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)); } diff --git a/src/GraphicObjects/TemplatedContainer.cs b/src/GraphicObjects/TemplatedContainer.cs index f4243588..44f2ca7c 100644 --- a/src/GraphicObjects/TemplatedContainer.cs +++ b/src/GraphicObjects/TemplatedContainer.cs @@ -31,7 +31,7 @@ namespace Crow 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) diff --git a/src/GraphicObjects/TemplatedControl.cs b/src/GraphicObjects/TemplatedControl.cs index 4a3a2507..cd645dd3 100644 --- a/src/GraphicObjects/TemplatedControl.cs +++ b/src/GraphicObjects/TemplatedControl.cs @@ -39,10 +39,10 @@ namespace Crow } #endregion - internal protected override void initialize () + public override void Initialize () { loadTemplate (); - base.initialize (); + base.Initialize (); } string _template; diff --git a/src/GraphicObjects/TemplatedGroup.cs b/src/GraphicObjects/TemplatedGroup.cs index 4c35197f..fbb3c4bd 100644 --- a/src/GraphicObjects/TemplatedGroup.cs +++ b/src/GraphicObjects/TemplatedGroup.cs @@ -330,7 +330,7 @@ namespace Crow }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; |