--- /dev/null
-<Border Fit="true" BorderWidth="2">
-<Scroller CornerRadius="2" CacheEnabled="false" VerticalScrolling="true" Height="200" Width="300" Background="DimGray" Margin="2">
- <VerticalStack Margin="10" VerticalAlignment="Top" Fit="true" Background="vgradient|0:BlueCrayola|1:Black">
+ <?xml version="1.0"?>
++<Border Fit="true" BorderWidth="2" >
++<Scroller CornerRadius="2" VerticalScrolling="true" Height="200" Width="300" Background="DimGray" Margin="2">
++ <VerticalStack Margin="10" VerticalAlignment="Top" Fit="true" Background="vgradient|0:BlueCrayola|1:Black" >
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 1"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 2"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 3"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 4"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 5"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 6"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 7"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 8"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 9"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 10"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 11"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 12"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 13"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 14"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 15"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 16"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 17"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 18"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 19"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 20"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 21"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 22"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 23"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 24"/>
+ <Label MouseEnter="{Background=Gray}" MouseLeave="{Background=hgradient|0:DarkRed|1:Transparent}" Margin="5" Background="hgradient|0:DarkRed|1:Transparent" Font="droid,20" Text="label 25"/>
+ </VerticalStack>
+ </Scroller>
+ </Border>
+ <!--<VerticalStack Fit="true" Margin="50" Background="LimeGreen" CacheEnabled="false"
+ HorizontalAlignment="Right" VerticalAlignment="Bottom"
+ MouseEnter="{Background=Gray}"
+ MouseLeave="{Background=LimeGreen}">
+
+ <CheckBox Margin="20" Background="BlueCrayola"/>
+ <CheckBox/>
+ <CheckBox/>
+ <CheckBox/>
+ <CheckBox/>
+ <RadioButton/>
+ <RadioButton/>
+ <RadioButton/>
+ <RadioButton/>
+ <RadioButton/>
+ <CheckBox/>
+
+ <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
+ MouseEnter="{Background=DimGray}" Width="100"
+ MouseLeave="{Background=BlueCrayola}"
+ Margin="10" Text="{fps}" Background="BlueCrayola"/>
+ <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
+ MouseEnter="{Background=DimGray}" Width="100"
+ MouseLeave="{Background=BlueCrayola}"
+ Margin="10" Text="{drawing}" Background="BlueCrayola"/>
+ </VerticalStack>-->
break;
}
}
-
- public override Rectangle ContextCoordinates (Rectangle r)
+ protected override void onDraw (Context gr)
{
- return
- Parent.ContextCoordinates(r) + Slot.Position + ClientRectangle.Position;
+ base.onDraw (gr);
+
+ gr.Save ();
+ //clip to client zone
+ CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius);
+ gr.Clip ();
+
+ if (child != null)
+ child.Paint (ref gr);
+ gr.Restore ();
}
- public override void Paint(ref Cairo.Context ctx, Rectangles clip = null)
+ protected override void UpdateCache (Context ctx)
{
- if (!Visible)//check if necessary??
- return;
+ //ctx.Save ();
- ctx.Save();
+ Rectangle rb = Slot + Parent.ClientRectangle.Position;
- if (clip != null)
- clip.clip(ctx);
+ using (ImageSurface cache = new ImageSurface (bmp, Format.Argb32, Slot.Width, Slot.Height, 4 * Slot.Width)) {
+ Context gr = new Context (cache);
- base.Paint(ref ctx, clip);
++ //clip to client zone
++ CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius);
++ gr.Clip ();
- //clip to client zone
- CairoHelpers.CairoRectangle (ctx, Parent.ContextCoordinates(ClientRectangle + Slot.Position), CornerRadius);
- ctx.Clip();
+ if (Clipping.count > 0) {
+
+ Clipping.clearAndClip (gr);
+
+ if (child != null) {
+
+ base.onDraw (gr);
- if (child != null)
- child.Paint(ref ctx, clip);
- //clip to client zone
- CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius);
- gr.Clip ();
- ctx.Restore();
+ child.Paint (ref gr);
+ }
+ }
+
+ gr.Dispose ();
+
+ ctx.SetSourceSurface (cache, rb.X, rb.Y);
+ 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