Download source files - 4 Kb
Download demo project - 32 Kb
Introduction
This article shows the use of a pie progress control. The code is
encapsulated in a MFC class. The class itself is derived from a CStatic
class.
The code demonstrates the how perform flicker free drawing. The control works in
a similar way to the standard Windows progress control.
The main core of the code is in the drawing routine (OnPaint
).
The public interface to access the class is shown here...
void SetTextColor(COLORREF crColor);
void SetBkColor(COLORREF crColor);
void SetPieOutlineColor(COLORREF crColor);
void ShowText(BOOL bText);
void SetStep(int nStep);
void GetRange(int& nLower, int& nUpper);
void SetRange(int nLower, int nUpper);
void PieOutlineColorEnable(BOOL bState);
int StepIt();
int OffsetPos(int nOffset);
int GetPos();
int SetPos(int nPos);
The class is created with the window default Create()
member. The control can
be any shape or size. The example code also shows how to add a client edge to
the window.
The next version will allow:
- Text orientation and sizing.
- Gradient coloring.
- Optional background bitmap.
- Jaggies removed.