[comp.sys.mac.programmer] Capps' Editor Construction Kit

STORKEL@RICE.BITNET (Scott Storkel) (04/24/88)

Has anyone used the CAPPS' Editor Construction Kit from Think? Exactly what
kind of routines does this package include, and how useful are they? Don't
suppose anyone has tried to use these libraries with another compiler, such
as MPW, have they? Any comments would be appreciated.

Thanks
Scott Storkel
Macintosh Software Development
ICSA
Rice University
Houston, TX

oster@dewey.soe.berkeley.edu (David Phillip Oster) (04/24/88)

In article <332STORKEL@RICE> STORKEL@RICE.BITNET (Scott Storkel) writes:
>Has anyone used the CAPPS' Editor Construction Kit from Think? Exactly what
>kind of routines does this package include, and how useful are they?

I found their advertising accurate, but I was mislead by it. You get:
1.) a library (in two forms) that is somewhat similar to TextEdit but
doesn't have word wrap. It does have tabs, and supports text records that
can be as big as memory.  (Getting scroll bars to work when you have >
65767 lines in the record is left as an exercise for the usr.)

2.) another library that implements the "grep" style searching used in
LightSpeed C.

3.) another library that implements the tree-walking file searching that
Lightspeed C does when it is trying to find where in the folder hierarchy
you put that incluse file.

4.) source code for a simple editor using the libraries.  The source code
has some nifty stuff in it, like a routine to bold face the name of any
system call that occurs in the text.  It is a really good example of how
to program the mac. The editor implements undo, so you get to see how to
do that.  I learned a lot from it.

5.) you also get source for:
5.a) a trivial editor, just ot get you up and running on the package
5.b) a desk accesssory version.

Now here is the point I missed: 

You do not get source code for the libraries.

There are hooks into the text editor to boldface, italicize or strike out
arbitrary blocks of text, to have things like the LSPascal breakpoint stop
signs scroll as the text scrolls, and LightSpeed C style tabs are
supported, but:

