dcsimg

Gradient Progress control

WEBINAR:
On-Demand

Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame


Gradient Progress Control (7961 bytes)  Download Source Code and Example

Development Environment: VC5, 95

This is a simple class to display a gradient fill progress control.  It works just like the normal progress control. The main enhancements are that you can customize the colors and toggle the percentage caption's visibility. 

The control can be incorporated into a project like any other CProgressCtrl derived control. Either create the control manually, subclass an existing CProgressCtrl, or use ClassWizard to DDX_control it.  The actual code for the progress control is located in GradientProgressCtrl.h and GradientProgressCtrl.cpp. I haven't fully tested it's robustness, although I don't suspect that it will fail miserably.  Most of the work happens in the DrawGradient(...) function, which also uses Keith Rule's MemDC class.  The sample project also uses Chris Maunder's ColourPicker.  Both of these classes are included in the sample project and can be downloaded elsewhere at this site.

It is derived from CProgressCtrl so all standard CProgressCtrl functions are available.  Additional functions are listed below.

I hope someone gives it a good home :).  Please let me know of any problems or improvements.  Thanks and good luck.

Member Set Functions

	void SetTextColor(COLORREF color)           // Set the percentage text color
	void SetBkColor(COLORREF color)             // Set background color
	void SetStartColor(COLORREF color)          // Set starting color
	void SetEndColor(COLORREF color)            // Set ending color
	void ShowPercent(BOOL bShowPercent = TRUE)  // Show the percent caption?

Member Get Functions

	COLORREF GetTextColor(void)		    
	COLORREF GetBkColor(void)	
	COLORREF GetStartColor(void)	
	COLORREF GetEndColor(void)

 

Last updated: 18 May 1998



Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

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

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date