Changes

Jump to: navigation, search

Console UI Core Classes - OOP344 20112

4,432 bytes added, 18:27, 16 August 2011
CLineEdit
==CLabel==
A readonly Field that encapsulates bio_displayiol_display() function. (i.e it is responsible to display a short character string on the display) CLable although, by inheritance is Frame, but it is never '''bordered'''.
<big><syntaxhighlight lang="cpp">
#include "cfield.h"
int _length;
</syntaxhighlight></big>
Holds the Length of the label, this will be stored to be passed to bio_display iol_display function.
===Constructors / Destructor ===
void draw(int fn=C_NO_FRAME) ;
</syntaxhighlight></big>
makes a direct call to bio_displayiol_display, passing '''_data''' for the string to be printed and absRow() and absCol() for row and col and _length for len.
this function ignores the argument fn.
<big><syntaxhighlight lang="cpp">
Returns the reference of the Field that was just being edited.
==CLineEdit==
'''ClineEdit''' encapsulates the bio_edit iol_edit function of bio iol library.
<big><syntaxhighlight lang="cpp">
#pragma once
void draw(int Refresh = C_FULL_FRAME);
</syntaxhighlight></big>
It will first call Frame's draw passing '''Refresh'''as an argument to it.<br />Then it will make a direct call to bio_display iol_display to show the data kept in Field's '''_data'''.<br />The values used for the arguments of bio_display iol_display are:
*str: address of string pointed by _data + the value of _offset
*row: absRow() (''add one if border is visible'')
int edit();
</syntaxhighlight></big>
Makes a direct call to, and returns '''bio_editiol_edit()'''.
For the coordinates and width arguments follow the same rules as the draw function.
For the rest of the arguments of bio_editiol_edit, use the attributes of '''CLineEdit'''.
<big><syntaxhighlight lang="cpp">
bool editable()const;
:*First calls Frame's draw(fn) (passing the fn argument to the parents draw)
:Use bio_display iol_display to display the Button's text (pointed by Field's _data)
:*If not bordered
:*:display the text at absRow() and absCol()
</syntaxhighlight></big>
First draw() the Button, then surround it by squared brackets, place the cursor under the first character of Button's text and wait for user entry.<br />
When user hits a key, if the key is ENTER_KEY or SPACE, return C_BUTTON_HIT (defined in cghiolgh.h) otherwise return the entered key.<br />
<big><syntaxhighlight lang="cpp">
bool editable()const;
void draw(int fn = C_NO_FRAME) ;
</syntaxhighlight></big>
*Uses bio_displayflagiol_displayflag() to display _flag using _format at absRow() and absCol()
*Then draw()s the _Label
<big><syntaxhighlight lang="cpp">
int edit();
</syntaxhighlight></big>
*returns bio_flagiol_flag()'s returned value.*:bio_flag iol_flag is to edit the value of _flag using the same arguments used in draw() as radiobutton or checkbox depending to the value of _radio
<big><syntaxhighlight lang="cpp">
bool editable()const;
</syntaxhighlight></big>
*These methods set and get _flag.
 
==CValEdit==
<big><syntaxhighlight lang="cpp">
''Navigation keys are Up key, Down key, Tab key or Enter key.''<br />
''MessageStatus is enumerated in '''iolgh.h'''''
=Linux and Unix makefile=
Copy these makefiles under "makefile" name in root of your project in Linux or Mac.<br />
Replace the "<tab>" with tab character<br />
then issue the make command: <br />
$make <enter><br />
this will compile your code and create an executable called tXexe,(where X is you test number if there is no error<br />
==Test 1 (CFrame)==
<big><pre>
t1: iol.o cframe.o Test1Frame.o
c++ iol.o cframe.o Test1Frame.o -lncurses -ot1exe
 
iol.o: iol.c iol.h
cc -c iol.c
 
cframe.o: cframe.cpp cframe.h iolgh.h
c++ -c cframe.cpp
 
Test1Frame.o: Test1Frame.cpp cframe.h iolgh.h
</pre></big>
==Test 2 (Dialog and Label)==
<big><pre>
t2: iol.o cframe.o cfield.o cdialog.o clabel.o Test2DialogAndLabel.o
c++ iol.o cframe.o cfield.o cdialog.o clabel.o \
Test2DialogAndLabel.o -lncurses -ot2exe
 
iol.o: iol.c iol.h
cc -c iol.c
 
cframe.o: cframe.cpp cframe.h iolgh.h
c++ -c cframe.cpp
 
cfield.o: cfield.cpp cfield.h iolgh.h cframe.h
c++ -c cfield.cpp
 
cdialog.o: cdialog.cpp cdialog.h cfield.h iolgh.h cframe.h
c++ -c cdialog.cpp
 
clabel.o: clabel.cpp clabel.h cfield.h cframe.h iolgh.h
c++ -c clabel.cpp
 
Test2DialogAndLabel.o: Test2DialogAndLabel.cpp clabel.h cdialog.h cframe.h iolgh.h cfield.h
</pre></big>
==Test 3 (LineEdit)==
<big><pre>
t3: iol.o cframe.o cfield.o cdialog.o clabel.o clineedit.o Test3DialogAndLineEdit.o
c++ iol.o cframe.o cfield.o cdialog.o clabel.o clineedit.o Test3DialogAndLineEdit.o \
-lncurses -ot3exe
 
iol.o: iol.c iol.h
cc -c iol.c
 
cframe.o: cframe.cpp cframe.h iolgh.h
c++ -c cframe.cpp
 
cfield.o: cfield.cpp cfield.h iolgh.h cframe.h
c++ -c cfield.cpp
 
cdialog.o: cdialog.cpp cdialog.h cfield.h iolgh.h cframe.h
c++ -c cdialog.cpp
 
clabel.o: clabel.cpp clabel.h cfield.h cframe.h iolgh.h
c++ -c clabel.cpp
 
clineedit.o: clineedit.cpp clineedit.h cfield.h cframe.h iolgh.h
c++ -c clineedit.cpp
Test3DialogAndLineEdit.o: Test3DialogAndLineEdit.cpp clineedit.h clabel.h cdialog.h cfield.h cframe.h iolgh.h
c++ -c Test3DialogAndLineEdit.cpp
</pre></big>
 
==Test 4 (Button)==
<big><pre>
t4: iol.o cframe.o cfield.o cdialog.o clabel.o cbutton.o Test4Button.o
c++ iol.o cframe.o cfield.o cdialog.o clabel.o cbutton.o Test4Button.o \
-lncurses -ot4exe
 
iol.o: iol.c iol.h
cc -c iol.c
 
cframe.o: cframe.cpp cframe.h iolgh.h
c++ -c cframe.cpp
 
cfield.o: cfield.cpp cfield.h iolgh.h cframe.h
c++ -c cfield.cpp
 
cdialog.o: cdialog.cpp cdialog.h cfield.h iolgh.h cframe.h
c++ -c cdialog.cpp
 
clabel.o: clabel.cpp clabel.h cfield.h cframe.h iolgh.h
c++ -c clabel.cpp
 
cbutton.o: cbutton.cpp cbutton.h cfield.h cframe.h iolgh.h
c++ -c cbutton.cpp
 
Test4Button.o: Test4Button.cpp cframe.h cfield.h cdialog.h clabel.h cbutton.h
c++ -c Test4Button.cpp
</pre></big>
 
==Test 5 (VLineEdit)==
<big><pre>
t5: iol.o cframe.o cfield.o cdialog.o clabel.o cbutton.o clineedit.o cveditline.o Test5ValEdit.o
c++ iol.o cframe.o cfield.o cdialog.o clabel.o clineedit.o cbutton.o cveditline.o Test5ValEdit.o \
-lncurses -oprjexe
 
iol.o: iol.c iol.h
cc -c iol.c
 
cframe.o: cframe.cpp cframe.h iolgh.h
c++ -c cframe.cpp
 
cfield.o: cfield.cpp cfield.h iolgh.h cframe.h
c++ -c cfield.cpp
 
cdialog.o: cdialog.cpp cdialog.h cfield.h iolgh.h cframe.h
c++ -c cdialog.cpp
 
clabel.o: clabel.cpp clabel.h cfield.h cframe.h iolgh.h
c++ -c clabel.cpp
 
clineedit.o: clineedit.cpp clineedit.h cfield.h cframe.h iolgh.h
c++ -c clineedit.cpp
 
cbutton.o: cbutton.cpp cbutton.h cfield.h cframe.h iolgh.h
c++ -c cbutton.cpp
 
cveditline.o: cveditline.cpp cveditline.h clineedit.h cfield.h cframe.h iolgh.h
c++ -c cveditline.cpp
 
Test5ValEdit.o: Test5ValEdit.cpp cframe.h cfield.h cdialog.h clabel.h clineedit.h cveditline.h
c++ -c Test5ValEdit.cpp
</pre></big>
 
==Test 6 (CCheck)==
<big><pre>
t6: iol.o cframe.o cfield.o cdialog.o clabel.o ccheck.o Test6Check.o
c++ iol.o cframe.o cfield.o cdialog.o clabel.o ccheck.o Test6Check.o \
-lncurses -ot6exe
 
iol.o: iol.c iol.h
cc -c iol.c
 
cframe.o: cframe.cpp cframe.h iolgh.h
c++ -c cframe.cpp
 
cfield.o: cfield.cpp cfield.h iolgh.h cframe.h
c++ -c cfield.cpp
 
cdialog.o: cdialog.cpp cdialog.h cfield.h iolgh.h cframe.h
c++ -c cdialog.cpp
 
clabel.o: clabel.cpp clabel.h cfield.h cframe.h iolgh.h
c++ -c clabel.cpp
 
ccheck.o: ccheck.cpp ccheck.h clabel.h cfield.h cframe.h iolgh.h
c++ -c ccheck.cpp
Test6Check.o: Test6Check.cpp cframe.h cfield.h cdialog.h clabel.h ccheck.h
c++ -c Test6Check.cpp
</pre></big>
1
edit

Navigation menu