[comp.sys.amiga.programmer] 2.0 Console.device questions

davids@ucscf.UCSC.EDU (Dave Schreiber) (02/09/91)

I'm writing a program that does text manipulations and want to have the
ability to highlight blocks of text for copying, deletion, etc.  It will
run under 2.0 (I'm using SAS C 5.10 on a 3000).  Since the console.device
now can highlight text for its own purposes, I want to ask:
 1) Can my program use this highlighting to its own ends (e.g. the console
    hightlights a block of text for the user, but when the user presses
    BACKSPACE, the program takes over and deletes the block of text)?  I'd
    really like to not have to reinvent the wheel here.
 2) If not, what am I suppossed to do about separating my own program's 
    highlighting from the console.device's highlighting?  I realize that I
    could simply not turn console.device highlighting on, but I'd like to
    let the user use as many 2.0 features as possible.  I'd find it hard
    to believe that the designers would essentially make 'Snap' part of
    the system, but not let it be used with a program if that program wants
    to do highlighting of its own.
BTW, I don't qualify to be an official developer of any sort, so ordering
Autodocs, etc. from Commodore is out of the question (unless they've made
the 2.0 Autodocs available to the general public...).  If the AmigaDOS
Tech notes have information on stuff like this, could someone please
re-post (or mail me) the e-mail address for getting on the mailing list
(actually, even if they don't, can someone please send me the address 
anyway :-) ).

Thanks.

-- 
Dave Schreiber                                    davids@slugmail.ucsc.edu 
                                or (but not both) davids@ucscf.ucsc.edu
"It was fun learning about logic, but I don't see where or when I will ever
use it again."

davids@ucscf.UCSC.EDU (Dave Schreiber) (02/14/91)

