Open main menu

CDOT Wiki β

Changes

CIO 20133 Release 0.3 - OOP344

1 byte added, 16:18, 20 October 2013
m
changing cui -> cio, strdsp -> display
void draw(int fn=C_NO_FRAME) ;
</syntaxhighlight></big>
makes a direct call to console.strdspdisplay(), passing '''_data''' for the string to be printed and absRow() and absCol() for row and col and width() for len.
this function ignores the argument fn.
<big><syntaxhighlight lang="cpp">
CField** _fld;
</syntaxhighlight></big>
Dynamic array of CField pointers to hold the address of the CField objects added to the screen. The initial size of the array allocation is defined in '''''cuighciogh.h''''' under C_INITIAL_NO_FIELDS.
<big><syntaxhighlight lang="cpp">
bool* _dyn;
</syntaxhighlight></big>
A dynamic bool array that holds series of booleans to the exact number of fields, and each boolean here will hold false if the corresponding field pointed by _fld is allocated dynamically or not. The initial size of the array allocation is defined in '''''cuighciogh.h''''' under C_INITIAL_NO_FIELDS. <br />
This array will later on be used by destructor to decide which object is dynamic and to be deleted.
<big><syntaxhighlight lang="cpp">
unsigned int _fldSize;
</syntaxhighlight></big>
Holds the current length of '''''_fld''''' and '''''_dyn'''''. <br />When adding a field to dialog if '''_fnum''' reaches '''_fldSize''', then the size of '''_fld''' and '''_dyn''' is expanded by '''''C_DIALOG_EXPANSION_SIZE''''', defined in '''cuighciogh.h'''
===Constructors/Destructors===
int add(CField* field, bool dynamic = true);
</syntaxhighlight></big>
First, this function will check the value of _fnum. If '''_fnum''' has reached '''_fldSize''', ('''_fld''' and '''_dyn''' arrays are full) it will expand '''_fld''' and '''_dyn''' by '''C_DIALOG_EXPANSION_SIZE''' (defined in '''cuighciogh.h''') to make room for more '''CField'''.<br />
Then, it adds the CField pointed by '''field''' to the Fields of the Dialog; by appending the value of the field pointer after the last added ''field'' in the _fld array , setting the corresponding _dyn element to the value of dynamic argument and then increasing _fnum by one and returning the index of added Field in the CDialog object.<br />
'''important note:'''<br />
1
edit