Changes

Jump to: navigation, search

CIO 20133 Release 0.3 - OOP344

762 bytes added, 02:09, 29 October 2013
Tasks Workload
<big>'''''Under Construction!'''''</big>
{{OOP344 Index | 20133}}
==CField==
''(this class is fully implemented and is ready to be downloaded from [https://github.com/Seneca-OOP344/20133notes/tree/master/ProjResources ProjResources direcotry under 20133notes repository on Github])''<br />
CField is an abstract base class that encapsulates the commonalities of all Input Outputs Console Fields which are placeable on a CDialog. All Fields could be Framed, therefore a CField is inherited from CFrame.
<big><syntaxhighlight lang="cpp">
void draw(int fn=C_NO_FRAME) ;
</syntaxhighlight></big>
makes a direct call to console.strdspdisplay(), passing '''_data''' for the string to be printed and absRow() and absCol() for row and col and width() for len.
this function ignores the argument fn.
<big><syntaxhighlight lang="cpp">
bool* _dyn;
bool _editable;
unsigned int _fldSize;// ?????? check this out
public:
CDialog(CFrame *Container = (CFrame*)0,
int Row = -1, int Col = -1,
int Width = -1, int Height = -1,
bool Borderd Bordered = false,
const char* Border=C_BORDER_CHARS);
virtual ~CDialog();
CField** _fld;
</syntaxhighlight></big>
Dynamic array of CField pointers to hold the address of the CField objects added to the screen. The initial size of the array allocation is defined in '''''cuighciogh.h''''' under C_INITIAL_NO_FIELDS.
<big><syntaxhighlight lang="cpp">
bool* _dyn;
</syntaxhighlight></big>
A dynamic bool array that holds series of booleans to the exact number of fields, and each boolean here will hold false if the corresponding field pointed by _fld is allocated dynamically or not. The initial size of the array allocation is defined in '''''cuighciogh.h''''' under C_INITIAL_NO_FIELDS. <br />
This array will later on be used by destructor to decide which object is dynamic and to be deleted.
<big><syntaxhighlight lang="cpp">
unsigned int _fldSize;
</syntaxhighlight></big>
Holds the current length of '''''_fld''''' and '''''_dyn'''''. <br />When adding a field to dialog if '''_fnum''' reaches '''_fldSize''', then the size of '''_fld''' and '''_dyn''' is expanded by '''''C_DIALOG_EXPANSION_SIZE''''', defined in '''cuighciogh.h'''
===Constructors/Destructors===
int Row = -1, int Col = -1,
int Width = -1, int Height = -1,
bool Borderd Bordered = false,
const char* Border=C_BORDER_CHARS);
</syntaxhighlight></big>
int add(CField* field, bool dynamic = true);
</syntaxhighlight></big>
First, this function will check the value of _fnum. If '''_fnum''' has reached '''_fldSize''', ('''_fld''' and '''_dyn''' arrays are full) it will expand '''_fld''' and '''_dyn''' by '''C_DIALOG_EXPANSION_SIZE''' (defined in '''cuighciogh.h''') to make room for more '''CField'''.<br />
Then, it adds the CField pointed by '''field''' to the Fields of the Dialog; by appending the value of the field pointer after the last added ''field'' in the _fld array , setting the corresponding _dyn element to the value of dynamic argument and then increasing _fnum by one and returning the index of added Field in the CDialog object.<br />
'''important note:'''<br />
int edit();
</syntaxhighlight></big>
Makes a direct call to, and returns '''console.streditedit()'''.
For the coordinates and width arguments follow the same rules as the draw function.
For the rest of the arguments of console.edit(), use the attributes of '''CLineEdit'''.
====CLineEdit Blog Posts====
== CField source code and Tester Programs ==
Find the Tester programs and the CField class implementation in the [https://github.com/Seneca-OOP344/20133notes/tree/master/ProjResources ProjResources direcotry under 20133notes repository on Github]
=== Tester Demo ===
To make sure your tester is running correctly, check the tester demo by logging to matrix.senecacollege.ca using putty and running the following:
* for test 2:
$ ~fardad.soleimanloo/t2
* for test 3:
$ ~fardad.soleimanloo/t3
== Tasks Workload ==
# prototyping %16
# CLabel 17%
# CDialog 50%
# CLineEdit 17%
== Due Date ==
* Monday Nov 4th, 23:59

Navigation menu