aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/ProgressBar.cs
blob: 6e1ce404b5761c6eed6553225570be66ff0b635b (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
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
{
	
	public class ProgressBar : NumericControl
    {
		#region CTOR
		public ProgressBar() : base(){}
		#endregion

		protected override void loadTemplate (GraphicObject template)
		{
			
		}

		#region GraphicObject overrides
		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
    }
}