Open main menu

CDOT Wiki β

Changes

OOP344 20102 TextEdit

1,487 bytes added, 14:24, 11 August 2010
PLATFORM KEY DEFINITIONS
<big><big><big>TextEdit , OOP344 Open Source Project 20102</big></big></big>(under construction)
<big><big><big>Release 0.1</big></big></big>
Save your work in separate files for each class, and name the files to the same name as the classes; each class should have a header file and a code file.
For example for the class [[#Field IOField | BFieldIOField]], create ''bfieldiofield.h'' and ''bfieldiofield.cpp''. The header file should hold the class declaration, and any other possible declaration related to the class. The "cpp" file should hold the definition (implementation) of the class, and its methods and possible functions.
Include your already existing C code into your C++ code as follows:
<big><syntaxhighlight lang="cpp">
extern "C"{
#include "biofiof.h"
};
</syntaxhighlight></big>
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 bioliof.c to bioliof.cpp, since the compiler is already aware of the C functions in bioliof.c.
= Header Files =
== General Definition Header file ==
create a file called: '''btextiotext.h'''. This file will contain any necessary definitions or possible inclusions for the project.
This file will be included to most of your project code to carry general definitions for your project.
For now add the following define statements in '''btextiotext.h'''.
Keep checking this section for additions during the development of the project
<pre>
#ifndef __BIO_BTEXT_H____IO_TEXT_H__ #define __BIO_BTEXT_H____IO_TEXT_H__
extern "C"{
#include "biofiof.h"
};
#define MAX_NO_FIELDS 500
#define FRAME_CHARS "/-\\|/-\\|"
// Release 0.3 #define OT_CLR_AND_DSPLY_ALL _CLR_AND_DSPLY_ALL -1 #define OT_DSPLY_ALL _DSPLY_ALL 0
// Release 0.4
enum MessageStatus{ClearMessage,SetMessage};
# undef NO_HFUNC
# endif
# define NO_HFUNC ((void(*)(MessageStatus, BFormIOForm&))(0))
# ifdef NO_VFUNC
# undef NO_VFUNC
# endif
# define NO_VFUNC ((bool(*)(const char*, BFormIOForm&))(0))
#endif
= Mandatory Classes =
To initiate development of the OpText TextEdit application, we need to encapsulate the functions written in "[[BIOF 20101 (AS1) Oop344 20102 - OOP344iof functions|BIOFIOF]]".
The main design is based on the input/output objects that can be positioned on a Form. Each input/output object is responsible to encapsulate a form of entry or display: a '''Label''' to display text, a '''Line Editor''' do display and edit a character string, a '''Check Box List''' to be able to select one or many of many options, a '''Button''' to confirm actions, and etc....
Also as mentioned above, A Form object is responsible to hold the input/output objects and display and edit them in an orderly fashion. A Form, so to speak, could be an array or list of input/output objects.
These objects by design, could be framed, which means they can have a border drawn around them. Because of this, a class needs to be designed to represent a Frame (we call it '''BFrameIOFrame''') to represent a Frame and this class should be inherited by all Framed objects.
Also, the input/output objects all have the same purpose (that is displaying or editing something). This "same purpose" will be encapsulated in a class called '''BFields''' that presents the idea of an input/output object in a form.
Also, the input/output objects all have the same purpose (that is displaying or editing something). This "same purpose" will be encapsulated in an abstract class called '''[[#IOField | IOField]]''' that presents the idea of an input/output object in a form.
== BFrame IOFrame ==
'''BFrameIOFrame''' is implemented in two files, '''bframeioframe.h''' and '''bframeioframe.cpp'''
'''BFrameIOFrame''' is a class encapsulating a Frame. It has a location on the Form that is its left, top coordinates (i.e. '''col''' and '''row''') also a width and a height to specify how wide and tall the frame is.
'''BFrameIOFrame''' can be invisible, which means, it will have all the specs, but it does not draw any border around itself.
'''BFrameIOFrame''' can obviously draw itself on the screen at a specific location with specific offset.
<big><presyntaxhighlight lang="cpp"> class BFrame IOFrame {
private:
bool _visible;
?????
// protected is removed in V0.2
int _row;
int _col;
int _width;
public:
BFrameIOFrame(int row = -1, int col = -1,
int height = -1, int width = -1
,bool visible = false
);
virtual ~BFrameIOFrame();
void draw(int RowOffset = 0, int ColOffset = 0) const;
void setVisible(bool visible);
// V0.2
void setSize(int height, int width);
virtual BFrameIOFrame& row(int val); virtual BFrameIOFrame& col(int val);
virtual int row()const;
virtual int col()const;
bool IsVisible()const;
};
</presyntaxhighlight></big>
'''Constructor:''' Sets the corresponding values to the incoming arguments. if any of the row, col, height or width is less than 0, then the frame will be set to full-screen, which means, row and col will be set to 0 and width and height will be set to the number of columns and rows of the screen, respectively.
'''Destructor:''' Does Nothing. This is an empty destructor.
'''void draw(int RowOffset = 0, int ColOffset = 0) const:''' , if the frame is visible, then it draws a rectangle on the screen with its left, top at col+ColOffset and row+RowOffset respectively. The width and height of the rectangle will be equal to the corresponding attributes in the class.
R 0.3note: Make sure the rectangle is filled with spaces.
The frame is drawn using the characters specified in '''FRAME_CHARS''' in '''btextiotext.h''' as follows:<big><pre>
Index Character
0 left-top
6 bottom-left
7 left border
</pre></big>
In full screen mode the four corners are not printed.
*'''void setSize(int height, int width);''' Sets the _height and _width to the incoming values
*'''virtual BFrameIOFrame& row(int val);''' Sets the _row to incoming '''val''' and then returns a reference of BFrameIOFrame
*'''virtual BFrameIOFrame& col(int val);''' Sets the _col to incoming '''val''' and then returns a reference of BFrameIOFrame
*'''virtual int row()const;''' returns the value of _row
*'''virtual int width()const;''' return the value of _width
*'''bool IsVisible()const;''' returns the status of BFrameIOFrame, true, if the frame is visible and false if it is notHere is how a BFrame IOFrame looks like when it is drawn:
[[File:BFrame.gif]]
<br />
[http://pastebin.ca/1823508 [OOP344 20102 IOFrame test main|A main() function to test BFrameIOFrame::draw Offsets]]<br /> 
bframe executable sample on matrix: ~fardad.soleimanloo/bframetest
== BField ==
''' BField ''' represents an input/output object. It is a Framed object, which means it '''publicly''' inherits BField.== IOField ==
BField is what is common between all the ''' IOField ''' represents an input/output fields in this systemobject. BField It is the base of every and each of the input/output fieldsa Framed object, which means it '''publicly''' inherits IOFrame.
A BField IOField is usually an element of a Form Entity (see BForm)what is common between all the input/output fields in this system. Because IOField is the base of this, for every and each Field to be able to post messages on of the Form, it needs to have a reference to the Form it is oninput/output fields.
Each BField gets its location An IOField is usually an element of a Form Entity (row and colsee IOForm) and its size (height and width) from its grandparent BFrame. Because of this, for each Field to be able to post messages on the Form, it needs to have a reference to the Form it is on.
Each IOField gets its location (row and col) and its size (height and width) from its parent IOFrame. Because BField IOField is to do input/output, it needs a general way to be able to hold/keep track of the data it is inputting or outputting.
To accommodate the above we create the following class:
<big><presyntaxhighlight lang=cpp# include "ioframe.h"
# include "bframe.h"class IOForm;
class BForm;//R0.3 private inheritance changed to publicclass BFieldIOField: public BFrameIOFrame{
private:
BFormIOForm* _owner;
protected:
void* _data;
public:
BFieldIOField(int row = 0, int col = 0,
void* data = (void*) 0, bool framed = false
);
virtual ~BFieldIOField();
virtual void display() const;
virtual int edit() = 0;
virtual bool editable() const = 0;
virtual void* data();
// void setOwner(BForm* owner); is renamed in V0.2
void set(BFormIOForm* owner);
int row()const;
int col()const;
// added in R 0.2:
int height()const;
int width()const;
// added in R virtual IOField& set(const void* data) = 0.3;
virtual BField& set(const void* data) = 0; // added in R 0.4  BFormIOForm* owner();
};
</presyntaxhighlight></big>
* '''_owner''' Holds the address of the Form the BField IOField Belongs to. If null, it means the BField IOField does not belong to any Form and it is stand alone
* '''_data''' Holds the address of the data being edited by this IO Field.
* '''BFieldIOField(int row = 0, int col = 0, void* data = (void*) 0, bool framed = false);''' Passes row and col to BFrame IOFrame and also passes 0 to BFrame IOFrame for height and width. Then the constructor sets the _data address to incoming data address and sets the _owner to null.
Since a BField IOField has ONLY what is common between different IO Fields, it can not have the final say on several of its own values. For example, the height and width depends of type of the IO it is going to be.
* '''virtual ~BFieldIOField();''' Does nothing.
* '''virtual void display() const;''' Depending to be an element of a Form (see BFormIOForm) or be a stand alone IO Field, it does the following:
If the the BFieldIOField's _owner attribute is null (it is not an element on a Form, or better to say it does not belong to a Form), it calls BFrameIOFrame::draw() with no arguments, otherwise(if _owner is not null) it calls the BFrameIOFrame::draw() passing its the _owner's row and col as offset arguments.''By doing this, if BField IOField is an element on a form, its location becomes relative to the Form it is in and not the screen''
* '''virtual int edit() = 0;''' Enforces the children to have an edit method
* '''virtual void* data();''' Returns the value the _data attribute
* '''void set(BFormIOForm* owner);''' Sets the _owner attribute to incoming owner address. (this method will be used by BForm IOForm to become the owner of the BFields IOFields being added it)
* '''int row()const;''' Returns the row of the BFrameIOFrame, but if the _owner is not null, the value of the row of the _owner will be added to returned value.
* '''int col()const;''' Returns the col of the BFrameIOFrame, but if the _owner is not null, the value of the col of the _owner will be added to returned value.
* '''int height()const;''' Returns the height of the BFrameIOFrame.
* '''int width()const;''' Returns the width of the BFrameIOFrame.* '''R0.3: virtual BFieldIOField& set(const void* data) = 0;''' Enforces the children to have a set method for setting the value of _data.
* '''R0.4: BFormIOForm* owner();''' returns the value of the '''_owner''' attribute.
== BLabel IOLabel ==
BLabel IOLabel is a BField IOField to display a string of characters. It essentially encapsulates bio_displayiof_display().
The only attribute BLabel need IOLabel needs in addition to its parents is an integer to Hold the length of the string to be shown.
<big><presyntaxhighlight lang="cpp"> #include "bfieldIOField.h" class BLabel IOLabel: public BFieldIOField{
int _length;
public:
BLabel IOLabel(const char *str, int row, int col, int len = 0); BLabel IOLabel(int row, int col, int len); virtual ~BLabelIOLabel();
void display() const;
int edit();
bool editable()const;
// modified in R0.3 BFieldIOField& set(const void* str);
};
</presyntaxhighlight></big>
*'''BLabelIOLabel(const char *str, int row, int col, int len = 0);''' After passing row and col to its parent, it allocates memory to hold the contents of '''str'''.
Allocation should be done after setting the '''_length''' to the proper value; if len is less than or equal to zero, then '''_length''' will be set to the length of the '''str''', otherwise, '''_length''' will be set to the value of incoming '''len'''.
After this, '''_length +1 ''' chars should be allocated and it address should be kept in '''BFieldIOField::_data'''
Then the contents of str should be copied up to _legnth chars into '''BFieldIOField::_data'''. Make sure that the string is null terminated.
*'''BLabelIOLabel(int row, int col, int len);'''
This constructor is used to create an empty BLabel IOLabel. It works exactly like the above constructor, with one difference; there is no string to initialize the newly allocated memory.
'''_length''' is set to incoming '''len''' and then '''BFieldIOField::_data''' is set to the address of the newly allocated '''_length +1 ''' chars.
Set the first char of the _data to null to set the string to blank.
*'''virtual ~BLabelIOLabel();''' Deletes the data held in BFieldIOField::_data
*'''void display() const;''' Using bio_displayiof_display, displays BFieldIOField::_data at BFieldIOField::row() and BFieldIOField::col(), up to _length characters
*'''int edit();''' Calls the display() method and returns 0.
*'''bool editable()const;''' Always return false
*'''BFieldIOField& set(const void* str);''' Copies the '''str''' into BFieldIOField::_data up to _length chars and then returns a reference of the BLabel IOLabel.
== BEdit IOEdit ==BEdit IOEdit is A BField an IOField that is responsible to encapsulate the bio_editiof_edit.
To do so in addition to the attributes of its parents; row, col and width (that is fieldlen) it needs to have the following:
*An integer to keep the offset position.
*An integer pointer to hold the address of the insert status.
<big><presyntaxhighlight lang="cpp">class BEditIOEdit: public BFieldIOField{
bool _dyn;
int _maxdatalen;
int _offset;
public:
BEditIOEdit(char* str, int row, int col, int fieldlen,
int maxdatalen, int* insertmode,
bool framed = false);
BEditIOEdit(int row, int col, int fieldlen,
int maxdatalen, int* insertmode,
bool framed = false);
~BEditIOEdit();
void display()const;
//Modified in R0.3
BFieldIOField& set(const void* str);
};
</presyntaxhighlight></big>*'''BEditIOEdit(char* str, int row, int col, int fieldlen,int maxdatalen, int* insertmode,bool framed = false);'''
Edit, sets BFieldIOField::_data to value of str. If BEdit IOEdit is instantiated with this constructor then it will edit an external string provided by the caller function of BEditIOEdit. BEdit IOEdit in this case is not creating any dynamic memory, therefore '''_dyn''' is set to false;
The location (row and col) and '''framed''' are directly passed to the parent and str is passed as data to the parent constructor.
Unlike BLabel IOLabel, BEdit IOEdit could be framed or not so depending on this (framed being true or false) the size (width and height) of BEdit IOEdit are set as follows:
If framed is false, then there is no border around the editing line so the height of the frame should be set to 0 and the width of the frame should be equal to the value of fieldlen. How ever is if the editing line is bordered, then it needs 3 chars for height and fieldlen + 2 as width:
<big><pre>
*'''BEditIOEdit(int row, int col, int fieldlen,int maxdatalen, int* insertmode,bool framed = false);''' This Constructor works exactly like the above with respect to location and size, but for data, because no data is provided to edit, it will create a dynamic, blank char string to accommodate the editing.
the size of the allocation will be maxdatelen +1 and obviously _dyn is set to true, so the destructor knows the memory has to be deallocated at the time of destruction. The allocated memory should be pointed by BFieldIOField::_data.*'''~BEditIOEdit();''' If _dyn is true it will delete the string pointed by BFieldIOField::_data.
*'''void display()const;''' First it will call the display() method of its parent and then makes a direct call to bio_display iof_display using the row(), col() and fieldlen() accessors.*'''int edit();''' makes a direct call to bio_edit iof_edit passing the corresponding values from the attributes and accessor methods. the IsTextEditor is set t to '''0''' and the readonly is set to '''0''' too (for now).
*'''bool editable()const;''' returns true
*'''int row()const;''' returns the BFieldIOField::row() but it will add one to it, if BEdit IOEdit is framed*'''int col()const;''' returns the BFieldIOField::col() but it will add one to it, if BEdit IOEdit is framed*'''int fieldlen()const;''' returns the BFrameIOFrame::width() but reduces it by 2 if BEdit IOEdit is framed*'''BFieldIOField& set(const void* str);''' copies the content of str into BFieldIOField::_data up to maxdatalen characters.
== BForm IOForm ==
BForm IOForm is a collection of BFieldsIOFields. BForm IOForm organizes and groups the BFields IOFields for user entry.
<big><presyntaxhighlight lang="cpp">
# include "btextiotext.h"
class BFrameIOFrame;class BFieldIOField;
class BFormIOForm: public BFrameIOFrame{ private: int _fnum; int _curidx;BField IOField* _fld[MAX_NO_FIELDS]; bool _dyn[MAX_NO_FIELDS]; bool _editable;BForm IOForm* _owner; public:BForm IOForm(int row = -1, int col = -1, int width = -1, int height = -1, bool framed = false); virtual ~BFormIOForm(); void display(int fn = OT_CLR_AND_DSPLY_ALL_CLR_AND_DSPLY_ALL)const; int edit(int fn = 0, BFormIOForm* owner = (BFormIOForm*)0);BForm IOForm& add(BFieldIOField* field, bool dynamic = true);BForm IOForm& add(BFieldIOField& field, bool dynamic = false); bool editable(); int fieldNum()const; int curField()const;BForm IOForm& set(BFormIOForm* owner);
BField IOField& operator[](unsigned int index);
};
</presyntaxhighlight></big>
* '''_fnum''' is the number of BFields IOFields added to the BFormIOForm
* '''_curidx''' is the index of the current BField IOField being edited.
* '''_fld''' is an array of BField IOField pointers. Initially all the elements of _fld is set to null. When a BField IOField is added to the form, it will be pointed by one of the elements of this array.
* '''_dyn''' is an array of boolean values exactly to the number of elements of '''_fld'''. When BField IOField number '''"n"''' is added to BForm IOForm and is pointed by '''_fld[n-1]''' , the corresponding '''_dyn[n-1]''' indicate if the BField IOField held in '''_fld[n-1]''' is dynamically allocated or not. the '''_dyn''' flags will be used in the destructor as deallocation condition for each _fld element.
* '''_editable''' is set to true, if at least one of the BFields IOFields in '''_fld''' is editable.
* '''_owner''', If a BForm IOForm is being used by another BFormIOForm, then the '''_owner''' of the used BForm IOForm will be set to the user-BFormIOForm.
* '''BFormIOForm(int row = -1, int col = -1, int width = -1, int height = -1, bool framed = false);''', creates a BFormIOForm. It passes the coordinates (row and col) and size (width and height) and also the framed flag to its parent BFrameIOFrame.
Then it will set all the '''_fld''' elements to null, '''_fnum''' to 0 (empty BFormIOForm), _editable to false and _curidx to 0 and _owner to (BFormIOForm*) 0;
* '''~BFormIOForm()''' goes through all '''_fld''' elements from 0 to '''_fnum''', if the corresponding '''_dyn''' element is true, it will then delete the BField IOField pointed by that '''_fld''' element.
* '''void display(int fn = 0)const;'''<br />
If '''fn''' is OT_CLR_AND_DSPLY_ALL_CLR_AND_DSPLY_ALL, then it will check to see if _owner is not null. If _owner is not null, it will call the _owner's display() with OT_CLR_AND_DSPLY_ALL_CLR_AND_DSPLY_ALL, otherwise it will just clear the screen.<br />
Then it first call BFrameIOFrame::draw() and then it will display all the _fld elements, one by one.
If '''fn''' is OT_DSPLY_ALL _DSPLY_ALL then it will just call BFrameIOFrame::draw() and then it will display all the _fld elements, one by one.<br />
If '''fn''' is greater than 0 then it will only display '''_fld''' number '''fn''' (_fld[fn-1])
* '''int edit(int fn = 0, BFormIOForm* owner = (BFormIOForm*)0);''' Edits First it will set '''_owner''' to incoming '''owner''' argument. <br />
If BForm IOForm is not editable (all fields are non-editable), it will just display the BForm IOForm and then waits for the user to enter a key and then terminates the function returning the key.<br />If fn is '''0''' then before editing, the whole form is displayed and editing begins from the first editable BFieldIOField.
If fn is greater than '''0''' then editing begins from the first editable key on or after BField IOField number '''fn'''.
Note that fn is the sequence number of field and not the index.
Call the edit of each field and depending on the value returned, do the following:
# For '''ENTER_KEY''', '''TAB_KEY''' and '''DOWN_KEY''', go to next editable BField IOField , if this is the last editable BField IOField then restart from BField IOField number one.# For '''UP_KEY''' go to the previous editable BFieldIOField, if there is no previous editable BFieldIOField, go to the last editable BField IOField in the BFormIOForm.
# For any other key, terminate the edit function returning the character which caused the termination.
* '''BFormIOForm& add(BFieldIOField* field, bool dynamic = true);''' adds value of the field pointer to the _fld array , sets the corresponding _dyn element to the value of dynamic argument and then increases _fnum by one.
By doing this a BField IOField is added to the collection of BFields IOFields in BFormIOForm::_fld.It also sets the _owner of the added BField IOField to this BFormIOForm.Note that this BField IOField is dynamic by default
* '''BFormIOForm& add(BFieldIOField& field, bool dynamic = false);''' adds address of the field pointer to the _fld array , sets the corresponding _dyn element to the value of dynamic argument and then increases _fnum by one.
By doing this a BField IOField is added to the collection of BFields IOFields in BFormIOForm::_fld.It also sets the _owner of the added BField IOField to this BFormIOForm.Note that this BField IOField is non-dynamic by default.
* '''bool editable();''' Returns true if at least one of the BFields IOFields added to the BForm IOForm is editable.
* '''int fieldNum()const;''' returns _fnum
* '''int curField()const;''' returns _curidx
* '''BFormIOForm& set(BFormIOForm* owner);''' Sets the '''_owner''' to the incoming owner argument* '''BFieldIOField& operator[](unsigned int index);''' returns the reference of the _fld[index], if index is larger than _fnum, then circle back from the beginning.<br />
Executable sample for optext Release 0.3: ~fardad.soleimanloo/optext0.3
= IOVEdit =
Inherit IOEdit class to a Validated line editor class called IOVEdit.
IOVEdit, works exactly like a IOEdit, with two differences; 1- It supports Help messages. 2- Supports data validation
= BVedit =Before coding this class, apply "Release 0.4" changes to '''btext.h''' and '''BField''' class and then Inherit BEdit class to a Validated line editor class called BVedit. BVedit, works exactly like a BEdit, with two differences; 1- It supports Help messages. 2- Supports data validation BVedit IOVEdit has two extra attributes that are pointers to Validation and Help functions:
<big><pre>
void (*_help)(MessageStatus, BFormIOForm&); bool (*_validate)(const char*, BFormIOForm&);
</pre></big>
<big><pre>
BVeditIOVEdit(int row, int col, int fieldlen,
int maxdatalen, int* insertmode,
bool (*validate)(const char* , BFormIOForm&) = NO_VFUNC, void (*help)(MessageStatus, BFormIOForm&) = NO_HFUNC,
bool framed = false);
BVeditIOVEdit(char* str, int row, int col, int fieldlen,
int maxdatalen, int* insertmode,
bool (*validate)(const char* , BFormIOForm&) = NO_VFUNC, void (*help)(MessageStatus, BFormIOForm&) = NO_HFUNC,
bool framed = false);
</pre></big>
These two constructors pass all the information directly to BEditIOEdit's constructor and then set the "function pointers" attributes to their corresponding arguments.
== Public Function ==
</pre></big>
* if '''owner()''' of BVedit IOVEdit is null, then it simply calls the BEditIOEdit's '''edit()''' and terminates (returning the same value as BEditIOEdit::edit())
* if '''owner()''' is not null
** if the help function pointer attribute is not NULL, it will call it passing '''SetMesssage'' , and '''*owner()''' as arguments (This will show the help message for this field, before editing begins.)
** if the validation function pointer is not null then it will call the BEditIOEdit::edit() and validate the data with it by keep repeating the BEditIOEdit::edit() until either validation function return true or the BEditIOEdit::edit() was terminated by a non navigation key.
*** Navigation keys are: '''UP_KEY DOWN_KEY TAB_KEY and ENTER_KEY'''
** Right before the BVeditIOVEdit::edit() Terminates, if the help function pointer attribute is not NULL, it will call it again passing '''ClearMesssage'' , and '''owner()''' as arguments (this will clear the help message after editing is done.)** BVeditIOVEdit::edit() will return the return value of BEditIOEdit::edit().= BTextEdit IOTextEdit =
BTextEdit IOTextEdit is inherited from BField IOField and edits a multi-line text as a text editor.
== Constructors ==
<big><pre>
BTextEditIOTextEdit(int row, int col, int height,int width,
bool readonly, int* insertmode);
BTextEditIOTextEdit(const char* str,
int row, int col, int height,int width,
bool readonly, int* insertmode);
</pre></big>
BTextEdit IOTextEdit is created using its coordinates on the BForm IOForm (row, col) and the height and width of the text area, for editing the text.
The maximum width of the text could be considered constant that is defined in '''OT_MAX_LINE_CHARS'''.
returns true;
<big><pre>
BFieldIOField& set(const void *str);
</pre></big>
Sets the data of BTextEdit IOTextEdit to the incomming data in the character array pointed by '''str'''.
<big><pre>
bool readOnly();
</pre></big>
Returns, if BTextEdit IOTextEdit is read-only or not.
<big><pre>
virtual ~BTextEditIOTextEdit();
</pre></big>
Deallocates the dynamic memory used by the class before BTextEdit IOTextEdit is destroyed.
= Test Programs =
[[OpText TextEdit Test Programs - OOP344 20101 | OpText TextEdit Test Programs]]
= Class Hierarchy =
<big><pre>
BFrameIOFrame
|
|---BFormIOForm
|
|
|---BFieldIOField
|
|--------BLabelIOLabel
|
|--------BEditIOEdit
| |
| |-------BVeditIOVEdit
|
|--------BTextEditIOTextEdit
</pre></big>
= Due Dates =
 
Due Date for the OpText Application 0.5 Release (Final), Sat, Apr 24th 23:59.
 
For task due dates, look for each team's individual project development page in the [[Project 20101 OOP344|Main Project Page]]
= Executable Samples on Matrix=
* Bframe test: ~fardad.soleimanloo/bframetest
* optext Release 0.3: ~fardad.soleimanloo/optext0.3
== compiling under Linux ==
To compile in matrix, use:
g++ yada.cpp yadoo.cpp -x c biofiof.c -lncurses
If you have many cpp's, you may also do
g++ *.cpp -x c biofiof.c -lncurses
== Sample makefile for optext release 0.3 TextEdit ==
<big><pre>
optexttextedit: biofiof.o bframeioframe.o bfieldiofield.o blabeliolabel.o beditioedit.o bformioform.o optexttextedit.o c++ biofiof.o bframeioframe.o bfieldiofield.o blabeliolabel.o beditioedit.o bformioform.o optexttextedit.o \ -lncurses -ooptextotextedit
biofiof.o: biofiof.c biofiof.h cc -c biofiof.c
bframeioframe.o: bframeioframe.cpp bframeioframe.h btextiotext.h c++ -c bframeioframe.cpp
bfieldiofield.o: bfieldiofield.cpp bfieldiofield.h bframeioframe.h bform.h c++ -c bfieldiofield.cpp
blabeliolabel.o: blabeliolabel.cpp blabeliolabel.h bfieldIOField.h btextiotext.h c++ -c blabeliolabel.cpp
beditioedit.o: beditioedit.cpp beditioedit.h bfieldIOField.h btextiotext.h c++ -c beditioedit.cpp
bformioform.o: bformioform.cpp bformioform.h btextiotext.h bfieldiofield.h c++ -c bformioform.cpp
optexttextedit.o: optexttextedit.cpp btextiotext.h blabeliolabel.h beditioedit.h bformioform.h bfieldiofield.h
c++ -c optext.cpp
</pre></big>
 
= PLATFORM KEY DEFINITIONS =
 
<u>'''VCC and PLT_BCC'''</u>
* UP_KEY 1072
* DOWN_KEY 1080
* LEFT_KEY 1075
* RIGHT_KEY 1077
* PGUP_KEY 1073
* PGDN_KEY 1081
* ENTER_KEY 13
* TAB_KEY 9
* BACSPACE_KEY 8
* DEL_KEY 1083
* HOME_KEY 1071
* END_KEY 1079
* ESCAPE_KEY 27
* INSERT_KEY 1082
* F1_KEY 1059
* F2_KEY 1060
* F3_KEY 1061
* F4_KEY 1062
* F5_KEY 1063
* F6_KEY 1064
* F7_KEY 1065
* F8_KEY 1066
* F9_KEY 1067
* F10_KEY 1068
* F11_KEY 1133
* F12_KEY 1134
 
<u>'''LNX'''</u> /* use PUTTY terminal only and set the keyboard to Xtrem R6 */
 
* UP_KEY 259
* DOWN_KEY 258
* LEFT_KEY 260
* RIGHT_KEY 261
* PGUP_KEY 339
* PGDN_KEY 338
* ENTER_KEY 10
* TAB_KEY 9
* BACKSPACE_KEY 263
* DEL_KEY 330
* HOME_KEY 262
* END_KEY 360
* ESCAPE_KEY 27
* INSRT_KEY 331
* F1_KEY 265
* F2_KEY 266
* F3_KEY 267
* F4_KEY 268
* F5_KEY 269
* F6_KEY 270
* F7_KEY 271
* F8_KEY 272
* F9_KEY 273
* F10_KEY 274
* F11_KEY 275
* F12_KEY 276
 
<u>'''MAC'''</u>
 
* UP_KEY 259
* DOWN_KEY 258
* LEFT_KEY 260
* RIGHT_KEY 261
* PGUP_KEY 339
* PGDN_KEY 338
* ENTER_KEY 10
* TAB_KEY 9
* BACKSPACE_KEY 263
* DEL_KEY 127
* HOME_KEY 262
* END_KEY 360
* ESCAPE_KEY 27
* INSERT_KEY 331
* F1_KEY 995
* F2_KEY 996
* F3_KEY 997
* F4_KEY 998
* F5_KEY 269
* F6_KEY 270
* F7_KEY 111
* F8_KEY 272
* F9_KEY 273
* F10_KEY 274
* F11_KEY 275
* F12_KEY 126
1
edit