diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-03 11:16:56 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-03 11:16:56 +0200 |
| commit | c601f875010332cb4189a206a2c5ffa5fd6e8bea (patch) | |
| tree | 5d6fba71f8c7f956f6cdc2c17825a9951652f724 /src | |
| parent | 51e7ed159c72331bf1003b3fc88ee68753724a2a (diff) | |
remove image property, set img as fixed in template
modifié : Templates/CheckBox.goml
modifié : Templates/RadioButton.goml
modifié : src/GraphicObjects/CheckBox.cs
debug
modifié : Templates/MessageBox.goml
Deep clone
modifié : src/GraphicObjects/GraphicObject.cs
modifié : src/GraphicObjects/Group.cs
Deep clone and code clean
modifié : src/GraphicObjects/PrivateContainer.cs
modifié : src/GraphicObjects/RadioButton.cs
Diffstat (limited to 'src')
| -rw-r--r-- | src/GraphicObjects/CheckBox.cs | 12 | ||||
| -rw-r--r-- | src/GraphicObjects/GraphicObject.cs | 15 | ||||
| -rw-r--r-- | src/GraphicObjects/Group.cs | 7 | ||||
| -rw-r--r-- | src/GraphicObjects/PrivateContainer.cs | 48 | ||||
| -rw-r--r-- | src/GraphicObjects/RadioButton.cs | 11 |
5 files changed, 25 insertions, 68 deletions
diff --git a/src/GraphicObjects/CheckBox.cs b/src/GraphicObjects/CheckBox.cs index f8193e24..61b581ed 100644 --- a/src/GraphicObjects/CheckBox.cs +++ b/src/GraphicObjects/CheckBox.cs @@ -49,17 +49,7 @@ namespace Crow caption = value; NotifyValueChanged ("Caption", caption); } - } - [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.checkbox.svg")] - public string Image { - get { return image; } - set { - if (image == value) - return; - image = value; - NotifyValueChanged ("Image", image); - } - } + } [XmlAttributeAttribute()][DefaultValue(false)] public bool IsChecked { diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 865e664c..3bdc354d 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -1443,17 +1443,20 @@ namespace Crow continue; if (pi.Name == "DataSource") continue; -// object[] att = pi.GetCustomAttributes (false); -// foreach (object o in att) { -// XmlIgnoreAttribute xia = o as XmlIgnoreAttribute; -// if (xia != null) -// continue; -// } pi.SetValue(result, pi.GetValue(this)); } return result; } #endregion + /// <summary> + /// full GraphicTree clone with binding definition + /// </summary> + public virtual GraphicObject DeepClone(){ + GraphicObject tmp = Clone () as GraphicObject; + foreach (Binding b in this.bindings) + tmp.Bindings.Add (new Binding (new MemberReference (tmp, b.Source.Member), b.Expression)); + return tmp; + } } } diff --git a/src/GraphicObjects/Group.cs b/src/GraphicObjects/Group.cs index 48f835ac..3323a9b4 100644 --- a/src/GraphicObjects/Group.cs +++ b/src/GraphicObjects/Group.cs @@ -362,5 +362,12 @@ namespace Crow c.ClearBinding (); base.ClearBinding (); } + public override GraphicObject DeepClone () + { + Group tmp = base.DeepClone () as Group; + foreach (GraphicObject c in Children) + tmp.AddChild (c.DeepClone ()); + return tmp; + } } } diff --git a/src/GraphicObjects/PrivateContainer.cs b/src/GraphicObjects/PrivateContainer.cs index 1bf53de4..14c2a680 100644 --- a/src/GraphicObjects/PrivateContainer.cs +++ b/src/GraphicObjects/PrivateContainer.cs @@ -168,28 +168,15 @@ namespace Crow } protected override void UpdateCache (Context ctx) { - //ctx.Save (); - Rectangle rb = Slot + Parent.ClientRectangle.Position; using (ImageSurface cache = new ImageSurface (bmp, Format.Argb32, Slot.Width, Slot.Height, 4 * Slot.Width)) { Context gr = new Context (cache); - //clip to client zone - CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius); - gr.Clip (); - if (Clipping.count > 0) { - Clipping.clearAndClip (gr); - if (child != null) { - - base.onDraw (gr); - - - child.Paint (ref gr); - } + onDraw (gr); } gr.Dispose (); @@ -198,33 +185,7 @@ namespace Crow ctx.Paint (); } Clipping.Reset(); - - //ctx.Restore (); } -// public override Rectangle ContextCoordinates (Rectangle r) -// { -// return -// Parent.ContextCoordinates(r) + Slot.Position + ClientRectangle.Position; -// } -// public override void Paint(ref Cairo.Context ctx) -// { -// if (!Visible)//check if necessary?? -// return; -// -// ctx.Save(); -// -// base.Paint(ref ctx); -// -// //clip to client zone -// CairoHelpers.CairoRectangle (ctx, Parent.ContextCoordinates(ClientRectangle + Slot.Position), CornerRadius); -// ctx.Clip(); -// -// if (child != null) -// child.Paint(ref ctx); -// -// ctx.Restore(); -// } - #endregion #region Mouse handling @@ -243,6 +204,13 @@ namespace Crow child.ClearBinding (); base.ClearBinding (); } + public override GraphicObject DeepClone () + { + PrivateContainer tmp = base.DeepClone () as PrivateContainer; + if (child != null) + tmp.SetChild (child.DeepClone ()); + return tmp; + } } } diff --git a/src/GraphicObjects/RadioButton.cs b/src/GraphicObjects/RadioButton.cs index ffd5ba27..35c96c30 100644 --- a/src/GraphicObjects/RadioButton.cs +++ b/src/GraphicObjects/RadioButton.cs @@ -67,17 +67,6 @@ namespace Crow NotifyValueChanged ("Caption", caption); } } - [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.radiobutton.svg")] - public string Image { - get { return image; } - set { - if (image == value) - return; - image = value; - NotifyValueChanged ("Image", image); - } - } - [XmlAttributeAttribute()][DefaultValue(false)] public bool IsChecked { |