no wordwrap (though you could certainly use the hooks to auto-insert 
carriage returns. (I'm not certain if you could create a "soft carriage
return character" like wordstar used to use.))
All lines must be same height (you'd be better off not buying this if you
want to learn how to write a real word processor.)

If you are the kind of person who tends to hang a programming language on
the side of his programs (I know I am), then this package lets you add a
really nice editor for those files very simply.  They ask no monetary
royalties, only that you give them credit, in the same font you use, among
the copyright messages.

Although I was disappointed that I didn't get the library source, I'm
still happy I bought it. It's come in handy more than once.

alibaba@ucscb.UCSC.EDU (Alexander M. Rosenberg) (04/25/88)

In article <23729@ucbvax.BERKELEY.EDU> oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) writes:
>can be as big as memory.  (Getting scroll bars to work when you have >
>65767 lines in the record is left as an exercise for the usr.)

Ok, here's my problem:

I am rewriting the standard scroll bar CDEF to have a proportonal elevator,
like the ][gs and GEM. It relys on the following calculation:

variable := (sBarBot.Y - SBarTop.Y) / ABS(sBarMax - SBarMin);

(Ok, so I can't recall the exact value names, but you get the point.)

This ratio defines the page height (also the elevator height) relative to the
scroll bar. (It doesn't deal with the arrows, but that is trivial.)

What if some program screws with me, and does strange things with the max?
Any ideas on how to deal with this? Also, any ideas on what exactly changed
since Andy Hertzfeld's original Suppliment distribution code from 2/85?
(I had to garb this stuff off old Workshop format disks!)

-------------------------------------------------------------------------------
-  Alexander M. Rosenberg  - INTERNET: alibaba@ucscb.ucsc.edu   - Yoyodyne    -
-  Crown College, UCSC     - UUCP:...!ucbvax!ucscc!ucscb!alibaba- Propulsion  -
-  Santa Cruz, CA 95064    - BITNET:alibaba%ucscb@ucscc.BITNET  - Systems     -
-  (408) 426-8869          - Disclaimer: Nobody is my employer  - :-)         -
-                          - so nobody cares what I say.        -             -

alibaba@ucscb.UCSC.EDU (Alexander M. Rosenberg) (04/25/88)

>can be as big as memory.  (Getting scroll bars to work when you have >
>65767 lines in the record is left as an exercise for the usr.)

(Not having done an editor before):

Do you just make sure that the current value and sBarMax are proportional to
the actual values? Like setting the value to 7, and the max to 14, when they
should be 14 and 28? Do you just use SANE or longInts to keep track of it?
Or is that also a limiting factor?

-------------------------------------------------------------------------------
-  Alexander M. Rosenberg  - INTERNET: alibaba@ucscb.ucsc.edu   - Yoyodyne    -
-  Crown College, UCSC     - UUCP:...!ucbvax!ucscc!ucscb!alibaba- Propulsion  -
-  Santa Cruz, CA 95064    - BITNET:alibaba%ucscb@ucscc.BITNET  - Systems     -
-  (408) 426-8869          - Disclaimer: Nobody is my employer  - :-)         -
-                          - so nobody cares what I say.        -             -

cole@sas.UUCP (Tom Cole) (04/26/88)

Well, I got a copy of CAPPS' (LSP version).  Here ae re a few
unsolicited comments.

1.  The package is largely a replacement for TE routines.  There
    are PE routines for the typical TE operations, from PEKey to
    PECut, etc.  The first and foremost advantages of this is that
    CAPPS' is *fast* compared to TE, and supports tab characters.
    I had an application where I wanted to use TE to manage an
    output window and gave it up because TE was just too slow.
    CAPPS' is fast enough to send it characters in real time and
    it works very niceley.  And implementing your own tabs in TE
    is a real pain.

2.  The editor allows you to imbed escape characters (ascii value 
    less than 32) in the text, and declare a corresponding routine
    to be called that can process the text next to the escape or
    bracketed by the escape.  That's how LSP bolds keywords.  I
    have yet to fully explore this capability.

3.  They provide a (reasonably) fully commented text editor and text
    edit desk accessory that uses CAPPS' to do its work.  Good examples
    of shell applications, by the way.  These also give examples of how
    to use the escape character feature, etc.

4.  Also part of the package is a "grep" routine.  In its simplest
    form, it can do the search/replace operations expected of any
    normal editor.  It can be case insensitive and quite fast.

    In its most oblique forms, it is a full regular expression
    handler that can search for all kinds of wierdness, basically
    like the un*x grep stuff

5.  The routines are supplied as Lightspeed C or Pascal libraries, and
    interface files.  So I doubt you could run them with other languages
    or environments without being able to read and translate Lightspeed
    libraries.  The source for the actual PE routines, grepper, etc.
    are *not* included, only the source to the sample application and
    DA that use CAPPS'

6.  The package also includes some HFS navigation commands and file/path
    expansion routines which I haven't played with.

7.  The documentation is pretty good, mostly convincing me that in normal
    use the routines just "plug-replace" the corresponding TE routines.
    The docs come as laser-typeset looseleaf pages punched for three-
    ring binders - supply your own binder...

8.  I bought the stuff because it was fast,  and I could make it do
    text window handling without writing ugly stuff.  Someday, when I
    am less busy I would like to get into the grittier stuff.  However,
    it is soooo cheap that it was well worth it just for the speedup.
    Since it can be had from places like MacConnection for about $50,
    that makes it worth about 2 hours of your time if you get paid
    $25/hour.  If you get $100/hour, even better... :-).

Anyway, not the most complete review ever made, but a start.  I really like
the package.  It seems typical of what I consider the high quality of work
that Think.... er.... Symantec puts out.  It isn't for everyone, but if it
is for you, then it's really good.

I have (naturally) no connection with Symantec/Think or MacConnection, other
than being satisfied customers of both organizations.  Keep up the good
work.  I would love to hear from anyone who has really gotten into CAPPS'
and can send me (or post) more complete comments.

Tom Cole
SAS Institute
{nearly_anywhere}|mcnc|rti|sas|cole

My opinions ARE those of my employer, they just don't know it yet...

jmunkki@santra.UUCP (Juri Munkki) (04/27/88)

In article <332STORKEL@RICE> STORKEL@RICE.BITNET (Scott Storkel) writes:
>Has anyone used the CAPPS' Editor Construction Kit from Think? Exactly what
>kind of routines does this package include, and how useful are they? Don't
>suppose anyone has tried to use these libraries with another compiler, such
>as MPW, have they? Any comments would be appreciated.

The interface is almost identical to the TextEdit interface. It does not do
autowrapping text, but it is very memory efficient and fast. The editor does
not support text of multiple sizes or fonts, but it does allow imbedding
styled text. If you edit a small amount of text, use TextEdit, but if you're
planning on a real text editor for files larger than 8K, try CAPPS.

The GREP utility was the main reason I wanted Capps, but the editor stuff is
very good too.  I haven't used it yet, but I plan to. The sample editors are
worth the price of the whole package. Real GREP is powerful! (Of course the
Lighgtspeed C editor already has GREP)

The routines will NOT work with MPW.

Juri Munkki
jmunkki@santra.hut.fi
jmunkki@fingate.bitnet