Open main menu

CDOT Wiki β

Changes

Console UI Core Classes - OOP344 20111

596 bytes added, 22:30, 23 March 2011
Constructors / Destructor
<big><syntaxhighlight lang="cpp">
CLabel(const char *Str, int Row, int Col,
int Len = -10);
</syntaxhighlight></big>
passes the Row and Col to the CField constructor and then;
if len is zero, it will allocate enough memory to store the string pointed by Str and then copies the Str into it.
if len > 0, then it will allocate enough memory to store '''len''' chars in a string.
In any way, the allocated memory is pointed by '''_data'''
<big><syntaxhighlight lang="cpp">
CLabel(int Row, int Col, int Len);
</syntaxhighlight></big>
Works exactly like the previous constructor, but len in this case can not be zero. (no validation required) and the string pointed by _data will be set to an empty string.
<big><syntaxhighlight lang="cpp">
CLabel(const CLabel& L);
</syntaxhighlight></big>
Copy Constructor
<big><syntaxhighlight lang="cpp">
~CLabel();
</syntaxhighlight></big>
makes sure that memory pointed by _data is deallocated before the object is destroyed.
 
===Methods===
<big><syntaxhighlight lang="cpp">