📄 gradient_progress.shtml
字号:
<html>
<!-- Header information-->
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<meta NAME="Author" CONTENT="Chris Maunder">
<title>Controls - Gradient Fill Progress Control</title>
</head>
<!-- Set background properties -->
<body background="../fancyhome/back.gif" bgcolor="#FFFFFF" link="#B50029" vlink="#8E2323" alink="#FF0000">
<!-- A word from our sponsors... -->
<table WIDTH="100%">
<tr WIDTH="100%"><td align=center><!--#exec cgi="/cgi/ads.cgi"--><td></tr>
</table>
<!-- Article Title -->
<h3 align="center"><font COLOR="#AOAO99">Gradient Fill Progress Control </font></h3>
<hr align="center">
<!-- Author and contact details -->
<p>This article was contributed by <a HREF="mailto:mweagle@redrose.net">Matt Weagle</a>.
<!-- Sample image and source code/demo project --> </p>
<p><img src="gradient_progress.gif" alt="Gradient Progress Control (7961 bytes)"
WIDTH="391" HEIGHT="308"> <a HREF="gradient_progress_demo.zip">Download Source Code
and Example</a> </p>
<p>Development Environment: VC5, 95</p>
<!-- The article... -->
<p>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. </p>
<p>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. </p>
<p>It is derived from CProgressCtrl so all standard CProgressCtrl functions are
available. Additional functions are listed below. </p>
<p>I hope someone gives it a good home :). Please let me know of any problems or
improvements. Thanks and good luck. </p>
<p><b>Member Set Functions</b> </p>
<pre><tt><font COLOR="#990000"> 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?
</font></pre>
</tt>
<p><b>Member Get Functions</b> </p>
<pre><tt><font COLOR="#990000"> COLORREF GetTextColor(void)
COLORREF GetBkColor(void)
COLORREF GetStartColor(void)
COLORREF GetEndColor(void)
</font></pre>
</tt>
<p> </p>
<!-- Remember to update this -->
<p>Last updated: 18 May 1998 </p>
<hr>
<!-- Codeguru contact details -->
<table BORDER="0" WIDTH="100%">
<tr>
<td WIDTH="33%"><font SIZE="-1"><a HREF="http://www.codeguru.com">Goto HomePage</a></font></td>
<td WIDTH="33%"><p align="center"><font SIZE="-2">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -