From: jpbruyere Date: Wed, 3 Aug 2016 09:16:56 +0000 (+0200) Subject: remove image property, set img as fixed in template X-Git-Tag: v0.4~18^2~17 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=c601f875010332cb4189a206a2c5ffa5fd6e8bea;p=jp%2Fcrow.git 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 --- diff --git a/Templates/CheckBox.goml b/Templates/CheckBox.goml index b19dcc12..ea566d0e 100755 --- a/Templates/CheckBox.goml +++ b/Templates/CheckBox.goml @@ -1,5 +1,6 @@  - + \ No newline at end of file diff --git a/Templates/MessageBox.goml b/Templates/MessageBox.goml index eef85052..dd63a10b 100644 --- a/Templates/MessageBox.goml +++ b/Templates/MessageBox.goml @@ -1,8 +1,10 @@ - + + Background="0.1,0.5,1,0,0.5"> diff --git a/Templates/RadioButton.goml b/Templates/RadioButton.goml index c44cc1f5..98f19c7d 100755 --- a/Templates/RadioButton.goml +++ b/Templates/RadioButton.goml @@ -1,5 +1,6 @@  - + \ No newline at end of file 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 + /// + /// full GraphicTree clone with binding definition + /// + 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 {