Changes

Jump to: navigation, search

Console Framework Classes 20103 - OOP344

1,796 bytes added, 11:35, 15 November 2010
Class Definition
</syntaxhighlight></big>
<big><pre>
FWLineEdit(char* Str, int Row, int Col, int Width,
int Maxdatalen, int* Insertmode,
bool Bordered = false,
const char* Border=FW_BORDER_CHARS);
</pre></big>
LineEdit, sets the Field's _data to the value of str. If LineEdit is instantiated with this constructor then it will edit an external string provided by the caller function of LineEdit. LineEdit in this case is not creating any dynamic memory, therefore _dyn is set to false (therefore the destructor will not attempt to deallocate the memory pointed by _data).<br />
The location (row and col) and Bordered are directly passed to the parent (FWField) and str is passed as data to the parent constructor. Unlike Label, LineEdit could have border or not so depending on this (Bordered being true or false) the Height is set to 3 or 1 respectfully. <br />
(hint: use '''? :''' operator to pass the proper value to FWField's constructor)
 
<big><pre>
FWLineEdit(int Row, int Col, int Width,
int Maxdatalen, int* Insertmode,
bool Bordered = false,
const char* Border=FW_BORDER_CHARS);
</pre></big>
Works exactly like the previous constructor with one difference; since no external data is passed to be edited here, this constructor must allocate enough dynamic memory to accommodate editing of '''Maxdatalen''' characters. Then make it an empty string and set Fields's _data to point to it. Make sure _dyn is set to true in this case, so the destructor knows that it has to deallocate the memory at the end.
 
<big><pre>
~FWLineEdit();
</pre></big>
If '''_dyn''' is true, it will deallocate the character array pointed by Fields's '''_data'''
 
<big><pre>
void draw(int Refresh = FW_NO_REFRESH)const;
</pre></big>
 
 
<big><pre>
</pre></big>
 
<big><pre>
</pre></big>
 
<big><pre>
</pre></big>
 
=== Dialog and Line editor Tester ===

Navigation menu