EZSnakeCtrl-Indefinite Cyclic Progress control

Tuesday Jul 27th 1999 by V. Lakshmi Narasimhan

EZSnakeCtrl-Indefinite Cyclic Progress control

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);

 int StepIt();//Move the snake.
 void ResetProgress();//reset the snake

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


Download demo project - 71 Kb
Download source - 3 Kb
Mobile Site | Full Site