[Classes] [Prev] [Next] [Methods]

CText

Methods Index

Heritage
Description
Usage
Enum
Environment
Protected Data Members
Public Methods
Constructor, Destructor, and Initializer Methods
Setting and Getting Text
Selecting Text
Sizing Utilities
Inherited Utilities
Placing Text
Protected Methods
Overrides

CText


Heritage

Superclass: CView

Subclasses: None


Description

CText is a static text drawing class. Also, it is the only text object in XVT-Power++ that can be set in color instead of black and white. Use it instead of the more complete NTextEdit or NLineText when you simply need to display a static, read-only line of text in a window. Examples of use include titles, one line instructions, and button names. If you need to display multiple lines or paragraphs, use the NTextEdit class (which can be specified to be read only).


Usage

To use the CText class, create and initialize a CText object.


Environment

Text is drawn in the foreground color, which you can set. The background for text is either transparent (whatever was already there shows through) or opaque. If the text is drawn opaquely, the spaces between and around the letters are drawn in the background color, which you can set. Also, CText has a method for setting its font.


Enum

Placement

NONE
LEFT
RIGHT
CENTER

Indicates justification for text relative to its frame.


Protected Data Members

BOOLEAN itIsOpaque; Whether the background is transparent or opaque
BOOLEAN itIsSelected; Whether the text is selected
int itsAscent; The drawing distance from the top
Placement itsPlacement; The placement of the text
long itsPhysicalTextWidth Width in pixels according to font.


Public Methods

Constructor, Destructor, and Initializer Methods

CText(CSubview* theEnclosure, 
const CPoint& theTopLeft,
const CStringRW& theText = NULLString);
CText(CSubview* theEnclosure, 
const CRect& theRegion,
const CStringRW& theText = NULLString);
CText(const CText& theText);
CText& operator=(const CText& theText);
virtual ~CText(void);
BOOLEAN IText(const CStringRW& theText, 
BOOLEAN isOpaque = FALSE,
Boolean isVisible = TRUE,
GLUETYPE theGlue = NULLSTICKY);

Setting and Getting Text

virtual void SetText(const CStringRW& theText);
virtual void SetTitle(const CStringRW& theText);
virtual const CStringRW GetText(void) const;
virtual BOOLEAN IsOpaque(void) const;
virtual void SetOpaque(BOOLEAN isOpaque);

Selecting Text

virtual void Select(void);
virtual void Deselect(void);
virtual BOOLEAN IsSelected(void) const;

Sizing Utilities

virtual UNITS GetHeight(void) const;
virtual UNITS GetWidth(void) const;

Inherited Utilities

virtual void Draw(const CRect& theClippingRegion);
virtual void DoPrintDraw(const CRect& theClippingRegion);
virtual void SetFont(const CFont &theNewFont, 
BOOLEAN isUpdate = FALSE);
virtual void SetSizing(BOOLEAN isSizable);
virtual void Size(const CRect& theRect);

Placing Text

void SetPlacement(Placement thePlacement);
Placement GetPlacement(void) const;

Protected Methods

void RecalculateSize(void);

Overrides

You can override the selection routines with different selection actions.



[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.