Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
DisplayString Class Referenceabstract

#include <DisplayString.h>

Inherits MemoryPoolObject.

Inherited by W3DDisplayString.

Public Member Functions

 DisplayString (void)
 
virtual void setText (UnicodeString text)
 set text for this string
 
virtual UnicodeString getText (void)
 get text for this string
 
virtual Int getTextLength (void)
 return number of chars in string
 
virtual void notifyTextChanged (void)
 called when text has changed
 
virtual void reset (void)
 reset all contents of string
 
virtual void setFont (GameFont *font)
 set a font for display
 
virtual GameFontgetFont (void)
 return font in string
 
virtual void setWordWrap (Int wordWrap)=0
 Set the width that we want to start wrapping text.
 
virtual void setWordWrapCentered (Bool isCentered)=0
 If this is set to true, the text on a new line is centered.
 
virtual void draw (Int x, Int y, Color color, Color dropColor)=0
 render text
 
virtual void draw (Int x, Int y, Color color, Color dropColor, Int xDrop, Int yDrop)=0
 render text with the drop shadow being at the offsets passed in
 
virtual void getSize (Int *width, Int *height)=0
 get render size
 
virtual Int getWidth (Int charPos=-1)=0
 get text with up to charPos characters, 1- = all characters
 
virtual void setUseHotkey (Bool useHotkey, Color hotKeyColor)=0
 
virtual void setClipRegion (IRegion2D *region)
 clip text in this region
 
virtual void removeLastChar (void)
 remove the last character
 
virtual void appendChar (WideChar c)
 append character to end
 
DisplayStringnext (void)
 return next string
 
- Public Member Functions inherited from MemoryPoolObject
void deleteInstance ()
 

Public Attributes

friend DisplayStringManager
 

Protected Attributes

UnicodeString m_textString
 
GameFontm_font
 font to display this string with
 
DisplayStringm_next
 for the display string factory list ONLY
 
DisplayStringm_prev
 for the display string factory list ONLY
 

Additional Inherited Members

- Protected Member Functions inherited from MemoryPoolObject
virtual ~MemoryPoolObject ()
 
void * operator new (size_t s)
 
void operator delete (void *p)
 
virtual MemoryPoolgetObjectMemoryPool ()=0
 

Detailed Description

String representation that can also has additional information and methods for drawing to the screen

Definition at line 71 of file DisplayString.h.

Constructor & Destructor Documentation

◆ DisplayString()

DisplayString::DisplayString ( void )

Definition at line 74 of file DisplayString.cpp.

Member Function Documentation

◆ appendChar()

void DisplayString::appendChar ( WideChar c)
virtual

append character to end

Append character to the end of the string

Definition at line 139 of file DisplayString.cpp.

◆ draw() [1/2]

virtual void DisplayString::draw ( Int x,
Int y,
Color color,
Color dropColor )
pure virtual

render text

Implemented in W3DDisplayString.

◆ draw() [2/2]

virtual void DisplayString::draw ( Int x,
Int y,
Color color,
Color dropColor,
Int xDrop,
Int yDrop )
pure virtual

render text with the drop shadow being at the offsets passed in

Implemented in W3DDisplayString.

◆ getFont()

GameFont * DisplayString::getFont ( void )
inlinevirtual

return font in string

Definition at line 123 of file DisplayString.h.

◆ getSize()

virtual void DisplayString::getSize ( Int * width,
Int * height )
pure virtual

get render size

Implemented in W3DDisplayString.

◆ getText()

UnicodeString DisplayString::getText ( void )
inlinevirtual

get text for this string

Definition at line 120 of file DisplayString.h.

◆ getTextLength()

Int DisplayString::getTextLength ( void )
inlinevirtual

return number of chars in string

Definition at line 121 of file DisplayString.h.

◆ getWidth()

virtual Int DisplayString::getWidth ( Int charPos = -1)
pure virtual

get text with up to charPos characters, 1- = all characters

Implemented in W3DDisplayString.

◆ next()

DisplayString * DisplayString::next ( void )
inline

return next string

Definition at line 126 of file DisplayString.h.

◆ notifyTextChanged()

void DisplayString::notifyTextChanged ( void )
inlinevirtual

called when text has changed

Reimplemented in W3DDisplayString.

Definition at line 125 of file DisplayString.h.

◆ removeLastChar()

void DisplayString::removeLastChar ( void )
virtual

remove the last character

Remove the last character from the string text

Definition at line 127 of file DisplayString.cpp.

◆ reset()

void DisplayString::reset ( void )
virtual

reset all contents of string

Free and reset all the data for this string, effectively making this instance like brand new

Definition at line 114 of file DisplayString.cpp.

◆ setClipRegion()

void DisplayString::setClipRegion ( IRegion2D * region)
inlinevirtual

clip text in this region

Reimplemented in W3DDisplayString.

Definition at line 124 of file DisplayString.h.

◆ setFont()

void DisplayString::setFont ( GameFont * font)
inlinevirtual

set a font for display

Reimplemented in W3DDisplayString.

Definition at line 122 of file DisplayString.h.

◆ setText()

void DisplayString::setText ( UnicodeString text)
virtual

set text for this string

Copy the text to this instance

Definition at line 98 of file DisplayString.cpp.

◆ setUseHotkey()

virtual void DisplayString::setUseHotkey ( Bool useHotkey,
Color hotKeyColor )
pure virtual

Implemented in W3DDisplayString.

◆ setWordWrap()

virtual void DisplayString::setWordWrap ( Int wordWrap)
pure virtual

Set the width that we want to start wrapping text.

Implemented in W3DDisplayString.

◆ setWordWrapCentered()

virtual void DisplayString::setWordWrapCentered ( Bool isCentered)
pure virtual

If this is set to true, the text on a new line is centered.

Implemented in W3DDisplayString.

Member Data Documentation

◆ DisplayStringManager

friend DisplayString::DisplayStringManager

Definition at line 78 of file DisplayString.h.

◆ m_font

GameFont* DisplayString::m_font
protected

font to display this string with

Definition at line 110 of file DisplayString.h.

◆ m_next

DisplayString* DisplayString::m_next
protected

for the display string factory list ONLY

Definition at line 112 of file DisplayString.h.

◆ m_prev

DisplayString* DisplayString::m_prev
protected

for the display string factory list ONLY

Definition at line 113 of file DisplayString.h.

◆ m_textString

UnicodeString DisplayString::m_textString
protected

Definition at line 109 of file DisplayString.h.


The documentation for this class was generated from the following files: