blob: e3f778bfdbe8da40cc29f3e632b6674a321bfa67 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cairo;
using System.Diagnostics;
using System.Xml.Serialization;
using System.ComponentModel;
namespace Crow
{
[Serializable]
public class ProgressBar : NumericControl
{
#region CTOR
public ProgressBar() : base(){}
#endregion
protected override void loadTemplate (GraphicObject template)
{
}
#region GraphicObject overrides
[XmlAttributeAttribute()][DefaultValue("vgradient|0:BlueCrayola|0,5:SkyBlue|1:BlueCrayola")]
public override Fill Foreground {
get { return base.Foreground; }
set { base.Foreground = value; }
}
protected override void onDraw (Context gr)
{
base.onDraw (gr);
Rectangle rBack = ClientRectangle;
rBack.Width = (int)((double)rBack.Width / Maximum * Value);
Foreground.SetAsSource (gr, rBack);
CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);
gr.Fill();
}
#endregion
}
}
|