home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
BBS
/
NSDEDIT2.ZIP
/
EDTKT06B.ZIP
/
EDIT.DOC
< prev
next >
Wrap
Text File
|
1994-09-08
|
50KB
|
1,680 lines
Edit object
By P.M.Bloemendaal
(c) 1994
eMail
internet : bloemendaal@rullf2.leidenuniv.nl
fidonet : 2:281/908
Thanks to TJS of MBH for general support, great ideas and
hairsplitting capabilities and I_A for his bounce checking and
metamorphosis of my source code. Without them, the EDIT kit wouldn't
be what it is today!
Brainbox systems EDIT object kit Page 2
This document is:
Copyright 1994 by Brainbox systems
Distributed under license by the Free Software Foundation, Inc.
This file is part of the EDIT object development kit.
This source is free software; you can redistribute it and or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation.
Brainbox systems EDIT object kit Page 3
Contents
--------
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
No warranty . . . . . . . . . . . . . . . . . . . . . . . . . . 4
What is the edit object . . . . . . . . . . . . . . . . . . . . . . . 6
Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
How to use it . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Input, output and terminalemulation . . . . . . . . . . . . . . 8
Proboard executables . . . . . . . . . . . . . . . . . . . . . . 8
Memberfunction references . . . . . . . . . . . . . . . . . . . . . . 10
Edit(int xx1, int yy1, int xx2, int yy2, unsigned char *txttxt) 10
int setMargins(int top, int bottom, int tops, int bots) . . . . 11
int setCursorPos(int pos) . . . . . . . . . . . . . . . . . . . 12
int setWindow(int xx1, int yy1, int xx2, int yy2) . . . . . . . 12
void setOutput(unsigned int) . . . . . . . . . . . . . . . . . . 13
void setTerm(unsigned int term) . . . . . . . . . . . . . . . . 14
int setText(unsigned char *st) . . . . . . . . . . . . . . . . 14
void setEditable(bool flag) . . . . . . . . . . . . . . . . . . 15
void setColor(int color) . . . . . . . . . . . . . . . . . . . . 15
void setTopColor(int color) . . . . . . . . . . . . . . . . . . 16
void setBotColor(int color) . . . . . . . . . . . . . . . . . . 17
void setBorder(int) . . . . . . . . . . . . . . . . . . . . . . 17
int getBorder(void) . . . . . . . . . . . . . . . . . . . . . . 18
unsigned int getInput(void) . . . . . . . . . . . . . . . . . . 18
unsigned int getOutput(void) . . . . . . . . . . . . . . . . . . 19
unsigned int getTerm(void) . . . . . . . . . . . . . . . . . . . 19
unsigned char *getText(void) . . . . . . . . . . . . . . . . . . 20
unsigned char getTopColor(void) . . . . . . . . . . . . . . . . 20
unsigned char getBotColor(void) . . . . . . . . . . . . . . . . 21
void setInput(unsigned int inp) . . . . . . . . . . . . . . . . 21
int poll(void) . . . . . . . . . . . . . . . . . . . . . . . . 22
void interpKey(int key) . . . . . . . . . . . . . . . . . . . . 22
int processKey(unsigned int) . . . . . . . . . . . . . . . . . 24
void change(void) . . . . . . . . . . . . . . . . . . . . . . . 25
redraw(void) . . . . . . . . . . . . . . . . . . . . . . . . . . 25
void redrawCursor(void) . . . . . . . . . . . . . . . . . . . . 25
void clrWindow(void) . . . . . . . . . . . . . . . . . . . . . . 26
int loadFile(char *fileName) . . . . . . . . . . . . . . . . . . 26
int saveFile(char *fileName) . . . . . . . . . . . . . . . . . . 27
bool error(void) . . . . . . . . . . . . . . . . . . . . . . . . 27
Derived classes . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
AbbreviationsEdit . . . . . . . . . . . . . . . . . . . . . . . 28
QuoteEdit . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
GNU license . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Brainbox systems EDIT object kit Page 4
License
-------
Distribution & usage license. In a nutshell, this license states
that anyone writing code distributing it under the GNU license, will:
1) NOT require money in any way from the user.
2) distribute everything including sourcecode
3) will not be liable for any direct or indirect damages caused
by the use of the distribution.
Furthermore the license states that anyone distributing GNU licensed
material, should NOT remove the sourcecode from the distribution, unless
absolutely necessary.
In any case, the GNU license agreement should be included with each
distribution.
Each distribution should also contain contact addresses of the various
authors (for feedback) and should list where the sourcecode (if not in
the distribution package) can be obtained for free (except for postal
charges).
These distributions are NOT allowed to be included on any media, which is
sold for the purpose of profit (this is prohibited by the GNU license
too!), for example CD's or Bulletin Boards requiring a registration fee.
Bulletin Boards requiring a registration fee or any means of limited
access for the public, who want to distribute this software, are required
to make this software accessible for FREE (free download) for all users,
including the users logging into the Bulletin Board System for the first
time.
For a complete GNU license agreement, please refer to the chapter
concerning the GNU license.
No warranty
NO WARRANTY
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE,
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE
EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
RISK AS TO THE QUALITY AND PERFORMANCE OF THE
PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
SERVICING, REPAIR OR CORRECTION.
Brainbox systems EDIT object kit Page 5
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR
AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER,
OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
DAMAGES ARISING OUT OF THE USE OR INABILITY TO
USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO
LOSS OF DATA OR DATA BEING RENDERED INACCURATE
OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
Brainbox systems EDIT object kit Page 6
What is the edit object
-----------------------
I create this edit source in the first place for my own personal use. But
since I see a lot of questions for editors in C with source code, I
decided to donate this source to the public domain.
With this source you can create one or more instances of an wordwrapping
editor that will be placed at the exact location you specify. You can
change the input and the output of the editor as well as the emulation
mode. Since I only use ANSI emulation, I only implemented this emulation
mode, but if you want you can implement your own emulation if necesary.
This object is ment for derivation of your own objects. In your own
objects you can make changes for one or more member function if you wish.
As an example I included an abbreviation class that will load a list of
words and translations of these words and overload the memberfunction
addchar(int key).
Errors
If you encounter errors in these sources, please report them to me. I will
debug them and update this sources packages!
Brainbox systems EDIT object kit Page 7
How to use it
-------------
Just include edit.hpp and derive your own class from it. You will have to
define the constructor of the class (a nasty syntax in c++), but you can
look at the example. Create an instance of your just derived class and
call redraw() and change() to display and edit your text. If you define
the function processKey(unsigned int key) in your source, all not handled
keys will pass this function.
Look at this simple example:
#include "edit.hpp"
class TestEdit : public Edit
{
public:
TestEdit(int x1, int y1, int x2, int y2, char *s) : Edit(x1,
y1,x2, y2, s){ ; } ;
int processKey(unsigned int) ;
} ;
int TestEdit::processKey(unsigned int key)
{
printf("process key %i\n",key) ;
return 0 ;
}
void main(void)
{
int key1;
clrscr() ;
char st[1024] ;
TestEdit edit1(1,1,10,10,"") ;
edit1.redraw() ;
edit.change() ;
}
Ofcource when you start the function change(), nothing else will be done
except editing your text. If you want to process some other function, you
will have to poll for a key and interpret this key yourself with the
member functions poll()
and interpKey(unsigned int key).
Look at this simple example to get an idea:
#include "edit.hpp"
void main(void)
{
Brainbox systems EDIT object kit Page 8
int key1 ;
clrscr() ;
char st[1024] ;
strcpy(st,"This is a line of text.") ;
Edit edit1(1,1,10,10,st) ;
edit1.redraw() ;
key1 = NULL ;
while (key1 != KEY_ESC )
{
if ((key1 = edit1.poll()) != NULL)
edit1.interpKey(key1) ;
}
}
That's all there is to it!
Input, output and terminalemulation
This is more complicated stuff, but realy shows the potential of this edit
object. If an edit object is created, it's input is derived from keyboard
and it's output is going to the console. Logic, isn't it? But you can
change that. If you want to get the input from file (or pexuser (see
later)), you can specify that. It is even possible to get the input from
more than one source!
The output is handled the same way. If you type something, you will have
to see what you typed. If a user types characters in the edit object using
the file inputs, it seems logic he or she gets the output from a file
either.
The terminal emulation is an other part. I only implemented ANSI and
SCREEN emulation. Ofcourse I realize, the SCREEN emulation is not really a
emulation. But in C you can position the cursor with gotoXY, which seems a
sort of emulation. If you set the output of an edit object to a file, you
can NOT specify a SCREEN emulation, because gotoXY will not work on a
file!
Proboard executables
As I said earlier, I made this source for my own use in the first place. I
use Proboard as bulletin board system. This is a superb packages wich
supports own made overlay (PEXes (Proboard EXecutables)). This is some
sort of system from which you can access the bulletin board own data and
function code from within your own program.
I made edit proboard compatible, because I like to write my own software
for my bbs. If you include PB_SDK.H, edit automatically compiles a source
as PEX. Because of an error in the Proboard software development kit
Brainbox systems EDIT object kit Page 9
(concerning pure virtual functions), I had to use PB_MBH.H which is
available as public domain.
If you make an edit object for proboard, direct the input from
(INPUT_PEXUSER) and the output to (OUTPUT_CON). This way output is going
to the sysop's console as well as to the users console.
Brainbox systems EDIT object kit Page 10
Memberfunction references
-------------------------
+------+
| Edit |
+ -----+
Constructor an Edit object
Declaration
Edit(int xx1, int yy1, int xx2, int yy2, unsigned char *txttxt) ;
Remarks
Initialization of an Edit object. The object is created with a
specified window. The cursor position is set at the first character
of the text. Memory is allocated for the text with an overhead of
1024 bytes (_BLOCK ). Input is taken from the KEYBOARD, OUTPUT is
going to the console.
Arguments | What argument is/does
------------+-----------------------------------------------------
xx1 | Set the left coordinate
yy1 | Set the top coordinate
xx2 | Set the right coordinate
yy2 | Set the bottom coordinate
txttxt | Text to display in the editor window
A constructor with no parameters may be given, but an object with a
private datamember 'err' = FALSE will be created. This object will
not be functional!
Brainbox systems EDIT object kit Page 11
+------------+
| setMargins |
+------------+
Change editor margins
Declaration
int setMargins(int top, int bottom, int tops, int bots) ;
Remarks
Sets new editor margins (sensitivity on scrolling and lines to
scroll). If the cursor reaches a certain line 'tops' or 'bots', the
editor will scroll for 'top' or 'bottom' lines
Arguments | What arguments is/does
------------+-----------------------------------------------------
top | Scrolls top lines down
bottom | Scrolls bottom lines up
tops | Scroll if editor reaches tops
bots | Scroll if editor reaches bots
Return
On succes setMargin will return 0
Brainbox systems EDIT object kit Page 12
+--------------+
| setCursorPos |
+--------------+
Change cursor position
Declaration
int setCursorPos(int pos)
Remarks
Change cursor position in the text to an absolute value
Argument | What argument does
------------+-----------------------------------------------------
curpos | Goto absolute cursor position
Return
On succes setMargin will return 0
+------------+
| setWindow |
+------------+
Change window size and position
Declaration
int setWindow(int xx1, int yy1, int xx2, int yy2) ;
Remarks
Changes the currect editors window positions. First clears the
current editor, changes the coordinates and redraws the new editor
window
Arguments | What argument is/does
------------+-----------------------------------------------------
xx1 | Set the left coordinate
yy1 | Set the top coordinate
xx2 | Set the right coordinate
yy2 | Set the bottom coordinate
Return
On succes setMargin will return 0
Brainbox systems EDIT object kit Page 13
+------------+
| setOutput |
+------------+
Change the ouput device
Declaration
void setOutput(unsigned int) ;
Remarks
You can change the output direction of the editted text to one or
more devices. Default the output is directed to the screen. This
function is derived from Output
Arguments | What argument is/does
------------+-----------------------------------------------------
outp | Outputmode
outp can be:
#define OUTPUT_NONE 0
#define OUTPUT_CON 1
*#define OUTPUT_COM1 2
*#define OUTPUT_COM2 4
*#define OUTPUT_COM3 8
*#define OUTPUT_COM4 16
#define OUTPUT_FILE 64
* Not implemented yet!!
Brainbox systems EDIT object kit Page 14
+----------+
| setTerm |
+----------+
Change the terminal emulation of the output device
Declaration
void setTerm(unsigned int term) ;
Remarks
This is a memberfunction of Terminal.
Different systems have different emulation modes. With this function
you can change the current emulation mode.
Arguments | What argument is/does
------------+-----------------------------------------------------
term | Termmode
term can be:
#define TERM_NONE 0
#define TERM_SCREEN 1
#define TERM_ANSI 2
*#define TERM_VT52 4
*Not implemented yet
+---------+
| setText |
+---------+
Change text in edit window
Declaration
int setText(unsigned char *st) ;
Remarks
Change the current text in the editor window
Arguments | What argument is/does
------------+-----------------------------------------------------
st | Text to display in the editor window
Return
On succes setText will return 0
Brainbox systems EDIT object kit Page 15
+-------------+
| setEditable |
+-------------+
Set edit status of edit object
Declaration
void setEditable(bool flag) ;
Remarks
When this flag is FALSE, the user can't alter the text inside the
edit box. It is however possible to scroll the text using the cursor
keys, pageup/down keys. Enter will scroll the cursor one line down.
Brainbox systems EDIT object kit Page 16
+----------+
| setColor |
+----------+
Change the text color
Declaration
void setColor(int color) ;
Remarks
Set the color of the for and background of the text displayed in the
edit object.
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀│Back-│Fore-
Constant │Value│grnd?│grnd?
══════════════╪═════╪═════╪═════
BLACK │ 0 │ Yes │ Yes
BLUE │ 1 │ Yes │ Yes
GREEN │ 2 │ Yes │ Yes
CYAN │ 3 │ Yes │ Yes
RED │ 4 │ Yes │ Yes
MAGENTA │ 5 │ Yes │ Yes
BROWN │ 6 │ Yes │ Yes
LIGHTGRAY │ 7 │ Yes │ Yes
DARKGRAY │ 8 │ No │ Yes
LIGHTBLUE │ 9 │ No │ Yes
LIGHTGREEN │ 10 │ No │ Yes
LIGHTCYAN │ 11 │ No │ Yes
LIGHTRED │ 12 │ No │ Yes
LIGHTMAGENTA │ 13 │ No │ Yes
YELLOW │ 14 │ No │ Yes
WHITE │ 15 │ No │ Yes
──────────────┼─────┼─────┼──────
BLINK │128 │ No │ ***
+-------------+
| setTopColor |
+-------------+
Change the left and top color of the border
Declaration
void setTopColor(int color) ;
Remarks
Sets the color of the fore and background of the left side and top of
the border
Brainbox systems EDIT object kit Page 17
+-------------+
| setBotColor |
+-------------+
Change the right bottom color of the border
Declaration
void setBotColor(int color) ;
Remarks
Set the color of the fore and background of the right side and bottom
of the border
+-----------+
| setBorder |
+-----------+
Set the border layout
Declaration
void setBorder(int) ;
Remarks
Set the border style (style -1 - 5 are valid)
If style -1 is chosen, the border is not displayed
Style: 0 1 2 3 4 5
╔ ┌ ░ ▒ ▓ █
║ │ ░ ▒ ▓ █
╚ └ ░ ▒ ▓ █
╗ ┐ ░ ▒ ▓ █
═ ─ ░ ▒ ▓ █
╝ ┘ ░ ▒ ▓ █
Brainbox systems EDIT object kit Page 18
+-----------+
| getBorder |
+-----------+
Get the border layout
Declaration
int getBorder(void) ;
Remarks
Returns the border style (style -1 - 5 are valid)
If style is -1, the border is not displayed
+----------+
| getInput |
+----------+
Tells the current input mode
Declaration
unsigned int getInput(void) ;
Remarks
See inputmode function setInput
Returns
Integer which represent the input flags
Brainbox systems EDIT object kit Page 19
+-----------+
| getOutput |
+-----------+
Tells the current output mode
Declaration
unsigned int getOutput(void) ;
Remarks
See outputmode function setOutput. This function is derived from
Ouput
Returns
Integer which represent the output flags
+---------+
| getTerm |
+---------+
Tells the current emulation mode
Declaration
unsigned int getTerm(void) ;
Remarks
See terminal modes from the function setTerm. This function is
derived from Terminal
Returns
Integer which represent the terminal mode flag
Brainbox systems EDIT object kit Page 20
+---------+
| getText |
+---------+
Get text from edit window
Declaration
unsigned char *getText(void) ;
Remarks
Get the text from the private datamember of Edit
Return
Returns a pointer to a text string
+-------------+
| getTopColor |
+-------------+
Get the color of the top left border
Declaration
unsigned char getTopColor(void) ;
Remarks
Retrieve the color status of the top left part of the border around
the edit box
Return
Return an integer. See setColor.
Brainbox systems EDIT object kit Page 21
+-------------+
| getBotColor |
+-------------+
Get the color of the bottom right border
Declaration
unsigned char getBotColor(void) ;
Remarks
Retrieve the color status of the bottom right part of the border
around the edit box
Return
Return an integer. See setColor.
+----------+
| setInput |
+----------+
Change input mode
Declaration
void setInput(unsigned int inp) ;
Remarks
Set the origin of the input
Arguments | What argument is/does
------------+-----------------------------------------------------
inp | Inputmode
inp can be:
#define INPUT_NONE 0
#define INPUT_KEYBOARD 1
*#define INPUT_COM1 2
*#define INPUT_COM2 4
*#define INPUT_COM3 8
*#define INPUT_COM4 16
#define INPUT_PEXUSER 32
#define INPUT_FILE 64
* Not implemented yet!!
Brainbox systems EDIT object kit Page 22
+------+
| poll |
+------+
Poll for a key
Declaration
int poll(void) ;
Remarks
Polls the inputmode (see setInput) for a key
Return
a NULL if no key was found
a integer representing the key found. If the lower part of this
integer is zero, the key was an extended key.
+-----------+
| interpKey |
+-----------+
Interpret a key
Declaration
void interpKey(int key) ;
Remarks
Executes key commands. When a key was found with the poll() function,
this function will act accordingly. If the key couldn't be processed,
the function processKey() will be called. This function can be
overriden in a derived class.
Interp() will redisplay the changed lines automatically
Arguments | What argument is/does
------------+-----------------------------------------------------
key | The key to interpret
Example
#include "edit.hpp"
void main(void)
{
int key1 ;
clrscr() ;
char st[1024] ;
strcpy(st,"This is a line of text.") ;
Edit edit1(1,1,10,10,st) ;
Brainbox systems EDIT object kit Page 23
edit1.redraw() ;
key1 = NULL ;
while (key1 != KEY_ESC )
{
if ((key1 = edit1.poll()) != NULL)
edit1.interpKey(key1) ;
}
}
Brainbox systems EDIT object kit Page 24
+------------+
| processKey |
+------------+
Process not interpeted keys
Declaration
int processKey(unsigned int) ;
Remarks
This function should be overriden in a derived class if you want to
use the extended keys the editor object doesn't use.
Arguments | What argument is/does
------------+-----------------------------------------------------
key | The key to interpet
Example
#include "edit.hpp"
class TestEdit : public Edit
{
public:
TestEdit(int x1, int y1, int x2, int y2, char *s) : Edit(x1,
y1, x2, y2, s){ ; } ;
int processKey(unsigned int) ;
} ;
int TestEdit::processKey(unsigned int key)
{
printf("process key %i\n",key) ;
return 0 ;
}
void main(void)
{
int key1;
clrscr() ;
char st[1024] ;
TestEdit edit1(1,1,10,10,"") ;
edit1.redraw() ;
edit.change() ;
}
Return
In the edit class, processKey() returns the key
Brainbox systems EDIT object kit Page 25
+--------+
| change |
+--------+
Enter edit mode
Declaration
void change(void) ;
Remarks
Let the user edit the text in the editor object. ESC will finish
editting.
+--------+
| redraw |
+--------+
Redraw a screen
Declaration
redraw(void) ;
Remarks
Redraws the total edit window. All lines are rewritten!
+--------------+
| redrawCursor |
+--------------+
Postion cursor
Declaration
void redrawCursor(void) ;
Remarks
Redraws the cursor at the current cursor position
Brainbox systems EDIT object kit Page 26
+------------+
| clrWindow |
+------------+
Clear edit window
Declaration
void clrWindow(void) ;
Remarks
Clear the contents of the edit window
+----------+
| loadFile |
+----------+
Load a textfile
Declaration
int loadFile(char *fileName) ;
Remarks
Loads an ASCII file into the editor object. Memory for this text file
will be allocated.
Arguments | What argument is/does
------------+-----------------------------------------------------
fileName | Pointer to the name of the ASCII file
Return
On succes loadFile will return a zero
Brainbox systems EDIT object kit Page 27
+----------+
| saveFile |
+----------+
Save text
Declaration
int saveFile(char *fileName) ;
Remarks
Saves the contents of an ASCII file to a file named fileName
Arguments | What argument is/does
------------+-----------------------------------------------------
fileName | Pointer to the name of the ASCII file
Return
On succes saveFile will return a zero
+-------+
| error |
+-------+
Error status of an edit object
Declaration
bool error(void) ;
Remarks
Some functions can generate errors. For example the loadFile function
can generate an error while allocating memory. In this case, the text
in the editor will be destroyed. If the error function returns TRUE,
the edit object can't be used anymore. With normal use (small ASCII
files), the error status always be FALSE.
Brainbox systems EDIT object kit Page 28
Derived classes
This edit object was written for deriving your own classes. I have put
some examples of my own usage in this package. The first project I needed
an editor for was a Bulletin Board editor as PEX (Proboard EXecutable). In
this editor I wanted to use abbreviation and wanted to display quoted
lines in another color.
AbbreviationsEdit
The abbreviation object is a simple demonstration showing how to derive
classes from the edit class and to override some memberfunctions. With
this class you can accomplish to type some keys and automaticaly have them
expanded to words or sentences.
The words that are expanded can be read from a file just as the wordt they
area expanded to. The odd lines of this file contain the words to type and
the even lines contain the words they area expanded to. The file can be
loaded with the memberfunction 'loadAbreviation'. The status of the
instance of this object can be set.
+-----------------+
| setAbbrevStatus |
+-----------------+
Sets the status
Declaration
void setAbbrevStatus(bool stat) ;
Remarks
You can switch of the abbreviation mode an on again with this
function.
Brainbox systems EDIT object kit Page 29
+------------------+
| loadAbbreviation |
+------------------+
Loads a list of abbreviations
Declaration
int loadAbbreviation(char *filename) ;
Loads a list of abbreviation from a file. This list contains the
words whicht have to be replaced on the odd lines with the words on
the even lines
Return
On succes, this functions returns a 0
See the example.doc file for more information.
QuoteEdit
QuoteEdit will display quoted lines in another color. For this purpose the
functions 'display' and 'redraw' are overloaded. The quote color can be
set with the function setQuoteColor(unsigned color) and retrieved withthe
function getQuoteColor.
Brainbox systems EDIT object kit Page 30
GNU license
-----------
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The license agreements of most software companies try to keep users
at the mercy of those companies. By contrast, our General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.
When we speak of free software, we are referring to freedom, not
price. Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of a such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must tell them their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
The precise terms and conditions for copying, distribution and
modification follow.
Brainbox systems EDIT object kit Page 31
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any program or other work which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License. The
"Program", below, refers to any such program or work, and a "work based
on the Program" means either the Program or any work containing the
Program or a portion of it, either verbatim or with modifications. Each
licensee is addressed as "you".
1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program. You may charge a fee for the physical act of
transferring a copy.
2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of
Paragraph
1 above, provided that you also do the following:
a) cause the modified files to carry prominent notices stating that
you changed the files and the date of any change; and
b) cause the whole of any work that you distribute or publish, that
in whole or in part contains the Program or any part thereof, either
with or without modifications, to be licensed at no charge to all
third parties under the terms of this General Public License (except
that you may choose to grant warranty protection to some or all
third parties, at your option).
c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use
in the simplest and most usual way, to print or display an
announcement including an appropriate copyright notice and a notice
that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these
conditions, and telling the user how to view a copy of this General
Public License.
d) You may charge a fee for the physical act of transferring a
copy, and you may at your option offer warranty protection in
exchange for a fee.
Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.
Brainbox systems EDIT object kit Page 32
3. You may copy and distribute the Program (or a portion or derivative
of
it, under Paragraph 2) in object code or executable form under the terms
of
Paragraphs 1 and 2 above provided that you also do one of the following:
a) accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of
Paragraphs 1 and 2 above; or,
b) accompany it with a written offer, valid for at least three
years, to give any third party free (except for a nominal charge
for the cost of distribution) a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of
Paragraphs 1 and 2 above; or,
c) accompany it with the information you received as to where the
corresponding source code may be obtained. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form alone.)
Source code for a work means the preferred form of the work for making
modifications to it. For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.
4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License. However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.
5. By copying, distributing or modifying the Program (or any work based
on the Program) you indicate your acceptance of this license to do so,
and all its terms and conditions.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these
terms and conditions. You may not impose any further restrictions on the
recipients' exercise of the rights granted herein.
Brainbox systems EDIT object kit Page 33
7. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of the license which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
the license, you may choose any version ever published by the Free
Software
Foundation.
8. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Brainbox systems EDIT object kit Page 34
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it
does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19xx name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show
w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License. Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your
program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (a program to direct compilers to make passes
at assemblers) written by James Hacker.
Brainbox systems EDIT object kit Page 35
// End of document