Changes

Jump to: navigation, search

Console Framework Classes 20103 - OOP344

3,027 bytes added, 22:57, 8 November 2010
The Frame work
=The Frame work=
 
Your objective at this stage is to create a framework of classes designed to interact with the user. This user interface framework then can be used in development of any interactive application.
 
please note that the class definitions here are minimum requirement for the framework and you are free to add any enhancements or features you find useful. Obviously it would be wise the discuss these enhancements with your professor to make sure they are feasible.
 
 
Depending on the section you are in, you may have different scope in number of the classes you create. please double check your professor's notes on the project before you begin.
 
 
It is highly recommended to develop the classes in the order they are stated here. At each stage a tester program is provided to help you test your development. Executables of the test programs are available on matrix to show you how it is supposed to run.
 
 
Start by creating mock-up classes (class declaration and definition with empty methods that only compiles and don't do anything)
Each class MUST have its own header file to hold its declaration and "cpp" file to hold its implementation. To make sure you do not do circular includes follow these simple guidelines:
* Add recompilation safeguards to all your header files.
* Always use forward declaration if possible instead of including a class.
* Use includes only in files in which the actual header file code is used. avoid "just in case" includes.
 
 
 
 
== General Internal Header file ==
The general header file holds the common setting and definition between all classes in the frame work.
<big><syntaxhighlight lang="cpp">
#ifndef ___CONFW_H__
==Classes==
These classes encapsulate all the functions written in IOL library in an Object Oriented method:
===Hierarchy===
<big><pre>
FWBorder
|
|---FWDialog
|
|
|---FWField
|
|-------- IOLabel
| |
| |-------FWCheck
| |-------FWMenuItem (Maybe?)
|
|-------- FWButton
|
|
|-------- FWLineEdit
| |
| |-------FWValEdit
|
|-------- FWText
|
|-------- FWCheckList (Maybe?)
|-------- FWMenu (Maybe?)
</pre></big>
===FWBorder===
FWBorder is the base of all IO entities in our framework. It encapsulate a window or a container in witch IO Fields are to be placed and run.
It encapsulates a border, cordinates and size.
===FWBorder===
====Class Definition====
<big><syntaxhighlight lang="cpp">
</syntaxhighlight></big>
=====Properties=====
int _row, holds the relative coordinate of top row of this border with respect to its container.<br />
int _col, same as _row, but for _col. <br />
int _height, height of the entity. <br />
int _width, width of the entity. <br />
char _border[9], characters used to draw the border: <br />
: _border[0], left top
: _border[1], top side
: _border[2], right top
: _border[3], right side
: _border[4], right bottom
: _border[5], bottom side
: _border[6], bottom left
: _border[7], left side
bool _visible; Indicates if the border surrounding the entity is to be drawn or not.
FWBorder* _container; holds the container (another form) which has opened this one. (owner of the current FWBorder0
====Border Tester====
 
[[OOP344 20103 BorderTester | BorderTester.cpp]]

Navigation menu