home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
clarion
/
library
/
memoed
/
memoedit.doc
< prev
next >
Wrap
Text File
|
1992-03-21
|
10KB
|
316 lines
MemoEdit for Clarion v. 1.15
Copyright (C) 1992, by Bobcat Systems
All Rights Reserved
Bobcat Systems
PO Box 1195
Ossining, NY 10562
Information & Technical Support: (914)-762-2374
LICENSE AND WARRANTY
--------------------
MemoEdit is copyrighted material, (c) Robert Pupazzoni and
Bobcat Systems. You are granted a limited license to MemoEdit
under the following terms and conditions:
(1) You may modify MemoEdit and incorporate into your
applications free of charge.
(2) You may freely distribute unmodified versions of the
MemoEdit source code to others.
(3) You may not distribute modified versions of the source code
to others without the express written consent of Bobcat
Systems.
This software is provided without warranties of any kind,
either express or implied. In no event will Robert Pupazzoni or
Bobcat Systems be liable to you for any damages incurred by its
use.
INSTALLATION
------------
To install MemoEdit, copy the contents of the distribution disk into
your Clarion directory and ensure that it is included your PATH.
The following files are supplied on the distribution disk:
README -- Latest information
MEMOEDIT.DOC -- This file
MEMOTEST.APP -- Sample Designer application using MemoEdit
MEMOTEST.DAT -- Data file for above
MEMOTEST.K01 -- "
MEMOTEST.MEM -- "
MESTNDRD.MDL -- Modified copy of Clarion Designer Standard model
MEMOEDIT.H01 -- MAP procedures include file
MEMOEDIT.H02 -- Global variables include file
MEMOEDIT.CLA -- Main edit procedure for MemoEdit
ME_BLOCK.CLA -- Block operations
ME_CORE.CLA -- Core editing functions
ME_MOVE.CLA -- Cursor movement functions
ME_SCRN.CLA -- Display functions
ME_UTIL.CLA -- Utility functions
MEMOEDIT.HLP -- Help screen for default key assignments
INT.BIN -- Public domain LEM to generate interrupt
ALERTED.BIN -- Public domain LEM to check for alerted keys
DESIGNER QUICK START
--------------------
To use MemoEdit with Designer apps:
1. Select MESTNDRD.MDL as the model file on Designer's base
window:
╔════════════════════════════════════════════════╗
║ The CLARION Designer ║
║ ║
║ Application :TEST.APP ║
║ Model File :MESTNDRD.MDL <--------------------
║ Help File : ║
║ Base Procedure:MAIN ║
║ ║
╚════════════════════════════════════════════════╝
2. For each form which allows the user to edit a memo field,
place the memo field on the form as a Display field.
3. Define a Dummy field immediately before the memo field, and enter
the following EDIT line:
Edit_Memo( xxx_Memo_Row[] )
where 'xxx' is the prefix of the file containing the memo field.
4. That's it... Just generate the code and compile! See the
Designer demo MEMOTEST.APP, for a detailed example.
USING MEMOEDIT IN HAND-CODED EDITOR APPLICATIONS
------------------------------------------------
To use MemoEdit with hand-coded Editor apps:
1. Edit the MAP structure to include the MemoEdit procedures:
MAP
INCLUDE('MEMOEDIT.H01') !>>> Include proc/func declarations
etc.
2. Include the MemoEdit global variables after the end of the MAP
structure:
INCLUDE('MEMOEDIT.H02')
3. For each of your memo fields, define an array over the memo
field. For example, if you had a file definition of:
MyFile FILE,PRE(FIL)
MyMemo MEMO(3800)
RECORD RECORD
Name STRING(30)
Descript STRING(50)
. .
And you wanted the memo to have a width of 76 characters, you
would define an array over the memo field like this:
GROUP,OVER(FIL:MyMemo)
Fil_Memo_Row STRING(76),DIM(50)
.
USING MEMOEDIT IN HAND-CODED EDITOR APPLICATIONS, cont.
-------------------------------------------------------
4. Do NOT place the memo as an ENTRY field on the edit form.
Instead, place a dummy field with a picture of @P*P where you
want the upper left corner of the memo to appear.
5. Upon entry to the form containing the memo field, you need to
display the fields' initial contents. This should be done
after the OPEN(Screen) call:
OPEN(Screen) ! Open screen
R# = ROW(DummyField) ! Save memo display row
C# = COL(DummyField) ! Save memo display col
SETHUE(FOREHUE(R#,C#),BACKHUE(R#,C#)) ! Retrieve memo color
LOOP I# = 1 TO MemoDispRows ! Loop for each display row
SHOW(R#+I#-1,C#,Fil_Memo_Row,@S76) ! Show next memo row
. ! End loop
SETHUE ! Turn off color
etc.
6. You need to load a few variables before editing the memo. The
edit code for the dummy field should look something like this:
CASE FIELD()
OF ?DummyField
MED:ibRowOfs = R# - 1 ! Set memo screen position !
MED:ibColOfs = C# - 1 !
MED:ibRows = MemoDispRows ! Set memo screen size
MED:ibCols = 76 !
MED:ibTextFore = FOREHUE(R#,C#) ! Set memo text colors
MED:ibTextBack = BACKHUE(R#,C#) !
Edit_Memo( Fil_Memo_Row[] ) ! Edit the memo
OF ?FIL:Zax
etc.
7. That's it. It may be helpful to compile the Designer demo app
and look at the generated code for more detailed examples.
USING ALTERNATE DESIGNER MODELS
-------------------------------
If you use a third-party Designer Model, you'll have to make a few
modifications to include MemoEdit support. You should start by
examining the supplied MESTNDRD.MDL, and noting all lines which contain
comments starting with '!>>>'. Always make a backup copy of your Model
before modifying it!
Here is the general procedure:
1. Edit the MAP to include the necessary procedures:
MAP
PROC(G_OPENFILES)
@RUNMAP
@MODULES
INCLUDE('MemoEdit.H01') !>>> Include procs/funcs
.
2. Add a line to include the necessary global variables:
EJECT('GLOBAL MEMORY VARIABLES')
ACTION SHORT !0 = NO ACTION
!1 = ADD RECORD
!2 = CHANGE RECORD
!3 = DELETE RECORD
!4 = LOOKUP FIELD
@MEMORY
INCLUDE('MemoEdit.H02') !>>> Include global variables
3. Edit the SHOWMEMO keyword:
*SHOWMEMO************************************************************
R# = ROW(@SCRMEMO) !SAVE ROW OF MEMO
C# = COL(@SCRMEMO) !SAVE COL OF MEMO
SETHUE(FOREHUE(R#,C#),BACKHUE(R#,C#)) !RETRIEVE COLOR OF MEMO
LOOP I# = 1 TO @MEMOROWS !DISPLAY MEMO FIELD BY ROWS
SHOW(R#+I#-1,C#,@MEMOROW[I#],@S@MEMOCOLS) !SHOW NEXT ROW
.
SETHUE !TURN OFF COLOR
MED:ibRowOfs = R# - 1 !>>> Set memo screen position
MED:ibColOfs = C# - 1 !>>>
MED:ibRows = @MEMOROWS !>>> Set memo screen size
MED:ibCols = @MEMOCOLS !>>>
MED:ibTextFore = FOREHUE(R#,C#) !>>> Set memo text colors
MED:ibTextBack = BACKHUE(R#,C#) !>>>
MEMOEDIT HELP SCREEN
--------------------
A Clarion Help screen listing the default key assignments used in
MemoEdit is included in the file MEMOEDIT.HLP, supplied on the
distribution disk. Use the Helper utility to copy the screen into
your application's help file.
MEMOEDIT FEATURES
-----------------
DYNAMIC PARAGRAPH FORMATTING
MemoEdit automatically wordwraps and reflows text into
paragraphs as you insert or delete characters.
BLOCK OPERATIONS
MemoEdit supports Block Copy, Block Move, and Block Delete
functions. Refer to the Help screen for key assignments.
'HARD' CARRIAGE RETURNS
MemoEdit now supports 'hard' carriage returns, allowing better
control of the paragraph formatting process. When you press the
<Enter> key, a code of hex FF will be inserted into the memo.
The paragraph reformatting functions will stop flowing text lines
together when this code is encountered. This format code is the
same as that used by Eckenroed's MEMO3.
SHOW/HIDE FORMAT CODES
Pressing <Alt-C> will toggle the display of formatting codes.
The only formatting code currently used is the 'hard' carriage
return described above. It will display as a '╝' character. Be
aware that displaying format codes significantly slows text
display and reformatting.
BETTER MEMORY USAGE
The source code has been significantly overhauled and
modularized into more easily manageable MODULES and FUNCS/PROCS.
This eliminates the monolithic code structure in previous
versions, allowing better overlay optimization. Note that some
overlay managers (i.e. Mitten's Overlay Manager) will insist on
splitting each PROC/FUNC in a MODULE into a seperate .CLA file.
QUESTIONS?
----------
The source for MemoEdit is fairly well commented, but if you have
any questions or suggestions feel free to E-Mail me at CIS ID
[70441,204] or phone (914)-762-2374.