Visual Studio 6Visual C++ 7.0Windows 2000Visual C++ 6.0Windows XPMFCIntermediateDevVisual StudioWindowsC++
CStarWarsCtrl - Star Wars Credits Control






4.95/5 (12 votes)
Jul 18, 2002

211024

4198
This is an attempt to create a control which looks like the credits of the Star Wars movies.
Description
This is an attempt to create a control which looks like the credits of the Star Wars movies.
Only a few simple GDI functions are used to establish this effect: Ellipse
for the stars in the background and
StretchBlt
for scrolling text. The control is derived from CStatic
.
Usage
To use the class in your application you need to do the following:
- Insert the .h and .cpp files into your project.
- Add a static control into your dialog resource.
- Add a member variable for that static control.
- Initialize the eventsink
- Modify the variable declaration.
- In your
InitDialog
message handler set the speed and add some text. Use these member functions:
Change this:
CStatic m_StarWarsCtrl;To this:
CStarWarsCtrl m_StarWarsCtrl;
m_StarWarsCtrl.SetStarSpeed(30); m_StarWarsCtrl.SetScrollSpeed(2); m_StarWarsCtrl.AddTextLine("A long time ago"); m_StarWarsCtrl.AddTextLine(""); m_StarWarsCtrl.AddTextLine("in a galaxy far far away"); m_StarWarsCtrl.AddTextLine(""); m_StarWarsCtrl.AddTextLine("this application was programmed by"); m_StarWarsCtrl.AddTextLine(""); m_StarWarsCtrl.AddTextLine("Pablo van der Meer"); m_StarWarsCtrl.AddTextLine("");