Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Pie Progress Control

0.00/5 (No votes)
22 Aug 2000 1  
A progress control with a difference
  • Download source files - 4 Kb
  • Download demo project - 32 Kb
  • Sample Image - piectrl.jpg

    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.

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here