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 >
Text File  |  1994-09-08  |  50KB  |  1,680 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.                                     Edit object
  13.  
  14.  
  15.  
  16.                                 By P.M.Bloemendaal
  17.                                      (c) 1994
  18.  
  19.  
  20.  
  21.                                       eMail 
  22.                         internet : bloemendaal@rullf2.leidenuniv.nl
  23.                         fidonet  : 2:281/908
  24.  
  25.          Thanks  to   TJS  of  MBH   for  general  support,   great  ideas  and
  26.          hairsplitting  capabilities  and  I_A  for  his  bounce  checking  and
  27.          metamorphosis of my source code.  Without them, the EDIT  kit wouldn't
  28.          be what it is today!
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.     Brainbox systems EDIT object kit                                     Page 2
  37.  
  38.  
  39.     This document is:
  40.          Copyright 1994 by Brainbox systems
  41.          Distributed under license by the Free Software Foundation, Inc.
  42.  
  43.          This file is part of the EDIT object development kit.
  44.  
  45.          This source is  free software; you can  redistribute it and or  modify
  46.          it under the terms  of the GNU General Public License  as published by
  47.          the Free Software Foundation.
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.     Brainbox systems EDIT object kit                                     Page 3
  56.  
  57.     Contents
  58.     --------
  59.  
  60.  
  61.     Contents  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     3
  62.  
  63.     License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     4
  64.          No warranty  . . . . . . . . . . . . . . . . . . . . . . . . . .     4
  65.  
  66.     What is the edit object . . . . . . . . . . . . . . . . . . . . . . .     6
  67.          Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     6
  68.  
  69.     How to use it . . . . . . . . . . . . . . . . . . . . . . . . . . . .     7
  70.          Input, output and terminalemulation  . . . . . . . . . . . . . .     8
  71.          Proboard executables . . . . . . . . . . . . . . . . . . . . . .     8
  72.  
  73.     Memberfunction references . . . . . . . . . . . . . . . . . . . . . .    10
  74.          Edit(int xx1, int yy1, int xx2, int yy2, unsigned char *txttxt)     10
  75.          int  setMargins(int top, int bottom, int tops, int bots) . . . .    11
  76.          int setCursorPos(int pos)  . . . . . . . . . . . . . . . . . . .    12
  77.          int  setWindow(int xx1, int yy1, int xx2, int yy2) . . . . . . .    12
  78.          void setOutput(unsigned int) . . . . . . . . . . . . . . . . . .    13
  79.          void setTerm(unsigned int term)  . . . . . . . . . . . . . . . .    14
  80.          int  setText(unsigned char *st)  . . . . . . . . . . . . . . . .    14
  81.          void setEditable(bool flag)  . . . . . . . . . . . . . . . . . .    15
  82.          void setColor(int color) . . . . . . . . . . . . . . . . . . . .    15
  83.          void setTopColor(int color)  . . . . . . . . . . . . . . . . . .    16
  84.          void setBotColor(int color)  . . . . . . . . . . . . . . . . . .    17
  85.          void setBorder(int)  . . . . . . . . . . . . . . . . . . . . . .    17
  86.          int getBorder(void)  . . . . . . . . . . . . . . . . . . . . . .    18
  87.          unsigned int getInput(void)  . . . . . . . . . . . . . . . . . .    18
  88.          unsigned int getOutput(void) . . . . . . . . . . . . . . . . . .    19
  89.          unsigned int getTerm(void) . . . . . . . . . . . . . . . . . . .    19
  90.          unsigned char *getText(void) . . . . . . . . . . . . . . . . . .    20
  91.          unsigned char getTopColor(void)  . . . . . . . . . . . . . . . .    20
  92.          unsigned char getBotColor(void)  . . . . . . . . . . . . . . . .    21
  93.          void setInput(unsigned int inp)  . . . . . . . . . . . . . . . .    21
  94.          int  poll(void)  . . . . . . . . . . . . . . . . . . . . . . . .    22
  95.          void interpKey(int key)  . . . . . . . . . . . . . . . . . . . .    22
  96.          int  processKey(unsigned int)  . . . . . . . . . . . . . . . . .    24
  97.          void change(void)  . . . . . . . . . . . . . . . . . . . . . . .    25
  98.          redraw(void) . . . . . . . . . . . . . . . . . . . . . . . . . .    25
  99.          void redrawCursor(void)  . . . . . . . . . . . . . . . . . . . .    25
  100.          void clrWindow(void) . . . . . . . . . . . . . . . . . . . . . .    26
  101.          int loadFile(char *fileName) . . . . . . . . . . . . . . . . . .    26
  102.          int saveFile(char *fileName) . . . . . . . . . . . . . . . . . .    27
  103.          bool error(void) . . . . . . . . . . . . . . . . . . . . . . . .    27
  104.  
  105.     Derived classes . . . . . . . . . . . . . . . . . . . . . . . . . . .    28
  106.          AbbreviationsEdit  . . . . . . . . . . . . . . . . . . . . . . .    28
  107.          QuoteEdit  . . . . . . . . . . . . . . . . . . . . . . . . . . .    29
  108.  
  109.     GNU license . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    30
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.     Brainbox systems EDIT object kit                                     Page 4
  118.  
  119.     License
  120.     -------
  121.  
  122.     Distribution &  usage license. In   a   nutshell,   this   license   states
  123.     that  anyone writing code  distributing it under  the GNU license, will:
  124.  
  125.          1)   NOT require money in any way from the user.
  126.  
  127.          2)   distribute everything including sourcecode
  128.  
  129.          3)   will not be   liable for any  direct or  indirect  damages caused
  130.               by the use of the distribution.
  131.  
  132.     Furthermore  the  license  states that  anyone  distributing  GNU  licensed
  133.     material, should NOT remove the  sourcecode from  the distribution,  unless
  134.     absolutely necessary.
  135.     In  any  case, the  GNU  license agreement  should  be  included with  each
  136.     distribution.
  137.     Each  distribution should  also contain  contact addresses  of the  various
  138.     authors  (for feedback) and should   list where the sourcecode   (if not in
  139.     the  distribution package)  can  be obtained  for  free (except  for postal
  140.     charges).
  141.  
  142.     These distributions are NOT  allowed to be included on any  media, which is
  143.     sold for  the purpose  of profit (this  is prohibited by  the   GNU license
  144.     too!), for example CD's or Bulletin Boards requiring a registration fee.
  145.     Bulletin Boards  requiring a  registration fee  or  any means   of  limited
  146.     access  for the public, who want to  distribute this software, are required
  147.     to make  this software accessible for  FREE (free download) for  all users,
  148.     including the users  logging into the Bulletin  Board System for the  first
  149.     time.
  150.  
  151.     For   a  complete   GNU license   agreement,  please refer  to  the chapter
  152.     concerning the GNU license.
  153.  
  154.  
  155.  
  156.  
  157.     No warranty
  158.  
  159.                                              NO WARRANTY
  160.  
  161.                             BECAUSE THE PROGRAM  IS LICENSED FREE  OF CHARGE,
  162.                             THERE  IS NO  WARRANTY FOR  THE  PROGRAM, TO  THE
  163.                             EXTENT PERMITTED  BY APPLICABLE LAW. EXCEPT  WHEN
  164.                             OTHERWISE   STATED   IN  WRITING   THE  COPYRIGHT
  165.                             HOLDERS AND/OR OTHER  PARTIES PROVIDE THE PROGRAM
  166.                             "AS  IS"  WITHOUT  WARRANTY OF  ANY  KIND, EITHER
  167.                             EXPRESSED  OR IMPLIED, INCLUDING, BUT NOT LIMITED
  168.                             TO,  THE  IMPLIED WARRANTIES  OF  MERCHANTABILITY
  169.                             AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE
  170.                             RISK AS  TO THE  QUALITY AND  PERFORMANCE OF  THE
  171.                             PROGRAM  IS  WITH YOU.  SHOULD THE  PROGRAM PROVE
  172.                             DEFECTIVE,  YOU ASSUME THE COST  OF ALL NECESSARY
  173.                             SERVICING, REPAIR OR CORRECTION.
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.     Brainbox systems EDIT object kit                                     Page 5
  182.  
  183.                             IN NO EVENT UNLESS REQUIRED BY  APPLICABLE LAW OR
  184.                             AGREED TO IN  WRITING WILL ANY COPYRIGHT  HOLDER,
  185.                             OR  ANY  OTHER  PARTY   WHO  MAY  MODIFY   AND/OR
  186.                             REDISTRIBUTE THE  PROGRAM AS PERMITTED ABOVE,  BE
  187.                             LIABLE  TO   YOU  FOR   DAMAGES,  INCLUDING   ANY
  188.                             GENERAL,  SPECIAL,  INCIDENTAL  OR  CONSEQUENTIAL
  189.                             DAMAGES ARISING  OUT OF THE  USE OR INABILITY  TO
  190.                             USE  THE PROGRAM  (INCLUDING  BUT NOT  LIMITED TO
  191.                             LOSS OF  DATA OR  DATA BEING RENDERED  INACCURATE
  192.                             OR  LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
  193.                             FAILURE OF THE PROGRAM TO OPERATE  WITH ANY OTHER
  194.                             PROGRAMS),  EVEN IF  SUCH HOLDER  OR  OTHER PARTY
  195.                             HAS  BEEN  ADVISED  OF  THE POSSIBILITY  OF  SUCH
  196.                             DAMAGES.
  197.  
  198.                                      END OF TERMS AND CONDITIONS
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.     Brainbox systems EDIT object kit                                     Page 6
  207.  
  208.     What is the edit object
  209.     -----------------------
  210.  
  211.     I create  this edit source in the first place for  my own personal use. But
  212.     since I  see  a lot  of questions  for editors  in C  with  source code,  I
  213.     decided to donate this source to the public domain.
  214.     With this source  you can create one  or more instances of  an wordwrapping
  215.     editor that  will be  placed at  the exact  location you  specify. You  can
  216.     change the  input and the  output of the  editor as  well as the  emulation
  217.     mode. Since I only  use ANSI emulation,  I only implemented this  emulation
  218.     mode, but if you want you can implement your own emulation if necesary.
  219.     This  object is  ment  for derivation  of  your own  objects.  In your  own
  220.     objects you can make changes for  one or more member function if you  wish.
  221.     As an example  I included an  abbreviation class that  will load a list  of
  222.     words  and translations  of  these words  and  overload the  memberfunction
  223.     addchar(int key).
  224.  
  225.  
  226.  
  227.     Errors
  228.  
  229.     If you encounter  errors in these sources, please report them to me. I will
  230.     debug them and update this sources packages!
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.     Brainbox systems EDIT object kit                                     Page 7
  239.  
  240.     How to use it
  241.     -------------
  242.  
  243.     Just include edit.hpp and derive your own  class from it. You will have  to
  244.     define the constructor of  the class (a nasty  syntax in c++), but you  can
  245.     look at  the example.  Create an instance  of your  just derived class  and
  246.     call  redraw() and change()  to display and edit  your text.  If you define
  247.     the function processKey(unsigned int key)  in your source, all  not handled
  248.     keys will pass this function.
  249.     Look at this simple example:
  250.  
  251.             #include "edit.hpp"
  252.  
  253.             class TestEdit : public Edit
  254.             {
  255.                public:
  256.  
  257.                   TestEdit(int x1, int y1, int x2, int  y2, char *s) : Edit(x1,
  258.                      y1,x2, y2, s){ ; } ;
  259.                   int processKey(unsigned int)  ;
  260.             } ;
  261.  
  262.  
  263.             int TestEdit::processKey(unsigned int key)
  264.             {
  265.                printf("process key %i\n",key) ;
  266.                return 0 ;
  267.             }
  268.  
  269.             void main(void)
  270.             {
  271.  
  272.                int key1;
  273.  
  274.                clrscr() ;
  275.                char st[1024] ;
  276.  
  277.                TestEdit edit1(1,1,10,10,"") ;
  278.  
  279.                edit1.redraw() ;
  280.                edit.change() ;
  281.             }
  282.  
  283.  
  284.     Ofcource when you start  the function change(), nothing  else will be  done
  285.     except editing your text. If you  want to process some other function,  you
  286.     will  have to  poll  for a  key and  interpret this  key yourself  with the
  287.     member functions poll() 
  288.     and interpKey(unsigned int key).
  289.     Look at this simple example to get an idea:
  290.  
  291.             #include "edit.hpp"
  292.  
  293.             void main(void)
  294.             {
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.     Brainbox systems EDIT object kit                                     Page 8
  303.  
  304.                int key1 ;
  305.  
  306.                clrscr() ;
  307.                char st[1024] ;
  308.                strcpy(st,"This is a line of text.") ;
  309.  
  310.                Edit edit1(1,1,10,10,st) ;
  311.  
  312.                edit1.redraw() ;
  313.  
  314.                key1 = NULL ;
  315.                while (key1 != KEY_ESC )
  316.                {
  317.                   if ((key1 = edit1.poll()) != NULL)
  318.                      edit1.interpKey(key1) ;
  319.                }
  320.             }
  321.  
  322.  
  323.     That's all there is to it!
  324.  
  325.  
  326.  
  327.     Input, output and terminalemulation
  328.  
  329.     This is more complicated stuff, but realy shows the potential of this  edit
  330.     object. If an edit  object is created, it's input is  derived from keyboard
  331.     and it's  output is  going to  the console.  Logic, isn't it?  But you  can
  332.     change that.  If you  want  to get  the input  from file  (or pexuser  (see
  333.     later)), you can  specify that. It is even  possible to get the  input from
  334.     more than one source!
  335.  
  336.     The  output is handled the  same way. If you type  something, you will have
  337.     to  see what you typed. If a user types characters in the edit object using
  338.     the file inputs,  it seems  logic he  or she gets  the output  from a  file
  339.     either.
  340.  
  341.     The  terminal emulation  is  an other  part.  I only  implemented ANSI  and
  342.     SCREEN emulation. Ofcourse I  realize, the SCREEN emulation is not really a
  343.     emulation. But  in C you can position the cursor with gotoXY, which seems a
  344.     sort of emulation. If you set  the output of an edit object to a  file, you
  345.     can NOT  specify a  SCREEN emulation,  because gotoXY  will not  work on  a
  346.     file!
  347.  
  348.  
  349.  
  350.     Proboard executables
  351.  
  352.     As I  said earlier, I made this source for my own use in the first place. I
  353.     use Proboard  as bulletin  board system.  This is  a  superb packages  wich
  354.     supports  own made  overlay (PEXes  (Proboard EXecutables)).  This is  some
  355.     sort  of system from which  you can access the  bulletin board own data and
  356.     function code from within your own program.
  357.     I made edit  proboard compatible, because I  like to write my  own software
  358.     for my bbs. If you include  PB_SDK.H, edit automatically compiles a  source
  359.     as  PEX. Because  of  an error  in  the Proboard  software  development kit
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.     Brainbox systems EDIT object kit                                     Page 9
  368.  
  369.     (concerning  pure  virtual functions),  I  had  to  use  PB_MBH.H which  is
  370.     available as public domain.
  371.  
  372.     If  you  make   an  edit  object  for  proboard,   direct  the  input  from
  373.     (INPUT_PEXUSER) and  the output to  (OUTPUT_CON). This way  output is going
  374.     to the sysop's console as well as to the users console.
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.     Brainbox systems EDIT object kit                                    Page 10
  383.  
  384.     Memberfunction references
  385.     -------------------------
  386.  
  387.  
  388.  
  389.     +------+
  390.     | Edit |
  391.     + -----+
  392.  
  393.          Constructor an Edit object
  394.  
  395.  
  396.     Declaration
  397.  
  398.          Edit(int xx1, int yy1, int xx2, int yy2, unsigned char *txttxt) ;
  399.  
  400.  
  401.     Remarks
  402.  
  403.          Initialization  of  an Edit  object.  The  object  is  created with  a
  404.          specified window.  The cursor position  is set at  the first character
  405.          of the text.  Memory is  allocated for the  text with  an overhead  of
  406.          1024 bytes  (_BLOCK ).  Input is  taken from the  KEYBOARD, OUTPUT  is
  407.          going to the console.
  408.  
  409.  
  410.          Arguments   |    What argument is/does
  411.          ------------+-----------------------------------------------------
  412.          xx1         |    Set the left coordinate
  413.          yy1         |    Set the top coordinate
  414.          xx2         |    Set the right coordinate
  415.          yy2         |    Set the bottom coordinate
  416.          txttxt      |    Text to display in the editor window
  417.  
  418.  
  419.          A constructor with  no parameters may be  given, but an object  with a
  420.          private datamember 'err'  = FALSE will  be created.  This object  will
  421.          not be functional!
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.     Brainbox systems EDIT object kit                                    Page 11
  430.  
  431.     +------------+
  432.     | setMargins |
  433.     +------------+
  434.  
  435.          Change editor margins
  436.  
  437.  
  438.     Declaration
  439.  
  440.          int  setMargins(int top, int bottom, int tops, int bots) ;
  441.  
  442.  
  443.     Remarks
  444.  
  445.          Sets  new  editor  margins (sensitivity  on  scrolling  and  lines  to
  446.          scroll).  If the cursor reaches  a certain line  'tops' or 'bots', the
  447.          editor will scroll for 'top' or 'bottom' lines
  448.  
  449.          Arguments   |    What arguments is/does
  450.          ------------+-----------------------------------------------------
  451.          top         |    Scrolls top lines down
  452.          bottom      |    Scrolls bottom lines up
  453.          tops        |    Scroll if editor reaches tops
  454.          bots        |    Scroll if editor reaches bots
  455.  
  456.     Return
  457.  
  458.          On succes setMargin will return 0
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.     Brainbox systems EDIT object kit                                    Page 12
  467.  
  468.     +--------------+
  469.     | setCursorPos |
  470.     +--------------+
  471.  
  472.          Change cursor position
  473.  
  474.  
  475.     Declaration
  476.  
  477.          int setCursorPos(int pos)
  478.  
  479.  
  480.     Remarks
  481.  
  482.          Change cursor position in the text to an absolute value
  483.  
  484.          Argument    |    What argument does
  485.          ------------+-----------------------------------------------------
  486.          curpos      |    Goto absolute cursor position
  487.  
  488.  
  489.     Return
  490.  
  491.          On succes setMargin will return 0
  492.  
  493.  
  494.  
  495.     +------------+
  496.     | setWindow  |
  497.     +------------+
  498.  
  499.          Change window size and position
  500.  
  501.     Declaration
  502.  
  503.          int  setWindow(int xx1, int yy1, int xx2, int yy2) ;
  504.  
  505.  
  506.     Remarks
  507.  
  508.          Changes  the  currect  editors  window  positions.  First  clears  the
  509.          current editor,  changes the  coordinates and  redraws the new  editor
  510.          window
  511.  
  512.          Arguments   |    What argument is/does
  513.          ------------+-----------------------------------------------------
  514.          xx1         |    Set the left coordinate
  515.          yy1         |    Set the top coordinate
  516.          xx2         |    Set the right coordinate
  517.          yy2         |    Set the bottom coordinate
  518.  
  519.  
  520.     Return
  521.  
  522.          On succes setMargin will return 0
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.     Brainbox systems EDIT object kit                                    Page 13
  531.  
  532.  
  533.     +------------+
  534.     | setOutput  |
  535.     +------------+
  536.  
  537.          Change the ouput device
  538.  
  539.     Declaration
  540.  
  541.          void setOutput(unsigned int) ;
  542.  
  543.     Remarks
  544.  
  545.          You  can change the  output direction  of the  editted text to  one or
  546.          more  devices. Default  the  output is  directed  to the  screen. This
  547.          function is derived from Output
  548.  
  549.          Arguments   |    What argument is/does
  550.          ------------+-----------------------------------------------------
  551.          outp        |    Outputmode
  552.  
  553.          outp can be:
  554.  
  555.          #define OUTPUT_NONE    0
  556.          #define OUTPUT_CON     1
  557.          *#define OUTPUT_COM1    2
  558.          *#define OUTPUT_COM2    4
  559.          *#define OUTPUT_COM3    8
  560.          *#define OUTPUT_COM4    16
  561.          #define OUTPUT_FILE    64
  562.  
  563.          * Not implemented yet!!
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.     Brainbox systems EDIT object kit                                    Page 14
  572.  
  573.     +----------+
  574.     | setTerm  |
  575.     +----------+
  576.  
  577.          Change the terminal emulation of the output device
  578.  
  579.     Declaration
  580.  
  581.          void setTerm(unsigned int term) ;
  582.  
  583.     Remarks
  584.  
  585.          This is a memberfunction of Terminal.
  586.          Different systems have  different emulation modes. With  this function
  587.          you can change the current emulation mode.
  588.  
  589.          Arguments   |    What argument is/does
  590.          ------------+-----------------------------------------------------
  591.          term        |    Termmode
  592.  
  593.          term can be:
  594.  
  595.          #define TERM_NONE      0
  596.          #define TERM_SCREEN    1
  597.          #define TERM_ANSI      2
  598.          *#define TERM_VT52      4
  599.  
  600.          *Not implemented yet
  601.  
  602.  
  603.  
  604.     +---------+
  605.     | setText |
  606.     +---------+
  607.  
  608.          Change text in edit window
  609.  
  610.     Declaration
  611.  
  612.          int  setText(unsigned char *st) ;
  613.  
  614.  
  615.     Remarks
  616.  
  617.          Change the current text in the editor window
  618.  
  619.          Arguments   |    What argument is/does
  620.          ------------+-----------------------------------------------------
  621.          st          |    Text to display in the editor window
  622.  
  623.  
  624.     Return
  625.  
  626.          On succes setText will return 0
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.     Brainbox systems EDIT object kit                                    Page 15
  635.  
  636.     +-------------+
  637.     | setEditable |
  638.     +-------------+
  639.  
  640.          Set edit status of edit object
  641.  
  642.     Declaration
  643.  
  644.          void setEditable(bool flag) ;
  645.  
  646.     Remarks
  647.  
  648.          When this flag  is FALSE,  the user can't  alter the  text inside  the
  649.          edit box.  It is however possible to scroll  the text using the cursor
  650.          keys, pageup/down keys. Enter will scroll the cursor one line down.
  651.  
  652.  
  653.             
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.     Brainbox systems EDIT object kit                                    Page 16
  662.  
  663.     +----------+
  664.     | setColor |
  665.     +----------+
  666.  
  667.          Change the text color
  668.  
  669.     Declaration
  670.  
  671.          void setColor(int color) ;
  672.  
  673.     Remarks
  674.  
  675.          Set the color of the for  and background of the text displayed in  the
  676.          edit object.
  677.  
  678.          ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀│Back-│Fore-
  679.           Constant     │Value│grnd?│grnd?
  680.          ══════════════╪═════╪═════╪═════
  681.           BLACK        │  0  │ Yes │ Yes
  682.           BLUE         │  1  │ Yes │ Yes
  683.           GREEN        │  2  │ Yes │ Yes
  684.           CYAN         │  3  │ Yes │ Yes
  685.           RED          │  4  │ Yes │ Yes
  686.           MAGENTA      │  5  │ Yes │ Yes
  687.           BROWN        │  6  │ Yes │ Yes
  688.           LIGHTGRAY    │  7  │ Yes │ Yes
  689.           DARKGRAY     │  8  │ No  │ Yes
  690.           LIGHTBLUE    │  9  │ No  │ Yes
  691.           LIGHTGREEN   │ 10  │ No  │ Yes
  692.           LIGHTCYAN    │ 11  │ No  │ Yes
  693.           LIGHTRED     │ 12  │ No  │ Yes
  694.           LIGHTMAGENTA │ 13  │ No  │ Yes
  695.           YELLOW       │ 14  │ No  │ Yes
  696.           WHITE        │ 15  │ No  │ Yes
  697.          ──────────────┼─────┼─────┼──────
  698.           BLINK        │128  │ No  │ ***
  699.  
  700.     +-------------+
  701.     | setTopColor |
  702.     +-------------+
  703.  
  704.          Change the left and top color of the border
  705.  
  706.     Declaration
  707.  
  708.          void setTopColor(int color) ;
  709.  
  710.     Remarks
  711.  
  712.          Sets the color of the fore and background of  the left side and top of
  713.          the border
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.     Brainbox systems EDIT object kit                                    Page 17
  722.  
  723.     +-------------+
  724.     | setBotColor |
  725.     +-------------+
  726.  
  727.          Change the right bottom color of the border
  728.  
  729.     Declaration
  730.  
  731.          void setBotColor(int color) ;
  732.  
  733.     Remarks
  734.  
  735.          Set the color of the fore and background of the  right side and bottom
  736.          of the border
  737.  
  738.  
  739.  
  740.     +-----------+
  741.     | setBorder |
  742.     +-----------+
  743.  
  744.          Set the border layout
  745.  
  746.     Declaration
  747.  
  748.          void setBorder(int) ;
  749.  
  750.     Remarks
  751.  
  752.          Set the border style (style -1 - 5 are valid)
  753.          If style -1 is chosen, the border is not displayed
  754.  
  755.          Style:    0 1 2 3 4 5
  756.                    ╔ ┌ ░ ▒ ▓ █
  757.                    ║ │ ░ ▒ ▓ █
  758.                    ╚ └ ░ ▒ ▓ █
  759.                    ╗ ┐ ░ ▒ ▓ █
  760.                    ═ ─ ░ ▒ ▓ █
  761.                    ╝ ┘ ░ ▒ ▓ █
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.     Brainbox systems EDIT object kit                                    Page 18
  770.  
  771.     +-----------+
  772.     | getBorder |
  773.     +-----------+
  774.  
  775.          Get the border layout
  776.  
  777.     Declaration
  778.  
  779.          int getBorder(void) ;
  780.  
  781.     Remarks
  782.  
  783.          Returns the border style (style -1 - 5 are valid)
  784.          If style is -1, the border is not displayed
  785.  
  786.  
  787.  
  788.     +----------+
  789.     | getInput |
  790.     +----------+
  791.  
  792.          Tells the current input mode
  793.  
  794.  
  795.     Declaration
  796.  
  797.          unsigned int getInput(void) ;
  798.  
  799.  
  800.     Remarks
  801.  
  802.          See inputmode function setInput
  803.  
  804.  
  805.     Returns
  806.  
  807.          Integer which represent the input flags
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.     Brainbox systems EDIT object kit                                    Page 19
  816.  
  817.     +-----------+
  818.     | getOutput |
  819.     +-----------+
  820.  
  821.          Tells the current output mode
  822.  
  823.  
  824.     Declaration
  825.  
  826.          unsigned int getOutput(void) ;
  827.  
  828.  
  829.     Remarks
  830.  
  831.          See  outputmode function  setOutput.  This  function is  derived  from
  832.          Ouput
  833.  
  834.  
  835.     Returns
  836.  
  837.          Integer which represent the output flags
  838.  
  839.  
  840.  
  841.     +---------+
  842.     | getTerm |
  843.     +---------+
  844.  
  845.          Tells the current emulation mode
  846.  
  847.  
  848.     Declaration
  849.  
  850.          unsigned int getTerm(void) ;
  851.  
  852.  
  853.     Remarks
  854.  
  855.          See  terminal  modes  from  the  function  setTerm. This  function  is
  856.          derived from Terminal
  857.  
  858.  
  859.     Returns
  860.  
  861.          Integer which represent the terminal mode flag
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.     Brainbox systems EDIT object kit                                    Page 20
  870.  
  871.     +---------+
  872.     | getText |
  873.     +---------+
  874.  
  875.          Get text from edit window
  876.  
  877.     Declaration
  878.  
  879.          unsigned char *getText(void) ;
  880.  
  881.  
  882.     Remarks
  883.  
  884.          Get the text from the private datamember of Edit
  885.  
  886.  
  887.     Return
  888.  
  889.          Returns a pointer to a text string
  890.  
  891.  
  892.     +-------------+
  893.     | getTopColor |
  894.     +-------------+
  895.  
  896.          Get the color of the top left border
  897.  
  898.     Declaration
  899.  
  900.          unsigned char getTopColor(void) ;
  901.  
  902.     Remarks 
  903.  
  904.          Retrieve the color  status of the top  left part of the  border around
  905.          the edit box
  906.  
  907.     Return
  908.  
  909.          Return an integer. See setColor.
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.     Brainbox systems EDIT object kit                                    Page 21
  918.  
  919.     +-------------+
  920.     | getBotColor |
  921.     +-------------+
  922.  
  923.          Get the color of the bottom right border
  924.  
  925.     Declaration
  926.  
  927.          unsigned char getBotColor(void) ;
  928.  
  929.     Remarks 
  930.  
  931.          Retrieve  the color  status of  the bottom  right part  of the  border
  932.          around the edit box
  933.  
  934.     Return
  935.  
  936.          Return an integer. See setColor.
  937.  
  938.  
  939.     +----------+
  940.     | setInput |
  941.     +----------+
  942.  
  943.          Change input mode
  944.  
  945.     Declaration
  946.  
  947.          void setInput(unsigned int inp) ;
  948.  
  949.  
  950.     Remarks
  951.  
  952.          Set the origin of the input
  953.  
  954.          Arguments   |    What argument is/does
  955.          ------------+-----------------------------------------------------
  956.          inp         |    Inputmode
  957.  
  958.          inp can be:
  959.  
  960.          #define INPUT_NONE     0
  961.          #define INPUT_KEYBOARD 1
  962.          *#define INPUT_COM1     2
  963.          *#define INPUT_COM2     4
  964.          *#define INPUT_COM3     8
  965.          *#define INPUT_COM4     16
  966.          #define INPUT_PEXUSER  32
  967.          #define INPUT_FILE     64
  968.  
  969.          * Not implemented yet!!
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.     Brainbox systems EDIT object kit                                    Page 22
  978.  
  979.     +------+
  980.     | poll |
  981.     +------+
  982.  
  983.          Poll for a key
  984.  
  985.     Declaration
  986.  
  987.          int  poll(void) ;
  988.  
  989.  
  990.     Remarks
  991.  
  992.          Polls the inputmode (see setInput) for a key
  993.  
  994.     Return
  995.  
  996.          a NULL if no key was found
  997.          a  integer  representing the  key found.  If  the lower  part  of this
  998.          integer is zero, the key was an extended key.
  999.  
  1000.  
  1001.     +-----------+
  1002.     | interpKey |
  1003.     +-----------+
  1004.  
  1005.          Interpret a key
  1006.  
  1007.     Declaration
  1008.  
  1009.          void interpKey(int key) ;
  1010.  
  1011.  
  1012.     Remarks
  1013.  
  1014.          Executes key commands. When a key was found with  the poll() function,
  1015.          this function will  act accordingly. If the key couldn't be processed,
  1016.          the  function  processKey()  will  be called.  This  function  can  be
  1017.          overriden in a derived class.
  1018.          Interp() will redisplay the changed lines automatically
  1019.  
  1020.          Arguments   |    What argument is/does
  1021.          ------------+-----------------------------------------------------
  1022.          key         |    The key to interpret
  1023.  
  1024.     Example
  1025.  
  1026.          #include "edit.hpp"
  1027.  
  1028.          void main(void)
  1029.          {
  1030.              int key1 ;
  1031.              clrscr() ;
  1032.              char st[1024] ;
  1033.              strcpy(st,"This is a line of text.") ;
  1034.              Edit edit1(1,1,10,10,st) ;
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.     Brainbox systems EDIT object kit                                    Page 23
  1043.  
  1044.              edit1.redraw() ;
  1045.              key1 = NULL ;
  1046.              while (key1 != KEY_ESC )
  1047.              {
  1048.                 if ((key1 = edit1.poll()) != NULL)
  1049.                    edit1.interpKey(key1) ;
  1050.              }
  1051.          }
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.     Brainbox systems EDIT object kit                                    Page 24
  1060.  
  1061.     +------------+
  1062.     | processKey |
  1063.     +------------+
  1064.  
  1065.          Process not interpeted keys
  1066.  
  1067.     Declaration
  1068.  
  1069.          int  processKey(unsigned int) ;
  1070.  
  1071.     Remarks
  1072.  
  1073.          This function should be overriden in a derived class if you want to
  1074.          use the extended keys the editor object doesn't use.
  1075.  
  1076.          Arguments   |    What argument is/does
  1077.          ------------+-----------------------------------------------------
  1078.          key         |    The key to interpet
  1079.  
  1080.     Example
  1081.  
  1082.          #include "edit.hpp"
  1083.  
  1084.          class TestEdit : public Edit
  1085.          {
  1086.             public:
  1087.  
  1088.                TestEdit(int x1,  int y1, int  x2, int y2,  char *s)  : Edit(x1,
  1089.          y1,                     x2, y2, s){ ; } ;
  1090.                int processKey(unsigned int)  ;
  1091.          } ;
  1092.  
  1093.  
  1094.          int TestEdit::processKey(unsigned int key)
  1095.          {
  1096.             printf("process key %i\n",key) ;
  1097.             return 0 ;
  1098.          }
  1099.  
  1100.          void main(void)
  1101.          {
  1102.  
  1103.             int key1;
  1104.  
  1105.             clrscr() ;
  1106.             char st[1024] ;
  1107.  
  1108.             TestEdit edit1(1,1,10,10,"") ;
  1109.  
  1110.             edit1.redraw() ;
  1111.             edit.change() ;
  1112.          }
  1113.  
  1114.     Return
  1115.  
  1116.          In the edit class, processKey() returns the key
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.     Brainbox systems EDIT object kit                                    Page 25
  1125.  
  1126.     +--------+
  1127.     | change |
  1128.     +--------+
  1129.  
  1130.          Enter edit mode
  1131.  
  1132.     Declaration
  1133.  
  1134.          void change(void) ;
  1135.  
  1136.     Remarks
  1137.  
  1138.          Let the  user edit  the text  in the  editor object.  ESC will  finish
  1139.          editting.
  1140.  
  1141.  
  1142.  
  1143.     +--------+
  1144.     | redraw |
  1145.     +--------+
  1146.  
  1147.          Redraw a screen
  1148.  
  1149.     Declaration
  1150.  
  1151.          redraw(void) ;
  1152.  
  1153.     Remarks
  1154.  
  1155.          Redraws the total edit window. All lines are rewritten!
  1156.  
  1157.  
  1158.  
  1159.     +--------------+
  1160.     | redrawCursor |
  1161.     +--------------+
  1162.  
  1163.          Postion cursor
  1164.  
  1165.     Declaration
  1166.  
  1167.          void redrawCursor(void) ;
  1168.  
  1169.  
  1170.     Remarks
  1171.  
  1172.          Redraws the cursor at the current cursor position
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.     Brainbox systems EDIT object kit                                    Page 26
  1181.  
  1182.     +------------+
  1183.     | clrWindow  |
  1184.     +------------+
  1185.  
  1186.          Clear edit window
  1187.  
  1188.  
  1189.     Declaration
  1190.  
  1191.          void clrWindow(void) ;
  1192.  
  1193.  
  1194.     Remarks
  1195.  
  1196.          Clear the contents of the edit window
  1197.  
  1198.  
  1199.  
  1200.     +----------+
  1201.     | loadFile |
  1202.     +----------+
  1203.  
  1204.          Load a textfile
  1205.  
  1206.  
  1207.     Declaration
  1208.  
  1209.          int loadFile(char *fileName) ;
  1210.  
  1211.  
  1212.     Remarks
  1213.  
  1214.          Loads an ASCII file into the editor object.  Memory for this text file
  1215.          will be allocated.
  1216.  
  1217.  
  1218.          Arguments   |    What argument is/does
  1219.          ------------+-----------------------------------------------------
  1220.          fileName    |    Pointer to the name of the ASCII file
  1221.  
  1222.  
  1223.  
  1224.     Return
  1225.  
  1226.          On succes loadFile will return a zero
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.     Brainbox systems EDIT object kit                                    Page 27
  1235.  
  1236.     +----------+
  1237.     | saveFile |
  1238.     +----------+
  1239.  
  1240.          Save text
  1241.  
  1242.  
  1243.     Declaration
  1244.  
  1245.          int saveFile(char *fileName) ;
  1246.  
  1247.  
  1248.     Remarks
  1249.  
  1250.          Saves the contents of an ASCII file to a file named fileName
  1251.  
  1252.          Arguments   |    What argument is/does
  1253.          ------------+-----------------------------------------------------
  1254.          fileName    |    Pointer to the name of the ASCII file
  1255.  
  1256.  
  1257.  
  1258.     Return
  1259.  
  1260.          On succes saveFile will return a zero
  1261.  
  1262.  
  1263.  
  1264.     +-------+
  1265.     | error |
  1266.     +-------+
  1267.  
  1268.          Error status of an edit object
  1269.  
  1270.     Declaration
  1271.  
  1272.          bool error(void) ;
  1273.  
  1274.  
  1275.     Remarks
  1276.  
  1277.          Some functions can generate errors. For  example the loadFile function
  1278.          can  generate an error while allocating memory. In this case, the text
  1279.          in the editor will be destroyed.  If the error function returns  TRUE,
  1280.          the edit object can't  be used anymore. With  normal use (small  ASCII
  1281.          files), the error status always be FALSE.
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.     Brainbox systems EDIT object kit                                    Page 28
  1290.  
  1291.     Derived classes
  1292.  
  1293.     This edit  object was  written for deriving  your own  classes. I have  put
  1294.     some examples of my own usage in  this package. The first project I  needed
  1295.     an editor for was a Bulletin Board editor as PEX (Proboard EXecutable).  In
  1296.     this editor  I wanted  to use  abbreviation and  wanted  to display  quoted
  1297.     lines in another color. 
  1298.  
  1299.  
  1300.  
  1301.     AbbreviationsEdit
  1302.  
  1303.     The abbreviation object  is a simple  demonstration showing  how to  derive
  1304.     classes from  the edit  class and  to override  some memberfunctions.  With
  1305.     this class you can accomplish to type some  keys and automaticaly have them
  1306.     expanded to words or sentences.
  1307.     The words that are expanded can be read from a file  just as the wordt they
  1308.     area expanded to. The odd lines of  this file contain the words to type and
  1309.     the even  lines contain the  words they area  expanded to. The file  can be
  1310.     loaded  with  the  memberfunction  'loadAbreviation'.  The  status  of  the
  1311.     instance of this object can be set.
  1312.  
  1313.  
  1314.     +-----------------+
  1315.     | setAbbrevStatus |
  1316.     +-----------------+
  1317.  
  1318.          Sets the status   
  1319.  
  1320.     Declaration
  1321.  
  1322.          void setAbbrevStatus(bool stat) ;
  1323.  
  1324.     Remarks 
  1325.  
  1326.          You  can  switch  of  the abbreviation  mode  an  on  again with  this
  1327.          function.
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.     Brainbox systems EDIT object kit                                    Page 29
  1336.  
  1337.     +------------------+
  1338.     | loadAbbreviation |
  1339.     +------------------+
  1340.  
  1341.          Loads a list of abbreviations
  1342.  
  1343.     Declaration
  1344.  
  1345.          int loadAbbreviation(char *filename) ;
  1346.  
  1347.          Loads  a list  of abbreviation  from a  file.  This list  contains the
  1348.          words whicht have to  be replaced on the odd  lines with the words  on
  1349.          the even lines
  1350.  
  1351.     Return
  1352.  
  1353.          On succes, this functions returns a 0
  1354.  
  1355.  
  1356.     See the example.doc file for more information.
  1357.  
  1358.  
  1359.  
  1360.  
  1361.     QuoteEdit
  1362.  
  1363.  
  1364.     QuoteEdit will display quoted  lines in another color. For this purpose the
  1365.     functions 'display' and  'redraw' are overloaded.  The quote  color can  be
  1366.     set with the  function setQuoteColor(unsigned color) and  retrieved withthe
  1367.     function getQuoteColor.
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.     Brainbox systems EDIT object kit                                    Page 30
  1376.  
  1377.     GNU license
  1378.     -----------
  1379.  
  1380.  
  1381.                   GNU GENERAL PUBLIC LICENSE
  1382.                    Version 1, February 1989
  1383.  
  1384.      Copyright (C) 1989 Free Software Foundation, Inc.
  1385.                         675 Mass Ave, Cambridge, MA 02139, USA
  1386.      Everyone is permitted to copy and distribute verbatim copies
  1387.      of this license document, but changing it is not allowed.
  1388.  
  1389.                        Preamble
  1390.  
  1391.       The license agreements of most software companies try to keep users
  1392.     at the mercy of those companies.  By contrast, our General Public
  1393.     License is intended to guarantee your freedom to share and change free
  1394.     software--to make sure the software is free for all its users.  The
  1395.     General Public License applies to the Free Software Foundation's
  1396.     software and to any other program whose authors commit to using it.
  1397.     You can use it for your programs, too.
  1398.  
  1399.       When we speak of free software, we are referring to freedom, not
  1400.     price.  Specifically, the General Public License is designed to make
  1401.     sure that you have the freedom to give away or sell copies of free
  1402.     software, that you receive source code or can get it if you want it,
  1403.     that you can change the software or use pieces of it in new free
  1404.     programs; and that you know you can do these things.
  1405.  
  1406.       To protect your rights, we need to make restrictions that forbid
  1407.     anyone to deny you these rights or to ask you to surrender the rights.
  1408.     These restrictions translate to certain responsibilities for you if you
  1409.     distribute copies of the software, or if you modify it.
  1410.  
  1411.       For example, if you distribute copies of a such a program, whether
  1412.     gratis or for a fee, you must give the recipients all the rights that
  1413.     you have.  You must make sure that they, too, receive or can get the
  1414.     source code.  And you must tell them their rights.
  1415.  
  1416.       We protect your rights with two steps: (1) copyright the software, and
  1417.     (2) offer you this license which gives you legal permission to copy,
  1418.     distribute and/or modify the software.
  1419.  
  1420.       Also, for each author's protection and ours, we want to make certain
  1421.     that everyone understands that there is no warranty for this free
  1422.     software.  If the software is modified by someone else and passed on, we
  1423.     want its recipients to know that what they have is not the original, so
  1424.     that any problems introduced by others will not reflect on the original
  1425.     authors' reputations.
  1426.  
  1427.       The precise terms and conditions for copying, distribution and
  1428.     modification follow.
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.     Brainbox systems EDIT object kit                                    Page 31
  1437.  
  1438.  
  1439.                   GNU GENERAL PUBLIC LICENSE
  1440.        TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  1441.  
  1442.       0. This License Agreement applies to any program or other work which
  1443.     contains a notice placed by the copyright holder saying it may be
  1444.     distributed under the terms of this General Public License.  The
  1445.     "Program", below, refers to any such program or work, and a "work based
  1446.     on the Program" means either the Program or any work containing the
  1447.     Program or a portion of it, either verbatim or with modifications.  Each
  1448.     licensee is addressed as "you".
  1449.  
  1450.       1. You may copy and distribute verbatim copies of the Program's source
  1451.     code as you receive it, in any medium, provided that you conspicuously and
  1452.     appropriately publish on each copy an appropriate copyright notice and
  1453.     disclaimer of warranty; keep intact all the notices that refer to this
  1454.     General Public License and to the absence of any warranty; and give any
  1455.     other recipients of the Program a copy of this General Public License
  1456.     along with the Program.  You may charge a fee for the physical act of
  1457.     transferring a copy.
  1458.  
  1459.       2. You may modify your copy or copies of the Program or any portion of
  1460.     it,  and  copy  and  distribute  such  modifications  under  the  terms  of
  1461.     Paragraph
  1462.     1 above, provided that you also do the following:
  1463.  
  1464.         a) cause the modified files to carry prominent notices stating that
  1465.         you changed the files and the date of any change; and
  1466.  
  1467.         b) cause the whole of any work that you distribute or publish, that
  1468.         in whole or in part contains the Program or any part thereof, either
  1469.         with or without modifications, to be licensed at no charge to all
  1470.         third parties under the terms of this General Public License (except
  1471.         that you may choose to grant warranty protection to some or all
  1472.         third parties, at your option).
  1473.  
  1474.         c) If the modified program normally reads commands interactively when
  1475.         run, you must cause it, when started running for such interactive use
  1476.         in the simplest and most usual way, to print or display an
  1477.         announcement including an appropriate copyright notice and a notice
  1478.         that there is no warranty (or else, saying that you provide a
  1479.         warranty) and that users may redistribute the program under these
  1480.         conditions, and telling the user how to view a copy of this General
  1481.         Public License.
  1482.  
  1483.         d) You may charge a fee for the physical act of transferring a
  1484.         copy, and you may at your option offer warranty protection in
  1485.         exchange for a fee.
  1486.  
  1487.     Mere aggregation of another independent work with the Program (or its
  1488.     derivative) on a volume of a storage or distribution medium does not bring
  1489.     the other work under the scope of these terms.
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.     Brainbox systems EDIT object kit                                    Page 32
  1498.  
  1499.  
  1500.       3. You may  copy and distribute the  Program (or a portion  or derivative
  1501.     of
  1502.     it, under Paragraph  2) in object code  or executable form under  the terms
  1503.     of
  1504.     Paragraphs 1 and 2 above provided that you also do one of the following:
  1505.  
  1506.         a) accompany it with the complete corresponding machine-readable
  1507.         source code, which must be distributed under the terms of
  1508.         Paragraphs 1 and 2 above; or,
  1509.  
  1510.         b) accompany it with a written offer, valid for at least three
  1511.         years, to give any third party free (except for a nominal charge
  1512.         for the cost of distribution) a complete machine-readable copy of the
  1513.         corresponding source code, to be distributed under the terms of
  1514.         Paragraphs 1 and 2 above; or,
  1515.  
  1516.         c) accompany it with the information you received as to where the
  1517.         corresponding source code may be obtained.  (This alternative is
  1518.         allowed only for noncommercial distribution and only if you
  1519.         received the program in object code or executable form alone.)
  1520.  
  1521.     Source code for a work means the preferred form of the work for making
  1522.     modifications to it.  For an executable file, complete source code means
  1523.     all the source code for all modules it contains; but, as a special
  1524.     exception, it need not include source code for modules which are standard
  1525.     libraries that accompany the operating system on which the executable
  1526.     file runs, or for standard header files or definitions files that
  1527.     accompany that operating system.
  1528.  
  1529.       4. You may not copy, modify, sublicense, distribute or transfer the
  1530.     Program except as expressly provided under this General Public License.
  1531.     Any attempt otherwise to copy, modify, sublicense, distribute or transfer
  1532.     the Program is void, and will automatically terminate your rights to use
  1533.     the Program under this License.  However, parties who have received
  1534.     copies, or rights to use copies, from you under this General Public
  1535.     License will not have their licenses terminated so long as such parties
  1536.     remain in full compliance.
  1537.  
  1538.       5. By copying, distributing or modifying the Program (or any work based
  1539.     on the Program) you indicate your acceptance of this license to do so,
  1540.     and all its terms and conditions.
  1541.  
  1542.       6. Each time you redistribute the Program (or any work based on the
  1543.     Program), the recipient automatically receives a license from the original
  1544.     licensor to copy, distribute or modify the Program subject to these
  1545.     terms and conditions.  You may not impose any further restrictions on the
  1546.     recipients' exercise of the rights granted herein.
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.     Brainbox systems EDIT object kit                                    Page 33
  1555.  
  1556.  
  1557.       7. The Free Software Foundation may publish revised and/or new versions
  1558.     of the General Public License from time to time.  Such new versions will
  1559.     be similar in spirit to the present version, but may differ in detail to
  1560.     address new problems or concerns.
  1561.  
  1562.     Each version is given a distinguishing version number.  If the Program
  1563.     specifies a version number of the license which applies to it and "any
  1564.     later version", you have the option of following the terms and conditions
  1565.     either of that version or of any later version published by the Free
  1566.     Software Foundation.  If the Program does not specify a version number of
  1567.     the license,  you  may  choose  any version  ever  published  by  the  Free
  1568.     Software
  1569.     Foundation.
  1570.  
  1571.       8. If you wish to incorporate parts of the Program into other free
  1572.     programs whose distribution conditions are different, write to the author
  1573.     to ask for permission.  For software which is copyrighted by the Free
  1574.     Software Foundation, write to the Free Software Foundation; we sometimes
  1575.     make exceptions for this.  Our decision will be guided by the two goals
  1576.     of preserving the free status of all derivatives of our free software and
  1577.     of promoting the sharing and reuse of software generally.
  1578.  
  1579.                        NO WARRANTY
  1580.  
  1581.       9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  1582.     FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  1583.     OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  1584.     PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  1585.     OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  1586.     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
  1587.     TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  1588.     PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  1589.     REPAIR OR CORRECTION.
  1590.  
  1591.       10.  IN NO  EVENT  UNLESS REQUIRED  BY  APPLICABLE LAW  OR  AGREED TO  IN
  1592.     WRITING
  1593.     WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  1594.     REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  1595.     INCLUDING  ANY  GENERAL,  SPECIAL,  INCIDENTAL  OR  CONSEQUENTIAL   DAMAGES
  1596.     ARISING
  1597.     OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
  1598.     TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  1599.     YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  1600.     PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  1601.     POSSIBILITY OF SUCH DAMAGES.
  1602.  
  1603.                    END OF TERMS AND CONDITIONS
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.     Brainbox systems EDIT object kit                                    Page 34
  1612.  
  1613.  
  1614.          Appendix: How to Apply These Terms to Your New Programs
  1615.  
  1616.       If you develop a new program, and you want it to be of the greatest
  1617.     possible use to humanity, the best way to achieve this is to make it
  1618.     free software which everyone can redistribute and change under these
  1619.     terms.
  1620.  
  1621.       To do so, attach the following notices to the program.  It is safest to
  1622.     attach them to the start of each source file to most effectively convey
  1623.     the exclusion of warranty; and each file should have at least the
  1624.     "copyright" line and a pointer to where the full notice is found.
  1625.  
  1626.         <one  line to  give the  program's name  and  a brief  idea of  what it
  1627.     does.>
  1628.         Copyright (C) 19yy  <name of author>
  1629.  
  1630.         This program is free software; you can redistribute it and/or modify
  1631.         it under the terms of the GNU General Public License as published by
  1632.         the Free Software Foundation; either version 1, or (at your option)
  1633.         any later version.
  1634.  
  1635.         This program is distributed in the hope that it will be useful,
  1636.         but WITHOUT ANY WARRANTY; without even the implied warranty of
  1637.         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1638.         GNU General Public License for more details.
  1639.  
  1640.         You should have received a copy of the GNU General Public License
  1641.         along with this program; if not, write to the Free Software
  1642.         Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1643.  
  1644.     Also add information on how to contact you by electronic and paper mail.
  1645.  
  1646.     If the program is interactive, make it output a short notice like this
  1647.     when it starts in an interactive mode:
  1648.  
  1649.         Gnomovision version 69, Copyright (C) 19xx name of author
  1650.         Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show
  1651.     w'.
  1652.         This is free software, and you are welcome to redistribute it
  1653.         under certain conditions; type `show c' for details.
  1654.  
  1655.     The hypothetical commands `show w' and `show c' should show the
  1656.     appropriate parts of the General Public License.  Of course, the
  1657.     commands you use may be called something other than `show w' and `show
  1658.     c'; they could even be mouse-clicks or menu items--whatever suits your
  1659.     program.
  1660.  
  1661.     You should also get your employer (if you work as a programmer) or your
  1662.     school, if any, to sign a "copyright disclaimer" for the program, if
  1663.     necessary.  Here a sample; alter the names:
  1664.  
  1665.       Yoyodyne, Inc., hereby disclaims all copyright interest in the
  1666.       program `Gnomovision' (a program to direct compilers to make passes
  1667.       at assemblers) written by James Hacker.
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.     Brainbox systems EDIT object kit                                    Page 35
  1676.  
  1677.  
  1678.  
  1679.     // End of document
  1680.