#include <txtattr.h>
Inheritance diagram for TxtFontTypefaceAttribute:
Public Member Functions | |
TxtFontTypefaceAttribute () | |
Default Constuctor for TxtFontTypefaceAttribute The default typeface handle is 0 which represents the default font. | |
TxtFontTypefaceAttribute (UINT32 TypefaceHandle) | |
TextFontTypefaceAttribute constructor. | |
virtual void | Restore (RenderRegion *, BOOL) |
Restores the TxtFontTypefaceAttribute attribute for the given render region. | |
virtual void | Render (RenderRegion *pRegion, BOOL Temp=FALSE) |
Sets the TxtFontTypeface attribute for the given render region. | |
virtual void | SimpleCopy (AttributeValue *) |
See AttributeValue::SimpleCopy. | |
virtual NodeAttribute * | MakeNode () |
Make a AttrTextFontTypeface node, see base class. | |
BOOL | IsDifferent (AttributeValue *pAttr) |
See base class version. | |
virtual TxtFontTypefaceAttribute & | operator= (TxtFontTypefaceAttribute &Attrib) |
Make the Attribute the same as the other. | |
INT32 | operator== (const TxtFontTypefaceAttribute &Attrib) |
Comparison operator. See NodeAttribute::operator== for a description of why it's required. | |
Static Public Member Functions | |
static BOOL | Init () |
Registers default attribute. | |
Public Attributes | |
WORD | HTypeface |
BOOL | IsBold |
BOOL | IsItalic |
Definition at line 180 of file txtattr.h.
|
Default Constuctor for TxtFontTypefaceAttribute The default typeface handle is 0 which represents the default font.
Definition at line 223 of file txtattr.cpp.
|
|
TextFontTypefaceAttribute constructor.
Definition at line 246 of file txtattr.cpp. 00247 { 00248 HTypeface = (WORD)TypefaceHandle; 00249 IsBold = FALSE; 00250 IsItalic = FALSE; 00251 }
|
|
Registers default attribute.
Reimplemented from SimpleCCObject. Definition at line 389 of file txtattr.cpp. 00390 { 00391 TxtFontTypefaceAttribute *pAttr = new TxtFontTypefaceAttribute; 00392 if (pAttr==NULL) 00393 // error message has already been set by new 00394 return FALSE; 00395 00396 UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(BaseTextClass), 00397 pAttr); 00398 00399 ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising TxtFontTypefaceAttribute"); 00400 00401 return TRUE; 00402 }
|
|
See base class version.
Reimplemented from AttributeValue. Definition at line 366 of file txtattr.cpp. 00367 { 00368 // This must be at least a FillGeometryAttribute... 00369 ERROR3IF(!pAttr->IsKindOf(CC_RUNTIME_CLASS(TxtFontTypefaceAttribute)), 00370 "Different attribute types in TxtFontTypefaceAttribute::IsDifferent()"); 00371 00372 // Check they are NOT the same. 00373 return ( !(*((TxtFontTypefaceAttribute *)pAttr) == *this) ); 00374 }
|
|
Make a AttrTextFontTypeface node, see base class.
Reimplemented from AttributeValue. Definition at line 417 of file txtattr.cpp. 00418 { 00419 // Create new attribute node 00420 AttrTxtFontTypeface* pAttr = new AttrTxtFontTypeface(); 00421 if (pAttr==NULL) 00422 // error message has already been set by new 00423 return NULL; 00424 00425 // Copy attribute value into the new node. 00426 pAttr->Value.SimpleCopy(this); 00427 00428 // Return the new node 00429 return pAttr; 00430 }
|
|
Make the Attribute the same as the other.
Definition at line 304 of file txtattr.cpp. 00305 { 00306 HTypeface = Attrib.HTypeface; 00307 IsBold = Attrib.IsBold; 00308 IsItalic = Attrib.IsItalic; 00309 00310 return *this; 00311 }
|
|
Comparison operator. See NodeAttribute::operator== for a description of why it's required.
Definition at line 327 of file txtattr.cpp. 00328 { 00329 return (Attrib.HTypeface == HTypeface && 00330 Attrib.IsBold == IsBold && 00331 Attrib.IsItalic == IsItalic); 00332 }
|
|
Sets the TxtFontTypeface attribute for the given render region.
Implements AttributeValue. Definition at line 267 of file txtattr.cpp. 00268 { 00269 pRegion->SetTxtFontTypeface(this, Temp); 00270 }
|
|
Restores the TxtFontTypefaceAttribute attribute for the given render region.
Implements TxtBaseClassAttribute. Definition at line 286 of file txtattr.cpp. 00287 { 00288 pRegion->RestoreTxtFontTypeface(this, Temp); 00289 }
|
|
See AttributeValue::SimpleCopy.
Implements AttributeValue. Definition at line 345 of file txtattr.cpp. 00346 { 00347 ERROR3IF(!IS_A(pValue, TxtFontTypefaceAttribute), 00348 "Invalid Attribute value passed to TxtFontTypefaceAttribute::SimpleCopy"); 00349 // We may as well just use our assignment operator. 00350 *this = *((TxtFontTypefaceAttribute*)pValue); 00351 }
|
|
|
|
|
|
|