<?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
<?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}"/>
<?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
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
{
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;
+ }
}
}
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;
+ }
}
}
}
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 ();
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
child.ClearBinding ();
base.ClearBinding ();
}
+ public override GraphicObject DeepClone ()
+ {
+ PrivateContainer tmp = base.DeepClone () as PrivateContainer;
+ if (child != null)
+ tmp.SetChild (child.DeepClone ());
+ return tmp;
+ }
}
}
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
{