★ wanayoo — archive 1999 http://codeguru.developer.com/controls/EZSnakeCtrl.shtmlNouvelle recherche | Portail wanayoo
Compaq NonStop
Developer.com Click Here!
Click Here!
Find:
 

EXPERT SEARCH
-----
Site
visual c++
java
visual basic
javascripts
recommend it
 
Shopping
codeguru store
 
Contest
mfc codeguru
submission guidelines
 
Book
thinking in c++
stl programmer's guide
reviews
 
Interact
forums
newsgroups
guest book
jobs
jokes
open faq
what's new
 
Other
about
links
newsletters
privacy
tools
 

-----
Visual C++ by E-mail:

Get the weekly e-mail highlights on
Visual C++!
-----




EarthWeb Sites:
CROSSNODES
DATAMATION
DEVELOPER.COM
DICE
DISCUSSIONS
EARTHWEB.COM
EARTHWEB DIRECT
EARTHWEB EVENTS
ERP HUB
GAMELAN
GOCERTIFY
HTML GOODIES
INTRANET JOURNAL
ITKNOWLEDGE
ITLIBRARY
JARS
JAVA GOODIES
JAVASCRIPTS.COM
OPEN SOURCE IT
PERL JOURNAL
ROADCODERS
SYSOPT.COM
SUPPORTSOURCE
Y2KINFO

EarthWeb Worldwide

   

EZSnakeCtrl-Indefinite Cyclic Progress control


This article was contributed by V. Lakshmi Narasimhan.

Environment: Visual C++ 6 (SP2), Windows 98

I got the hunch from Netscape's progress control in the status bar. Since most of the complexity is hidden in the implementation, using this is as easy as using a normal progress bar. This control is not derived from CProgressBarctrl but from CStatic to ensure simplicity and efficiency. An imitation of Netscape status bar as well as a dialog based demo like that of CGradientProgress is included in the sample zip file. If this control is used in a dialog box, simply put a CStatic Place holder in the dialog and subclass it to CEZSnakeCtrl. Now you can customize the look & feel of the control. Various options available are:


 //Get & Set The Maximum value of the progress control
 //0 is assumed as the minimum.
 int GetMax();
 void SetMax(int nMax); 

 //Get & Set the size of the snake      
 int GetSize();
 void SetSize(int nSize);

 //Get & Set the the Steps ->unit increment
 int GetStep();
 void SetStep(int nStep);

 //Get The Head Position
 int GetPos();

 //Get The tail position
 int GetTail();

 //Get the direction of the snake
 BOOL IsReverse();

 //Get & Set the Gradient begin & end colors
 COLORREF GetGradientEndColor();
 COLORREF GetGradientStartColor();
 void SetGradientFill(COLORREF clrStart,COLORREF clrEnd);

 //Get & Set Background color
 COLORREF GetBkColor();
 void SetBkColor(COLORREF clrFG);

 //Operations<>BR
 int StepIt();//Move the snake.
 void ResetProgress();//reset the snake

I think the demo project can do rest of the explaining.

Downloads

Download demo project - 71 Kb
Download source - 3 Kb

History

Date Posted: July 27, 1999

Comments:

Add Comment

Give them a visit Click Here!

Click Here!

INSTANT EXPERTS!
Savvy IT Pros report on SupportSource. Take a look inside the largest vault of multi-vendor computing specs ever assembled. Click here for an In-depth Report,.

Learn about Free & Open Source software at the Bazaar Conference & Expo!,
December 14-16, 1999 in New York City! Click here for more information.

For tons of Windows technology resources, check out the Windows Programming directory.

Go to Fatbrain for the NEWEST and BEST technical books for IT professionals.

Get Linux Utilities for ONLY $34.95 at EarthWeb Direct.

Give them a visit Click Here!

Click Here!

Click Here!

Click Here!

Home About Us Search Subscribe Advertising Info Contact Us FAQs
Use of this site is subject to certain Terms & Conditions.
Earthweb's statement regarding our users' right to privacy.
Copyright ©1996-1999 EarthWeb Inc.. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of EarthWeb is prohibited.