21
edits
Changes
→IO_Edit
==IO_Edit==
Inherit IO_Field and IO_Frame into a new class called IO_Edit. (Read: Practical Programming Techniques Using C++, pages 94 to 96, ''Multiple Inheritance'' topic) IO_Edit, encapsulates the io_edit() function of ciol library when isTextEditor is false.IO_Edit calls the io_edit function to edit a string that is either created dynamically by the IO_Edit itself, or a string that is external and is received through the constructor aruguments. Also IO_Edit gives the user the option of surrounding the editing line with a frame. Editing without a frame at row:2 col:5<big><pre>0123456789012345678901234567890123456789012345678912 Hello! I am editing a text_345</pre></big>Editing with a frame at row:2 col:5 (the actual editing happens at row:2+1 and col: 5+1<big><pre>0123456789012345678901234567890123456789012345678912 +-------------------------------------+3 |Hello! I am editing a text_ |4 +-------------------------------------+5</pre></big>
IO_Edit can be created in two ways:
<big><pre>
IO_Edit::O_Edit(int row, int col, int fieldlen,
int maxdatalen, int* insertmode,
bool framed = false, const char* frameChars = (const char*)0);
</pre></big>
This constructor dynamically creates an array of '''maxdatalen''' + 1 chars (an empty string) and sets IO_Feild::_data to point to it.
<big><pre>
IO_Edit::IO_Edit(char* str, int row, int col, int fieldlen,
</pre></big>
This constructor works exactly like the above constructor, with one exception. The data being edited is not dynamic here. So the IO_Fields::_data should point where the '''str''' argument is pointing to. Obviously, in this case IO_Edit should be marked as non--- incomplete ---dynamic so at destruction time, the memory is NOT deallocated.
==IO_CheckList==