Bitmap progress control

CProgressST features:
  • Standard CProgressCtrl properties
  • Support for 256+ colors bitmaps
  • Support for negative ranges!
  • Easy to use!
  • Written in Visual C++ v5.0
  • Full source code included!
  • It's free!

You are encouraged to use this class everywhere you want; there is no fee required for CProgressST. Freely add modifications and/or fix bugs, but please, send any of these to SoftechSoftware!

How to integrate CProgressST in your application

  1. In your project include the following files:
    
            ProgressST.h
            ProgressST.cpp
    
  2. You also need a bitmap that will be displayed inside the progress bar.

    For example include in your project Cornicetta.bmp and call it IDB_CORNICETTA.

    With dialog editor create a progress bar called, for example, IDC_CORNICETTA and create a member variable for it:

    
            CProgressST m_prgCornicetta;
    
    Now attach the progress bar to CProgressST. In your OnInitDialog procedure:
    
            // Call the base method
            CDialog::OnInitDialog();
    
            // Create the IDC_CORNICETTA progress bar with bitmap
            m_prgCornicetta.SubclassDlgItem(IDC_CORNICETTA, this);
    

    The control will have the same default range and start position as in the base MFC class CProgressCtrl. These values can be modified using the same members of the base class as, for example, SetRange(...) or SetPos(...) At this moment OffsetPos(...) is not supported.

    By default the control will draw itself just like a normal progress bar. A bitmap can be assigned to get a progress bar showing it instead of normal standard blocks!

    This bitmap will be tiled to paint the necessary portion of the progress bar; it will not shrinked or enlarged in any manner.

  3. Assign a bitmap to the progress bar:
    
            // Assign bitmap
            m_prgCornicetta.SetBitmap(IDB_CORNICETTA);
        
        

    Your progress bar is now a CProgressST!

    Look inside the demo program to learn more about CProgressST. This is the best way!




CProgressST members



BOOL SetBitmap(UINT nBitmapId = NULL, BOOL bRepaint = TRUE);
Assign a bitmap to the progress bar

Input values:
  • nBitmapId
    The resource bitmap to use
  • bRepaint
    If TRUE the control is immediately redrawn
Return value:
Nonzero if successful; otherwise 0.

Example:
m_prgCornicetta.SetBitmap(IDB_CORNICETTA);
m_prgCornicetta.SetBitmap(); // To remove bitmap and draw as a standard progress bar


static const int GetVersionI()
static const char* GetVersionC()

Return CProgressST version

Example:
int nVer = CProgressST::GetVersionI(); // Divide by 10 to get actual version
char szVer[20];
strcpy(szVer, CProgressST::GetVersionC());



History

  • CProgressST v1.0
    First release

Things to do

  • Any suggestion?

Download demo project - 190 KB



Comments

  • Very slick control, I like it!

    Posted by Legacy on 01/05/2001 12:00am

    Originally posted by: Kory

    Thats a great idea, and simple to use. It looks really cool drawing a bitmap of the standard blocks for the progress bar, and then putting lighting effects and streaks over the bars. Then when your control begins showing the bitmap, it looks like its showing the normal blocks progress bar but with cool lighting effects. Nice!

    Kory
    www.DummySoftware.com

    Reply
  • Vertical Progress Bar

    Posted by Legacy on 08/21/1999 12:00am

    Originally posted by: Cris Padilla Tagle

    This is cool in did! However, I've noticed that it doen't seem to work with vertical progress bars. Or perhaps I am simply doing it the wrong way. Anyway, I hope that you could help me use this class of yours with vertical progress bars.

    Thank you very much.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Adaptation and evolution are fundamental requirements of survival -- not only in nature, but also in business. Our world has changed dramatically in a short amount of time. Many businesses are fueling and capitalizing on this change, while others are desperately clinging to a bygone era. Who is left standing in the years and decades ahead should come as no surprise. This edition of Unleashing IT highlights the companies that are embracing new circumstances, new methods, and new opportunities. By downloading …

  • Live Event Date: September 19, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT In response to the rising number of data breaches and the regulatory and legal impact that can occur as a result of these incidents, leading analysts at Forrester Research have developed five important design principles that will help security professionals reduce their attack surface and mitigate vulnerabilities. Check out this upcoming eSeminar and join Chris Sherman of Forrester Research to learn how to deal with the influx of new device …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds