Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Chart User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

7.6 Using SRGTextPanel

The SRGTextPanel class provides a multi-line text box with an adjustable title. The optional title bar has its own style and font member, so the title and body text can be styled individually. The text foreground color is selectable for both title and body text. The background style follows the conventions set by SRGraphComponent. You can fill the text and title sections with different colors, color gradients, or images.

The title bar may be placed on the top, bottom, or either side of the text panel. The font escapement and orientation are automatically determined.

The code below creates a text panel with a blue title bar on top of a white (default) body section.

Figure 104: Text panel produced by the above code

The body text is displayed by calling DrawText() with the DT_WORDBREAK option. Long text strings are automatically broken into lines. New line characters ('\n') may be used to force line breaks. By default, the text panel expands to contain the text, if possible.

To stop the component rectangle from expanding to fit the body text:

To allow the body text to autosize according to the window height:

To make the text resize:

To display a text panel without a title:



Previous fileTop of DocumentContentsNo linkNext file

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.