Click here to Skip to main content
15,867,308 members
Articles / Desktop Programming / MFC
Article

Pie Progress Control

Rate me:
Please Sign up or sign in to vote.
2.78/5 (3 votes)
22 Aug 2000 75K   2K   19   7
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


    Written By
    Software Developer (Senior) Software Kinetics
    United Kingdom United Kingdom




    Software Kinetics
    are experts in developing customised and bespoke applications and have expertise in the development of desktop, mobile and internet applications on Windows.


    We specialise in:

    • User Interface Design
    • Desktop Development
    • Windows Phone Development
    • Windows Presentation Framework
    • Windows Forms
    • Windows Communication Framework
    • Windows Services
    • Network Applications
    • Database Applications
    • Web Development
    • Web Services
    • Silverlight
    • ASP.net


    Visit Software Kinetics

    Comments and Discussions

     
    Generaltake a look @ this Pin
    eRRaTuM9-Jun-05 23:36
    eRRaTuM9-Jun-05 23:36 
    GeneralRe: take a look @ this Pin
    NormDroid9-Jun-05 23:47
    professionalNormDroid9-Jun-05 23:47 
    Generalexe problem Pin
    salah_gis18-Dec-02 0:28
    salah_gis18-Dec-02 0:28 
    GeneralDll question Pin
    salah_gis18-Dec-02 0:26
    salah_gis18-Dec-02 0:26 
    Generallets add more to it Pin
    Ashok Jaiswal9-Apr-02 8:19
    Ashok Jaiswal9-Apr-02 8:19 
    GeneralRe: lets add more to it Pin
    NormDroid9-Apr-02 22:31
    professionalNormDroid9-Apr-02 22:31 
    GeneralRe: lets add more to it Pin
    Ashok Jaiswal9-Apr-02 23:06
    Ashok Jaiswal9-Apr-02 23:06 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.