The SECMarquee implements a marquee control that scrolls text across its window. You can configure the fonts, colors, scrolling speed, and wrapping mode. In addition, you can easily change them at run time. Because it is CWnd-derived, you can embed SECMarquee in a view or dialog like any other control.
You can use objects instantiated from SECMarquee anywhere a CStatic can be used. You can attach the object to an existing CStatic control via the AttachStatic() method or create it dynamically via the Create() method.
To attach an SECMarquee instance to an existing CStatic instance:
Call the AttachStatic() method with the control ID of the static control to attach the SECMarquee instance. For example:
m_wndMarquee.AttachStatic(IDC_MARQUEE_STATIC,this); |
To create an SECMarquee instance dynamically:
Create a unique control ID for the control. In Visual Studio, you can create a control ID in the Resource Includes dialog.
Call the Create() method. For example:
Rect rect(0,0,100,50); // initial rectangle m_wndMarquee.Create(rect,this,strMarqueeText); |
To start and stop the SECMarquee:
The Scroll() method controls the scrolling of the marquee.
Table 17 lists the five methods that allow you to customize the text, the text font, scrolling speed, foreground/background colors, and wrapping mode at run time.
Method | Description |
SetScrollDelay() | Sets scrolling delay. |
SetTextWrap() | Sets text wrapping mode. |
SetColors() | Sets foreground and background colors. |
SetWindowText() | Sets/resets marquee message text. |
SetFont() | Set the marquee font. |
For more information about these methods, see the Objective Toolkit Class Reference.
To modify the SECMarquee behaviors:
Nearly all the public and protected methods of SECMarquee are virtual so you can override them. Some of the virtual callbacks provided by this class are as follows:
Method | Behavior |
OnScrollStart() | Called when a new message is about to start scrolling. |
OnScrollComplete() | Called when an existing message is about to finish. |
OnInitMarquee() | Called when the marquee is initializing. |
OnScrollMarquee() | Called when the marquee is scrolling one frame. |
Some of the methods that you can override to alter the appearance of the SECMarquee class include:
Method | Behavior |
Draw3Dborder() | Draws a 3D border around the marquee control. |
DoPaint() | Paints the marquee control. |
The statbar sample in the Samples\Toolkit\MFC\UIExt\statbar directory demonstrates how to the use the marquee control in an SECStatusBar. This sample is not shipped with the product. For information on how to obtain this sample, see Section 3.6.1, "Location of Sample Code," in the Stingray Studio Getting Started Guide.
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.