|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Little-Acorn
Joined: 06 Jul 2008 Posts: 111 Location: San Diego
|
Posted: Tue Nov 22, 2011 7:14 am Post subject: How to copy/paste in an edit box (%m.neb) ? |
|
|
I don't want to waste your time with something that's probably documented in the Help files for FTN95. But I haven't found it yet.
Can I get you to give me a hint where in the Help files this is? I can chase it from there.
I am using an edit box (%m.neb) to display a text buffer with a lot of text in it. I highlighted some of the text with the mouse, then hit Ctl-C to copy, then clicked in another edit box and hit Ctl-V to paste a copy of that highlighted text. But the Ctl-V gave me some old data that I had copied long ago from the Fortram program itself in Plato. Evidently the Ctl-C I had used in the Edit Box, didn't do any copying.
Are there extra commands or option etc. that I have to go through, to give my Edit Bos the ability to do this copy/pasting?
No need to detail exactly what the commands are. Can you simply point me to the section(s) of the Help files that describe how to do this?
Muchas gracias! |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7942 Location: Salford, UK
|
Posted: Tue Nov 22, 2011 8:52 am Post subject: |
|
|
First I would try attaching the standard callback COPY to an accelerator key using %ac. At a guess it would look like...
iw = winio@("%ac[Ctrl+C]&", "COPY") |
|
Back to top |
|
|
Little-Acorn
Joined: 06 Jul 2008 Posts: 111 Location: San Diego
|
Posted: Tue Nov 22, 2011 8:53 pm Post subject: Re: |
|
|
PaulLaidler wrote: | First I would try attaching the standard callback COPY to an accelerator key using %ac. At a guess it would look like...
iw = winio@("%ac[Ctrl+C]&", "COPY") |
Thank you, Paul, this works!
I did run into a slightly different problem. The Help files have a small, simple text editor that I typed in, and then added accelerator keys for CUT, COPY, and PASTE, and put the whole thing into a subroutine.
CUT and COPY work fine. But when I CUT and then try to PASTE, I get a run-time error message saying I have exceeded the buffer.
My guess is that the buffer is always kept full-length. I initially declared it to be 32,000 characters. Then I put a few hundred characters into it. I'd imagine the system then padded those characrters with some 30,000 blanks on the right.
When I CUT, it shifts any characters past the highlighted section, to the left to overwrite the highlighted section... and then I'd guess it pads on the far right end of the buffer with blanks to keep the buffer full length. And then when I PASTE, it tries to lengthen the buffer, running into the buffer-size limit. Or so I'm guessing.
Am I missing something in the correct way to use the PASTE command?
Code: |
WINAPP
CHARACTER*32000 Textstg
Textstg="This is the string I want to try out in the text editor."
1 //" I hope it comes out OK, but you never know when you try "
2 //"something for the first time."//CHAR(10)//CHAR(10)
3 //"This is hopefully a new line. I wonder if I can cut/paste"
4 //" it to a different place."
CALL EDWINDOW(Textstg)
STOP
END
SUBROUTINE EDWINDOW(edstg)
CHARACTER*(*) edstg
INTEGER i,winio@
CHARACTER*250 file,new_file,help_file
istgsize=LEN(edstg)
help_file='myhelp.hlp'
i=winio@('%mn[&File[&Open]]&','EDIT_FILE_OPEN','*.*',file)
i=winio@('%mn[[&Save]]&','EDIT_FILE_SAVE','*.*',new_file)
i=winio@('%mn[[Save &As]]&','EDIT_FILE_SAVE_AS','*.*',new_file)
i=winio@('%mn[[E&xit]]&','EXIT')
i=winio@('%mn[&Edit[Cu&t]]&','CUT')
i=winio@('%mn[[&Paste]]&','PASTE')
i=winio@('%mn[&Help[&Contents]]&','HELP_CONTENTS',help_file)
i=winio@('%mn[[&Help on help]]&','HELP_ON_HELP',help_file)
i=winio@('%ac[Ctrl+X]&','CUT')
i=winio@('%ac[Ctrl+C]&','COPY')
i=winio@('%ac[Ctrl+V]&','PASTE')
i=winio@('%80.40eb',edstg,istgsize)
END
|
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7942 Location: Salford, UK
|
Posted: Wed Nov 23, 2011 12:32 pm Post subject: |
|
|
Yes there does appear to be a problem here.
If you can work with a buffer size of zero then it seems to work OK.
You will not be able to set the initial text as the library will provide the buffer. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|