Changes

Jump to: navigation, search

Console Framework Classes 20103 - OOP344

3,198 bytes added, 14:09, 17 April 2013
m
Reverted edits by MCanaday49 (Talk) to last revision by Ldchen1
*int absCol()const;
*:it returns the sum of '''col()''' of this border plus all the '''col()'''s of the '''_containter'''s
 
The following are the pseudo code to get absRow( ) and as well as absCol( ):
<pre>
r = _row
Cnt = container
while(Cnt is not null)begin
add Cnt.row to r
set Cnt to Cnt.container
end
return r
</pre>
These two methods return the absolute coordinates of the FWBorder instance. (the row an column with respect to left top corner of the screen). These two functions are used to '''draw''' the border on the screen.
</syntaxhighlight></big>
Casts the return value of FWBorder::containrcontainer() to a FWDialog* and returns it.
==FWLabel==
[[Project Button Text - OOP344 20103 | ButtonTest.cpp]]
==FWCHECKFWCheck==
FWCheck class is a '''flagged''' Label.
FWCheck prints a checkbox and a Label in front of it and waits for user entry to possibly toggle the checkbox and exit.
*: In this case you text size is limited to the max_number_of_lines and can not grow more than that.
*A dynamic array of strings: [[Dynamic Array Of Strings - OOP344 | StrArr]] _lines;<br />
*: This clase case ([[Dynamic Array Of Strings - OOP344 | StrArr]]) is designed to simulate a two dimensional array of characters (or an array of strings) and has no limit in the number of lines and expands automatically if needed. You can use the code for ([[Dynamic Array Of Strings - OOP344 | StrArr]]) at your own risk to implement FWText, or you can design your own logic.<br />*A Doubly Linked List (Queue) of strings [[Queue of Strings - OOP344 | StrQue]]*: [[Queue of Strings - OOP344 | StrQue]] is a Queue of null terminated characters arrays (strings) and like StrArr has no limit in the number of lines and expands automatically if needed. Like StrArr, you can use the code for [[Queue of Strings - OOP344 | StrQue]] at your own risk to implement FWText, or you can design your own logic.<br />If you found any bugs or problems with [[Queue of Strings - OOP344 | StrQue]] or [[Dynamic Array Of Strings - OOP344 | StrArr]] don't modfy , do not modify it yourself but instead, please blog about it and send an email to [[mailto:fardad.soleimanloo@senecac.on.ca?subject=OOP344-StrArr StrQue me]] and I will take care of updating it.<br />You can also find the code for [[Queue of Strings - OOP344 | StrQue]] and it's tester program in class notes repo: (svn://zenit.senecac.on.ca/oop344/trunk/C/13-Nov12). 
<big><syntaxhighlight lang="cpp">
</syntaxhighlight></big>
#Calls its parents draw, to draw the border.
#Using iol_display, it prints lines of text form from index _loffset, up to height()-2 times.
#:Note that each line is printed from _offset character using absRow() and absCol(), up o width()-2 characters
<big><syntaxhighlight lang="cpp">
int edit();
</syntaxhighlight></big>
Draws the text area and then starts the editing from the fist first line.<br />The whole text should scroll to left, writeright, up or down instead, if the cursor tries to pass the edges of the text area.<br />
When Enter key is hit, if in insertmode, a new line is inserted after the current line and any text after the cursor in the line should be moved into it.<br />
When Backspace key is hit at the beginning of the line, the content of the current line should be moved to the previous line, the and current line should be deleted. The cursor in this case should stand in front of the copied data. <br />
</syntaxhighlight></big>
It deallocates the allocated memory. (If any memory allocation is used).
 
=Compile, Build, testing=
==Compile and build==
*Here is a sample of a make file on Linux, you can also find this '''makefile''' at svn://zenit.senecac.on.ca/oop344/trunk/C/Prj/makefile
 
<big><pre>
prj: iol.o fwborder.o fwfield.o fwlabel.o fwlineedit.o fwbutton.o fwcheck.o fwveditline.o fwdialog.o fwtext.o strarr.o testmains.o
c++ iol.o fwborder.o fwfield.o fwlabel.o fwlineedit.o fwbutton.o fwcheck.o fwveditline.o fwdialog.o fwtext.o strarr.o testmains.o \
-lncurses -oprj
 
iol.o: iol.c iol.h
cc -c iol.c
 
fwborder.o: fwborder.cpp fwborder.h confw.hiol.h
c++ -c fwborder.cpp
 
fwfield.o: fwfield.cpp fwfield.h fwborder.h confw.h iol.h
c++ -c fwfield.cpp
 
fwlabel.o: fwlabel.cpp fwlabel.h fwfield.h fwborder.h confw.h iol.h
c++ -c fwlabel.cpp
 
fwlineedit.o: fwlineedit.cpp fwlineedit.h fwfield.h fwborder.h confw.h iol.h
c++ -c fwlineedit.cpp
 
fwbutton.o: fwbutton.cpp fwbutton.h fwfield.h fwborder.h confw.h iol.h
c++ -c fwbutton.cpp
 
fwcheck.o: fwcheck.cpp fwcheck.h fwlabel.h fwfield.h fwborder.h confw.h iol.h
c++ -c fwcheck.cpp
 
fwveditline.o: fwveditline.cpp fwveditline.h fwlineedit.h fwfield.h fwborder.h confw.h iol.h
c++ -c fwveditline.cpp
fwtext.o: fwtext.cpp fwtext.h fwlineedit.h strarr.h fwfield.h fwborder.h confw.h iol.h
c++ -c fwtext.cpp
 
strarr.o: strarr.cpp strarr.h
c++ -c strarr.cpp
 
fwdialog.o: fwdialog.cpp fwdialog.h fwfield.h fwborder.h confw.h iol.h
c++ -c fwdialog.cpp
testmains.o: testmains.cpp fwdialog.h strarr.h fwtext.h fwveditline.h fwcheck.h fwbutton.h fwlineedit.h fwlabel.h fwfield.h fwborder.h iol.h
c++ -c testmains.cpp
 
</pre></big>
 
==Testing==
*All the test programs are saved at: svn://zenit.senecac.on.ca/oop344/trunk/C/Prj
*Test files names are '''Test*.cpp'''
*All test programs are compiled the executable is available on '''matrix.senecac.on.ca/~fardad.soleimanloo'''
*:to run the test programs, login to matrix.senecac.on.ca and login with your own user id and password, then at the command line type: '''~fardad.soleimanloo/tX''', replace the X with the number of the test. (i.e for test three, run: '''~fardad.soleimanloo/t3''')
*:Note that you should use [http://www.chiark.greenend.org.uk/~sgtatham/putty/ Putty] to login to matrix and set the keyboard to Xterm 6
 
=Due Date=
*Due Nov 29, 23:59
*: Tagged prj0.6
3
edits

Navigation menu