21
edits
Changes
no edit summary
Save your work in separate files for each class. Name the files to the same name as the classes. Each class should have a header file and a code file.
Create a Make file to build your project with respect to dependencies of classes.
# Checkout the code $svn co svn://zenit.senecac.on.ca/ops344_093aXX/trunk/PRJ --username yourUserName
# development starts.
Include your already existing C code into your C++ code as follows:
This tells to C++ compiler, the included header file contains C functions and should be complied and called as such. Remember, you do not need and should not rename your ciol.c to ciol.cpp, since the compiler is already aware of the C functions in ciol.c.
Add a link to your Team project Wiki pages here:
[[ ASOS Brigade | ASOS_Brigade]]
create a file called: '''io_def.h'''. This file will contain any nessecary definitions or inclusions for the project.
</pre></big>
As the first part of your project this semester, you are to create few classes to encapsulate [[OOP344 Assignment One|Console Input Output Library]]
<hr width="50%" />
'''IO_Field''' is the base class for all different types of Fields on a Form.
<hr width="50%" />
'''IO_Frame''' class, encapsulates a frame. It Draws a frame at left top corner of '''col''' and '''row''' with specified '''width''' and '''height'''.
<hr width="50%" />
<big><pre>
void Display(void);
<hr width="50%" />
IO_Frame has a virtual destructor. This destructor does nothing.
<hr width="50%" />
'''IO_Frame''' is inherited into a container class called '''IO_Form'''. '''IO_Form''' organizes the '''IO_Field''' classes and give the user a panel to use them sequentially.
'''IO_Form''' should be able to hold unlimited number of '''IO_Fields'''. (Use either a dynamic array, or linked list structure of '''IO_Fields''' to implement this)
<hr width="50%" />
'''IO_Form''' is constructed as follows:
<hr width="50%" />
<big><pre>
<hr width="50%" />
the '''IO_Form''' must be able to add several IO_Field classes to itself, one at a time and then provide the user, the means of editing them in order they were added.
*'''submitter''': if set to true, it tags this IO_Field to terminate the IO_Form's edit() if ENTER_KEY is hit. see the edit() method for more info.
<hr width="50%" />
<big><pre>
int add(IO_Field* f, bool submitter = false);
<hr width="50%" />
<big><pre>
void setError(const char* mes);
Set the text of the general Error message and the general Help message of the Form.
<hr width="50%" />
<big><pre>
<hr width="50%" />
<big><pre>
void* data(unsigned int fieldnumber=0);
<big><pre>
IO_Field& operator[](unsigned int index);
<hr width="50%" />
<big><pre>
void display(unsigned int how = IO_CLEAR | IO_SHOW_ALL ,unsigned int fieldnumber = 0 );
<hr width="50%" />
<big><pre>
int edit(unsigned int fieldnumber = 0);
'''IO_Label''' class mostly, encapsulates the '''[[OOP344_Assignment_One#void_io_display.28const_char_.2Astr.2C_int_row.2C_int_col.2C_int_len.29|io_display()]]''' function.
Inherit a new class called IO_Label from IO_Field to Display a text message on IO_Form. In addition to the attributes of its parent IO_Field, IO_Label has a private integer attribute called _len. _len is used to hold the length of Field in which the text is to be displayed.
If '''len''' is less than or equal to zero, then '''len''' will be set to the length of '''str''' and then constructor will work as previous case.
Like the previous constructor it will pass '''row''' and '''col''' to its parent.
<big><pre>
void Display(void);
'''operator=()''', Calls '''Set()''' and returns itself.
=Tips=
==IO_Form==
If you want to use a linkedlist to implement IO_Form having a node like this would be a good idea:
<big><pre>
class IO_Node{
IO_Field* _f;
bool _dynamic;
bool _submitter;
IO_Node* next;
...
...
...
};
</big></big>
With this you can have the IO_field kept in the node and at the same time keep track of the IO_Field being dynamically created and if it is a submitter or not.
==Fardad adds io_textedit==