Back


Digital Meter Control

Download source files - 3 Kb
Download demo project - 40 Kb


Introduction
This article explains how to add a digital meter control to your dialog-based application. This digital meter control is derived from CStatic. You can customize the digital meter as your requirements.

Using the code
Steps for adding the digital meter control to your application:

That's all. The digital meter control is in your application. Just execute the program to view it.

Member Functions
Following are the member functions which can be used to change the digital meter control settings:

void setType(int t);
//Set the type of the meter. 0=Horiz. 1=Vert.
.
void reDraw();
//Redraw the meter
.
void setLimit(double min,double max);
//Set the range of the meter
.
void setValue(double v);
//Set the dispaly value of the meter.
.
double getValue();
//Get the display value of the meter
.
void setBackgroundColor(int c1,int c2,int c3);
//Set the background of the meter. c1=Fill color. c2=First Border color. c3=Second Border color.
.
void setGradientColor(int c1,int c2);
//Set the gradient bar color. c1=First gradient color.. c2=Second gradient color..
.
void setScaleColor(int c1,int c2);
//Set the scale color. c1=Trangle color.. c2=Scale line color..
.
void setTextColor(int c1);
//Set the text color. c1=Text color.


.
.
.
.
.
.
.
.
.
.
.
.
.
.