]> O.S.I.I.S - jp/crow.git/commitdiff
remove image property, set img as fixed in template
authorjpbruyere <jp.bruyere@hotmail.com>
Wed, 3 Aug 2016 09:16:56 +0000 (11:16 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Wed, 3 Aug 2016 09:16:56 +0000 (11:16 +0200)
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

Templates/CheckBox.goml
Templates/MessageBox.goml
Templates/RadioButton.goml
src/GraphicObjects/CheckBox.cs
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/Group.cs
src/GraphicObjects/PrivateContainer.cs
src/GraphicObjects/RadioButton.cs

index b19dcc125d533266c296aa06edb6cc0f9e66759b..ea566d0e01a7b1e61c45dcedeca2f9793b50293d 100755 (executable)
@@ -1,5 +1,6 @@
 <?xml version="1.0"?>
 <HorizontalStack Margin="1" Spacing="1" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
-       <Image Margin="2" Width="14"  Height="14" Path="{../../Image}" SvgSub="{../../IsChecked}"/>
+       <Image Margin="2" Width="14"  Height="14" Path="#Crow.Images.Icons.checkbox.svg"
+               SvgSub="{../../IsChecked}"/>
        <Label Font="{../../Font}" Text="{../../Caption}" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}"/>
 </HorizontalStack>
\ No newline at end of file
index eef85052037bc5a0a6e5dd7643654e88c53b5fc7..dd63a10b76bc55e32ad9c1bacefcb74255334172 100644 (file)
@@ -1,8 +1,10 @@
 <?xml version="1.0"?>
-<Border Height="{../HeightPolicy}" Width="{../WidthPolicy}" BorderWidth="1" Foreground="White" CornerRadius="10" >
+<Border Height="{../HeightPolicy}" Width="{../WidthPolicy}" BorderWidth="1" Foreground="White" CornerRadius="10"
+                               MouseEnter="../onBorderMouseEnter"
+                               MouseLeave="../onBorderMouseLeave">
        <VerticalStack Height="{../../HeightPolicy}" Width="{../../WidthPolicy}" Background="0.4,0.4,0.4,0.4">
                <Border BorderWidth="1" Foreground="White" Width="{../../../WidthPolicy}" Height="-1" 
-                               Background="0.1,0.5;1,0,0.5">
+                               Background="0.1,0.5,1,0,0.5">
                        <HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{../../../../WidthPolicy}" Height="-1" >
                                <GraphicObject Width="5" Height="5"/>
                                <Image Margin="1" Width="12" Height="12" Path="{../../../../../Icon}"/>
index c44cc1f52ab879a91ebb8b2eae742cc4c687447d..98f19c7de1a42a9490a218437bed236195adae78 100755 (executable)
@@ -1,5 +1,6 @@
 <?xml version="1.0"?>
 <HorizontalStack Spacing="1" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
-       <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../IsChecked}"/>
+       <Image Margin="2" Width="14" Height="14" Path="#Crow.Images.Icons.radiobutton.svg"
+               SvgSub="{../../IsChecked}"/>
        <Label Text="{../../Caption}" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}"/>
 </HorizontalStack>
\ No newline at end of file
index f8193e242c77ed78e3c508f0ffc05e4c23587d2c..61b581edec7fa512b49c07108bf4fedc4f126093 100644 (file)
@@ -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
                {
index 865e664ce5df43ca6628bf3bb65792aff007cc21..3bdc354d53e1cf95c0216e92ff5afb8238eb861e 100644 (file)
@@ -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;
+               }
        }
 }
index 48f835acd902e3e75c95011f899f695f519cc75d..3323a9b452b9134e41855c635b9a10f7fdc78b98 100644 (file)
@@ -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;
+               }
        }
 }
index 1bf53de44f49de34674315195b12e3674712432b..14c2a68019bf992b396361a88b107c7490f88cfe 100644 (file)
@@ -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;
+               }
        }
 }
 
index ffd5ba27d125830dc9bb5e4880e7e4f41234d915..35c96c309336b41abe3fb9bd8cd3fa099248e812 100644 (file)
@@ -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
         {