mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
31 lines
1.2 KiB
C#
31 lines
1.2 KiB
C#
|
|
using System;
|
||
|
|
using System.ComponentModel;
|
||
|
|
using System.Drawing;
|
||
|
|
using System.Windows.Forms;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
|
||
|
|
namespace ProgressODoom {
|
||
|
|
[ToolboxBitmapAttribute(typeof(ProgressODoom.RarProgressBar), "Icons.RarProgressBar.ico")]
|
||
|
|
public class RarProgressBar : DualProgressBar {
|
||
|
|
public RarProgressBar() {
|
||
|
|
this.MasterPainter = new RarProgressPainter(RarProgressPainter.RarProgressType.Silver);
|
||
|
|
((RarProgressPainter)this.MasterPainter).ShowEdge = false;
|
||
|
|
this.ProgressPainter = new RarProgressPainter(RarProgressPainter.RarProgressType.Gold);
|
||
|
|
((RarProgressPainter)this.ProgressPainter).ShowEdge = true;
|
||
|
|
this.BorderPainter = new RarBorderPainter();
|
||
|
|
this.BackgroundPainter = new RarBackgroundPainter();
|
||
|
|
this.PaintMasterFirst = true;
|
||
|
|
this.OnValueChanged += new EventHandler(onValueChanged);
|
||
|
|
this.OnMasterValueChanged += new EventHandler(onValueChanged);
|
||
|
|
}
|
||
|
|
|
||
|
|
private void onValueChanged(object sender, EventArgs e) {
|
||
|
|
bool masterAhead = false;
|
||
|
|
if (this.MasterValue > this.Value) {
|
||
|
|
masterAhead = true;
|
||
|
|
}
|
||
|
|
((RarProgressPainter)this.MasterPainter).ShowEdge = masterAhead;
|
||
|
|
((RarProgressPainter)this.ProgressPainter).ShowEdge = !masterAhead;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|