Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!clyde.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!bagate!cbmvax!darren From: darren@cbmvax.commodore.com (Darren Greenwald) Newsgroups: comp.sys.amiga.programmer Subject: Re: 2.0 Console.device questions Keywords: 2.0 console.device highlighting Message-ID: <18965@cbmvax.commodore.com> Date: 14 Feb 91 19:15:04 GMT References: <12286@darkstar.ucsc.edu> Reply-To: darren@cbmvax.commodore.com (Darren Greenwald) Organization: Commodore, West Chester, PA Lines: 66 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 "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