Open main menu

CDOT Wiki β

Changes

OOP344 Assignment Two

350 bytes added, 10:04, 2 November 2009
no edit summary
==File Names==
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.
==SVN Quick Notes==
# Checkout the code $svn co svn://zenit.senecac.on.ca/ops344_093aXX/trunk/PRJ --username yourUserName
# development starts.
==How to reuse your C code in C++ programs==
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.
==Team Project Wiki Pages==
Add a link to your Team project Wiki pages here:
[[ ASOS Brigade | ASOS_Brigade]]
==General Definition Header file==
create a file called: '''io_def.h'''. This file will contain any nessecary definitions or inclusions for the project.
</pre></big>
==Mandatory Classes==
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===
'''IO_Field''' is the base class for all different types of Fields on a Form.
<hr width="50%" />
===IO_Frame===
'''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%" />
====Public Method====
<big><pre>
void Display(void);
<hr width="50%" />
====Destructor====
IO_Frame has a virtual destructor. This destructor does nothing.
<hr width="50%" />
===IO_Form===
'''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%" />
====Constructor====
'''IO_Form''' is constructed as follows:
<hr width="50%" />
====Destructor====
<big><pre>
<hr width="50%" />
====Privete Methods====
=====Adding a Field to the Form=====
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%" />
====Public Methods=========Add methods=====
<big><pre>
int add(IO_Field* f, bool submitter = false);
<hr width="50%" />
=====Setting General Error and Help masseges=messages ====
<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%" />
=====Number of fields in Form=====
<big><pre>
<hr width="50%" />
=====Acessing Field Data=====
<big><pre>
void* data(unsigned int fieldnumber=0);
=====The index operator=====
<big><pre>
IO_Field& operator[](unsigned int index);
<hr width="50%" />
=====Displaying the Form=====
<big><pre>
void display(unsigned int how = IO_CLEAR | IO_SHOW_ALL ,unsigned int fieldnumber = 0 );
<hr width="50%" />
=====Editing(running) the Form=====
<big><pre>
int edit(unsigned int fieldnumber = 0);
===IO_Label===
'''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.
====Public Methods====
<big><pre>
void Display(void);
'''operator=()''', Calls '''Set()''' and returns itself.
===IO_Edit===
===IO_CheckList===
===IO_Radio===
===IO_Menu===
===IO_MenuBar===
===IO_TextEdit===
==The Text Editor==
=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==