[Insert humerous line-eater fodder he

I posted a question about this last Friday, but nobody responsed (perhaps
everyone hits `c' when they first log in on Monday morning), so here it
is again:

I'm working on a text-manipulation program that will run under 2.0 (I've
got a 3000 and SAS/C V5.10).  I'd like to impliment drag-highlighting (where
the user ``drags'' the mouse to highlight a block of text, as opposed to the
Notepad way of doing it (double clicking)).  I've noticed that the 2.0 
console.device already uses drag-highlighting as part of its built-in
``Snap''ness.  I'd like to know if it is possible for my program to use this
built-in highlighting (for example, letting the console.device do the
highlighting, but having the program handle deletions of text, etc. itself). 

If it isn't, are there any recommendations on keeping console.device
highlighting and program highlighting separate (I'd like to let my users
use every 2.0 feature possible, which includes the built in Snap)?  Or should
I just resort to the double-clicking method, reserving the ``dragging'' for
when the user wants to paste some bit of text into some other window?

Thanks.

-- 
Dave Schreiber                                    davids@slugmail.ucsc.edu 
                                or (but not both) davids@ucscf.ucsc.edu
"It was fun learning about logic, but I don't see where or when I will ever
use it again."

darren@cbmvax.commodore.com (Darren Greenwald) (02/15/91)

In article <12286@darkstar.ucsc.edu> davids@ucscf.UCSC.EDU (Dave Schreiber) writes:
>
>
>I'm working on a text-manipulation program that will run under 2.0 (I've
>got a 3000 and SAS/C V5.10).  I'd like to impliment drag-highlighting (where
>the user ``drags'' the mouse to highlight a block of text, as opposed to the
>Notepad way of doing it (double clicking)).  I've noticed that the 2.0 
>console.device already uses drag-highlighting as part of its built-in
>``Snap''ness.  I'd like to know if it is possible for my program to use this
>built-in highlighting (for example, letting the console.device do the
>highlighting, but having the program handle deletions of text, etc. itself). 
>
Yes, you can let the console.device do the highlighting for you.  You'll
need to open the console.device using a unit number of three (3).  Beaware
that the console.device built-in highlighting can only highlight whats visible
in the window.  This may be inadequate for your needs.

If you do decide to let the console.device handle the highlighting, be prepared
to handle reading the clipboard.device, and inserting the contents of the
clipboard when the user presses RIGHT AMIGA V.

I've described much of this in the OpenDevice() documentation of the 
clipboard.device (though you may not have recent preliminary V36/V37 autodocs).

When you see a "<CSI>0 v" in your console.device read stream, this means
that the user pressed RIGHT AMIGA V, and wants to paste text from the
clipboard.device.  We handle copying the highlighted text from the
console.device to the clipboard.device for you (by way of a program called
CONCLIP in the standard WB 2.0 startup-sequence; like IPREFS it runs as
a demon in the background).

Its also possible to open CON:, and use DOS calls to R/W from it, in which
case you not only get copy for free, but CON: will read the contents
of the clipboard for you, and give it to you on subsequent Read()'s.


>If it isn't, are there any recommendations on keeping console.device
>highlighting and program highlighting separate (I'd like to let my users
>use every 2.0 feature possible, which includes the built in Snap)?  Or should
>I just resort to the double-clicking method, reserving the ``dragging'' for
>when the user wants to paste some bit of text into some other window?
>

There is nothing wrong with implementing your own highlighting, and
not using the console.device at all.  You'll need to decide if console's
highlighting is too limited for you.  I dont advise using a console.device
window, and using graphics calls to highlight the text.

P.S. - if you decide to open console.device unit #3, you'll need a simple
refresh window, and need to get intuition type messages from console.device
by telling console.device that you want to hear about gadgets, windows, etc.
via RAWINPUT EVENTS.


>Dave Schreiber                                    davids@slugmail.ucsc.edu 
>                                or (but not both) davids@ucscf.ucsc.edu
>"It was fun learning about logic, but I don't see where or when I will ever
>use it again."


--------------------------------------------------------------
Darren M. Greenwald | Commodore-Amiga Software Engineering   
                    | USENET: uunet!cbmvax!darren                       
--------------------------------------------------------------
Quote: "It would be impossible to discuss the subject without
        a common frame of reference." - Spock

torkell@ifi.uio.no (Torkel Lodberg) (02/15/91)

I asked the same question myself some time ago, but didn't get a single
answer (even though many people probably COULD answer it...)
 
This is what I have found out: Opening console.device with a unit
number of THREE (3) turns on the inbuilt OS 2.0 snapping.
 
To make this work, you must set the window SIMPLE_REFRESH flag.
Unfortunately you must ALSO turn off the MOUSEBUTTONS flag for
the window (don't really understand why, snapping isn't turn
on by clicking in a window but by *dragging* ...)
 
(I have just included this feature into NComm, but unfortunately
snapping can not be used when my 'ANSI mouse' feature is turned on,
since it needs the MOUSEBUTTONS flag :-( Really irritating...)

T.Lodberg

dick@woodwrk.LoneStar.ORG (Richard H. Wood) (02/15/91)

In article <18965@cbmvax.commodore.com>, Darren Greenwald writes:

> 
> When you see a "<CSI>0 v" in your console.device read stream, this means
> that the user pressed RIGHT AMIGA V, and wants to paste text from the
> clipboard.device.  We handle copying the highlighted text from the
> console.device to the clipboard.device for you (by way of a program called
> CONCLIP in the standard WB 2.0 startup-sequence; like IPREFS it runs as
> a demon in the background).
> 

Is CONCLIP not quite ready for release, or should it have been
included in the last mailing from CATS to Amiga 2000 developers?
(around Christmastime) That was WB V36.102/KS V36.303 - Is it on BIX? 

-d

> 
> --------------------------------------------------------------
> Darren M. Greenwald | Commodore-Amiga Software Engineering   
>                     | USENET: uunet!cbmvax!darren                       
> --------------------------------------------------------------
Richard H. Wood           Become an                      +1 214 530 2595
246 Bancroft Drive          Organ            //  uunet!digi!woodwrk!dick
Garland, Texas 75040        Donor         \\// dick@woodwrk.LoneStar.org

darren@cbmvax.commodore.com (Darren Greenwald) (02/22/91)

In article <18af4a2d.ARN1787@woodwrk.LoneStar.ORG> dick@woodwrk.LoneStar.ORG writes:
>In article <18965@cbmvax.commodore.com>, Darren Greenwald writes:
>
>> 
>> When you see a "<CSI>0 v" in your console.device read stream, this means
>> that the user pressed RIGHT AMIGA V, and wants to paste text from the
>> 
>
>Is CONCLIP not quite ready for release, or should it have been
>included in the last mailing from CATS to Amiga 2000 developers?
>(around Christmastime) That was WB V36.102/KS V36.303 - Is it on BIX? 
>
>> --------------------------------------------------------------
>Richard H. Wood           Become an                      +1 214 530 2595

Hmm, I don't remember off hand if it went out with 36.102; we've been
using it for awhile, so its ready enough.  You'd have to ask CATS
about getting more recent WB/Extras disks.