Click here to Skip to main content
11,640,788 members (60,123 online)
Click here to Skip to main content

Pie Progress Control

, 22 Aug 2000 65.7K 1.8K 17
Rate this:
Please Sign up or sign in to vote.
A progress control with a difference
<!-- Download Links -->
  • Download source files - 4 Kb
  • Download demo project - 32 Kb
  • <!-- Article image -->

    Sample Image - piectrl.jpg

    <!-- Main HTML starts here -->

    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

    Share

    About the Author

    NormDroid
    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

    You may also be interested in...

    Comments and Discussions

     
    Generaltake a look @ this Pin
    eRRaTuM9-Jun-05 23:36
    membereRRaTuM9-Jun-05 23:36 
    GeneralRe: take a look @ this Pin
    norm.net9-Jun-05 23:47
    membernorm.net9-Jun-05 23:47 
    Generalexe problem Pin
    salah_gis18-Dec-02 0:28
    membersalah_gis18-Dec-02 0:28 
    GeneralDll question Pin
    salah_gis18-Dec-02 0:26
    membersalah_gis18-Dec-02 0:26 
    Generallets add more to it Pin
    aeropriest9-Apr-02 8:19
    memberaeropriest9-Apr-02 8:19 
    GeneralRe: lets add more to it Pin
    Norm Almond9-Apr-02 22:31
    memberNorm Almond9-Apr-02 22:31 
    GeneralRe: lets add more to it Pin
    aeropriest9-Apr-02 23:06
    memberaeropriest9-Apr-02 23:06 

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

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

    | Advertise | Privacy | Terms of Use | Mobile
    Web03 | 2.8.150731.1 | Last Updated 23 Aug 2000
    Article Copyright 2000 by NormDroid
    Everything else Copyright © CodeProject, 1999-2015
    Layout: fixed | fluid