home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / clarion / library / memoed / memoedit.doc < prev    next >
Text File  |  1992-03-21  |  10KB  |  316 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                           MemoEdit for Clarion v. 1.15
  14.  
  15.               Copyright (C) 1992, by Bobcat Systems
  16.                    All Rights Reserved
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.                   Bobcat Systems
  44.                    PO Box 1195
  45.                 Ossining, NY 10562
  46.  
  47.          Information & Technical Support: (914)-762-2374
  48.  
  49.      LICENSE AND WARRANTY
  50.      --------------------
  51.  
  52.          MemoEdit is copyrighted material, (c) Robert Pupazzoni and
  53.        Bobcat Systems.  You are granted a limited license to MemoEdit
  54.        under the following terms and conditions:
  55.  
  56.         (1)  You may modify MemoEdit and incorporate into your
  57.              applications free of charge.
  58.  
  59.         (2)  You may freely distribute unmodified versions of the
  60.              MemoEdit source code to others.
  61.  
  62.         (3)  You may not distribute modified versions of the source code
  63.              to others without the express written consent of Bobcat
  64.              Systems.
  65.  
  66.          This software is provided without warranties of any kind,
  67.        either express or implied.  In no event will Robert Pupazzoni or
  68.        Bobcat Systems be liable to you for any damages incurred by its
  69.        use.
  70.  
  71.  
  72.      INSTALLATION
  73.      ------------
  74.  
  75.        To install MemoEdit, copy the contents of the distribution disk into
  76.      your Clarion directory and ensure that it is included your PATH.
  77.  
  78.        The following files are supplied on the distribution disk:
  79.  
  80.          README      -- Latest information
  81.          MEMOEDIT.DOC -- This file
  82.  
  83.          MEMOTEST.APP -- Sample Designer application using MemoEdit
  84.          MEMOTEST.DAT -- Data file for above
  85.          MEMOTEST.K01 -- "
  86.          MEMOTEST.MEM -- "
  87.  
  88.          MESTNDRD.MDL -- Modified copy of Clarion Designer Standard model
  89.          MEMOEDIT.H01 -- MAP procedures include file
  90.          MEMOEDIT.H02 -- Global variables include file
  91.  
  92.          MEMOEDIT.CLA -- Main edit procedure for MemoEdit
  93.              ME_BLOCK.CLA -- Block operations
  94.              ME_CORE.CLA  -- Core editing functions
  95.          ME_MOVE.CLA  -- Cursor movement functions
  96.          ME_SCRN.CLA  -- Display functions
  97.          ME_UTIL.CLA  -- Utility functions
  98.  
  99.          MEMOEDIT.HLP -- Help screen for default key assignments
  100.  
  101.              INT.BIN      -- Public domain LEM to generate interrupt
  102.          ALERTED.BIN  -- Public domain LEM to check for alerted keys
  103.  
  104.      DESIGNER QUICK START
  105.      --------------------
  106.  
  107.        To use MemoEdit with Designer apps:
  108.  
  109.        1. Select MESTNDRD.MDL as the model file on Designer's base
  110.           window:
  111.  
  112.      ╔════════════════════════════════════════════════╗
  113.      ║        The CLARION Designer          ║
  114.      ║                          ║
  115.      ║  Application      :TEST.APP              ║
  116.      ║  Model File      :MESTNDRD.MDL <--------------------
  117.      ║  Help File      :                  ║
  118.      ║  Base Procedure:MAIN                  ║
  119.      ║                          ║
  120.      ╚════════════════════════════════════════════════╝
  121.  
  122.        2. For each form which allows the user to edit a memo field,
  123.           place the memo field on the form as a Display field.
  124.  
  125.        3. Define a Dummy field immediately before the memo field, and enter
  126.       the following EDIT line:
  127.  
  128.         Edit_Memo( xxx_Memo_Row[] )
  129.  
  130.       where 'xxx' is the prefix of the file containing the memo field.
  131.  
  132.        4. That's it... Just generate the code and compile!  See the
  133.           Designer demo MEMOTEST.APP, for a detailed example.
  134.  
  135.  
  136.      USING MEMOEDIT IN HAND-CODED EDITOR APPLICATIONS
  137.      ------------------------------------------------
  138.  
  139.        To use MemoEdit with hand-coded Editor apps:
  140.  
  141.        1. Edit the MAP structure to include the MemoEdit procedures:
  142.  
  143.         MAP
  144.           INCLUDE('MEMOEDIT.H01')    !>>> Include proc/func declarations
  145.           etc.
  146.  
  147.        2. Include the MemoEdit global variables after the end of the MAP
  148.       structure:
  149.  
  150.         INCLUDE('MEMOEDIT.H02')
  151.  
  152.        3. For each of your memo fields, define an array over the memo
  153.           field.  For example, if you had a file definition of:
  154.  
  155.             MyFile         FILE,PRE(FIL)
  156.             MyMemo         MEMO(3800)
  157.             RECORD         RECORD
  158.             Name             STRING(30)
  159.             Descript         STRING(50)
  160.                            . .
  161.  
  162.           And you wanted the memo to have a width of 76 characters, you
  163.           would define an array over the memo field like this:
  164.  
  165.                            GROUP,OVER(FIL:MyMemo)
  166.             Fil_Memo_Row     STRING(76),DIM(50)
  167.                            .
  168.  
  169.      USING MEMOEDIT IN HAND-CODED EDITOR APPLICATIONS, cont.
  170.      -------------------------------------------------------
  171.  
  172.        4. Do NOT place the memo as an ENTRY field on the edit form.
  173.           Instead, place a dummy field with a picture of @P*P where you
  174.           want the upper left corner of the memo to appear.
  175.  
  176.        5. Upon entry to the form containing the memo field, you need to
  177.           display the fields' initial contents.  This should be done
  178.           after the OPEN(Screen) call:
  179.  
  180.             OPEN(Screen)                           ! Open screen
  181.             R# = ROW(DummyField)                   ! Save memo display row
  182.             C# = COL(DummyField)                   ! Save memo display col
  183.             SETHUE(FOREHUE(R#,C#),BACKHUE(R#,C#))  ! Retrieve memo color
  184.             LOOP I# = 1 TO MemoDispRows            ! Loop for each display row
  185.               SHOW(R#+I#-1,C#,Fil_Memo_Row,@S76)   !   Show next memo row
  186.             .                                      ! End loop
  187.             SETHUE                                 ! Turn off color
  188.              etc.
  189.  
  190.        6. You need to load a few variables before editing the memo.  The
  191.           edit code for the dummy field should look something like this:
  192.  
  193.             CASE FIELD()
  194.               OF ?DummyField
  195.                 MED:ibRowOfs   = R# - 1             ! Set memo screen position          !
  196.                 MED:ibColOfs   = C# - 1             !
  197.                 MED:ibRows     = MemoDispRows       ! Set memo screen size
  198.                 MED:ibCols     = 76                 !
  199.                 MED:ibTextFore = FOREHUE(R#,C#)     ! Set memo text colors
  200.                 MED:ibTextBack = BACKHUE(R#,C#)     !
  201.                 Edit_Memo( Fil_Memo_Row[] )         ! Edit the memo
  202.               OF ?FIL:Zax
  203.                 etc.
  204.  
  205.        7. That's it.  It may be helpful to compile the Designer demo app
  206.           and look at the generated code for more detailed examples.
  207.  
  208.      USING ALTERNATE DESIGNER MODELS
  209.      -------------------------------
  210.  
  211.        If you use a third-party Designer Model, you'll have to make a few
  212.      modifications to include MemoEdit support.     You should start by
  213.      examining the supplied MESTNDRD.MDL, and noting all lines which contain
  214.      comments starting with '!>>>'.  Always make a backup copy of your Model
  215.      before modifying it!
  216.  
  217.        Here is the general procedure:
  218.  
  219.        1. Edit the MAP to include the necessary procedures:
  220.  
  221.           MAP
  222.             PROC(G_OPENFILES)
  223.             @RUNMAP
  224.             @MODULES
  225.             INCLUDE('MemoEdit.H01')          !>>> Include procs/funcs
  226.           .
  227.  
  228.        2. Add a line to include the necessary global variables:
  229.  
  230.           EJECT('GLOBAL MEMORY VARIABLES')
  231.      ACTION      SHORT                !0 = NO ACTION
  232.                         !1 = ADD RECORD
  233.                         !2 = CHANGE RECORD
  234.                         !3 = DELETE RECORD
  235.                         !4 = LOOKUP FIELD
  236.           @MEMORY
  237.           INCLUDE('MemoEdit.H02')   !>>> Include global variables
  238.  
  239.        3. Edit the SHOWMEMO keyword:
  240.  
  241.      *SHOWMEMO************************************************************
  242.      R# = ROW(@SCRMEMO)                 !SAVE ROW OF MEMO
  243.      C# = COL(@SCRMEMO)                 !SAVE COL OF MEMO
  244.      SETHUE(FOREHUE(R#,C#),BACKHUE(R#,C#))     !RETRIEVE COLOR OF MEMO
  245.      LOOP I# = 1 TO @MEMOROWS             !DISPLAY MEMO FIELD BY ROWS
  246.        SHOW(R#+I#-1,C#,@MEMOROW[I#],@S@MEMOCOLS) !SHOW NEXT ROW
  247.      .
  248.      SETHUE                     !TURN OFF COLOR
  249.      MED:ibRowOfs   = R# - 1             !>>> Set memo screen position
  250.      MED:ibColOfs   = C# - 1             !>>>
  251.      MED:ibRows        = @MEMOROWS             !>>> Set memo screen size
  252.      MED:ibCols        = @MEMOCOLS             !>>>
  253.      MED:ibTextFore = FOREHUE(R#,C#)         !>>> Set memo text colors
  254.      MED:ibTextBack = BACKHUE(R#,C#)         !>>>
  255.  
  256.      MEMOEDIT HELP SCREEN
  257.      --------------------
  258.  
  259.        A Clarion Help screen listing the default key assignments used in
  260.      MemoEdit is included in the file MEMOEDIT.HLP, supplied on the
  261.      distribution disk.     Use the Helper utility to copy the screen into
  262.      your application's help file.
  263.  
  264.  
  265.      MEMOEDIT FEATURES
  266.      -----------------
  267.  
  268.        DYNAMIC PARAGRAPH FORMATTING
  269.  
  270.      MemoEdit automatically wordwraps and reflows text into
  271.        paragraphs as you insert or delete characters.
  272.  
  273.  
  274.        BLOCK OPERATIONS
  275.  
  276.      MemoEdit supports Block Copy, Block Move, and Block Delete
  277.        functions.  Refer to the Help screen for key assignments.
  278.  
  279.  
  280.        'HARD' CARRIAGE RETURNS
  281.  
  282.      MemoEdit now supports 'hard' carriage returns, allowing better
  283.        control of the paragraph formatting process.  When you press the
  284.        <Enter> key, a code of hex FF will be inserted into the memo.
  285.        The paragraph reformatting functions will stop flowing text lines
  286.        together when this code is encountered.    This format code is the
  287.        same as that used by Eckenroed's MEMO3.
  288.  
  289.  
  290.        SHOW/HIDE FORMAT CODES
  291.  
  292.      Pressing <Alt-C> will toggle the display of formatting codes.
  293.        The only formatting code currently used is the 'hard' carriage
  294.        return described above.    It will display as a '╝' character.  Be
  295.        aware that displaying format codes significantly slows text
  296.        display and reformatting.
  297.  
  298.  
  299.        BETTER MEMORY USAGE
  300.  
  301.      The source code has been significantly overhauled and
  302.        modularized into more easily manageable MODULES and FUNCS/PROCS.
  303.        This eliminates the monolithic code structure in previous
  304.        versions, allowing better overlay optimization.    Note that some
  305.        overlay managers (i.e. Mitten's Overlay Manager) will insist on
  306.        splitting each PROC/FUNC in a MODULE into a seperate .CLA file.
  307.  
  308.  
  309.      QUESTIONS?
  310.      ----------
  311.  
  312.        The source for MemoEdit is fairly well commented, but if you have
  313.      any questions or suggestions feel free to E-Mail me at CIS ID
  314.      [70441,204] or phone (914)-762-2374.
  315.  
  316.