This is a multi-part message in MIME format.
--------------060006000009040108040303
Content-Type: multipart/alternative;
boundary="------------080002040809050300060207"
--------------080002040809050300060207
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Hi all,
I have at last got round to writing a couple of little utilities for
Windows poplog that I've been promising myself for ages, namely hooks to
make ctrl c ('copy to clipboard') and ctrl v ('paste from clipboard')
work reasonably in winpop11. I'm attaching the relevant files (intended
to go in $poplocal/local/auto or some such) in case others find them
useful too. (They are really simple, because all the hard work is done
by libraries already in the winpop11 system, but not very accessibly so.)
So herewith, please find libraries to define:
* <enter> wincopy - copy current marked range to clipboard
* <enter> winpaste - paste current clipboard contents into ved buffer
The library (all of which is actually in ved_winpaste.p) also sets up
ved bindings for ctrl c and ctrl v (which are unused in winpop11).
Arguably these bindings should be set somewhere else and automatically
load the libraries on demand, but I can't work out the best structure
just now so I've left that wrinkle. So you have to load this library, or
invoke it via the <enter> version of the command, before the bindings
take effect.
enjoy
Roger
PS: before anyone asks, no I don't know how to make the standard range
selection stuff for windows work in a winpop11 window - requires lower
level hacking of the interface between pop and the windown object. So
for now, a whole marked range is the only thing you can copy.
--------------080002040809050300060207
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hi all,<br>
<br>
I have at last got round to writing a couple of little utilities for
Windows poplog that I've been promising myself for ages, namely hooks
to make ctrl c ('copy to clipboard') and ctrl v ('paste from
clipboard') work reasonably in winpop11. I'm attaching the relevant
files (intended to go in $poplocal/local/auto or some such) in case
others find them useful too. (They are really simple, because all the
hard work is done by libraries already in the winpop11 system, but not
very accessibly so.)<br>
<br>
So herewith, please find libraries to define:<br>
<ul>
<li><enter> wincopy - copy current marked range to clipboard</li>
<li><enter> winpaste - paste current clipboard contents into
ved buffer</li>
</ul>
The library (all of which is actually in ved_winpaste.p) also sets up
ved bindings for ctrl c and ctrl v (which are unused in winpop11).
Arguably these bindings should be set somewhere else and automatically
load the libraries on demand, but I can't work out the best structure
just now so I've left that wrinkle. So you have to load this library,
or invoke it via the <enter> version of the command, before the
bindings take effect.<br>
<br>
enjoy<br>
<br>
Roger<br>
<br>
PS: before anyone asks, no I don't know how to make the standard range
selection stuff for windows work in a winpop11 window - requires lower
level hacking of the interface between pop and the windown object. So
for now, a whole marked range is the only thing you can copy.<br>
</body>
</html>
--------------080002040809050300060207--
--------------060006000009040108040303
Content-Type: text/plain;
name="ved_wincopy.p"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ved_wincopy.p"
/* <enter>winpaste - paste contents of clipboard into buffer
<enter>wincopy - copy mark range to clipboard
Roger Evans November 2003
*/
;;; all defined in ved_winpaste - autoload it
ved_winpaste -> ;
--------------060006000009040108040303
Content-Type: text/plain;
name="ved_winpaste.p"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ved_winpaste.p"
/* <enter>winpaste - paste contents of clipboard into buffer
<enter>wincopy - copy mark range to clipboard
Roger Evans November 2003
*/
uses popwinlib
uses win_clipboard
define ved_winpaste;
lvars text = win_clipboard_text();
if text then vedinsertstring(text); endif;
enddefine;
define ved_wincopy;
dlocal vveddump;
ved_copy();
consstring( #| lvars s; for s in vveddump do explode(s); `\n`; endfor |#)
-> win_clipboard_text();
enddefine;
;;; ved bindings for ctrl c and ctrl v (not used in winpop11)
;;; shouldn't really be here....
vedsetkey('\^c', "ved_wincopy");
vedsetkey('\^v', "ved_winpaste");
--------------060006000009040108040303--
|