View previous topic :: View next topic |
Author |
Message |
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Thu Sep 24, 2020 4:55 am Post subject: Scroll text w/o changing? |
|
|
I was wondering how I might have a field (control) that is non-editable, but that the user can scroll through OR copy?
This would be similar to the Properties for a file where, if you select the tab Security, the Object Name can be scrolled AND selected and the text copied.
Bill |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Thu Sep 24, 2020 9:04 am Post subject: |
|
|
I would start by looking at %`re and %cw. There may be other possibilities. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Thu Sep 24, 2020 9:27 am Post subject: |
|
|
Code: | winapp
program main
integer iw,winio@
iw = winio@("%ac[Ctrl+C]&", "COPY")
iw = winio@("%cm[Copy]&", "COPY")
iw = winio@("%30.20cw[hscroll,vscroll]&", 10)
iw = winio@("%lw",ictrl)
do i = 1,100
write(10,*) "Line ", i
end do
end |
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Thu Sep 24, 2020 10:07 am Post subject: |
|
|
With vertical scroll...
Code: | winapp
program main
use mswin
integer iw,winio@
integer(7) hwnd
iw = winio@("%ac[Ctrl+C]&", "COPY")
iw = winio@("%cm[Copy]&", "COPY")
iw = winio@("%`30.20cw[hscroll,vscroll]&", 10, hwnd)
iw = winio@("%lw",ictrl)
do i = 1,100
write(10,*) "Line ", i
end do
iw = SendMessage(hwnd, WM_VSCROLL, SB_TOP, 0)
end |
|
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Thu Sep 24, 2020 2:28 pm Post subject: |
|
|
Paul, I looked at %cw first. Yes, it would work, but it takes up a lot of room because it wants to place scroll controls (horizontal).
%re would require a grave (%`re) to prevent the user from changing it, and is thus un-selectable. I don't see any options that would allow it to be selectable and unchangeable.
I wonder what MS uses? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Thu Sep 24, 2020 2:55 pm Post subject: |
|
|
Bill
You can omit [hscroll] from my sample code for %cw. Then you don't get the horizontal scrollbar.
I can see that %re doesn't work at the moment but I think that I could tweak it to get it to do the job. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Fri Sep 25, 2020 4:05 pm Post subject: |
|
|
The following program does not quite work at the moment. The text from the file is lost and the initial "*" is restored when you copy selected text to the clipboard. This has been fixed for the next release of ClearWin+ so that this approach will provide an alternative to using %cw as above.
Code: | winapp
program main
use clrwin
integer iw
integer(7) hwnd
iw = winio@("%ac[Ctrl+C]&", "COPY")
iw = winio@("%cm[Copy]&", "COPY")
iw = winio@("%pv%`30.20re[vscrollbar]&", "*")
iw = winio@("%lc&",hwnd)
iw = winio@("%lw",ictrl)
iw = OpenEditFile@(hwnd, "re.f95")
end |
|
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Fri Sep 25, 2020 4:14 pm Post subject: |
|
|
Thanks, Paul.
%cw does not accept 1 (one) as the number of rows, so it loses some applicability for me (space in the window, many controls).
During a crash, I noted that the dialog box that is presented can be selected for any/all text, even though it is greyed. I had forgotten about this. Not being a Windows programmer, it would seem that there is an API call to "disable", but allow copying(?). Don't know the underlying control type.... |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Fri Sep 25, 2020 5:36 pm Post subject: |
|
|
Bill,
What's wrong with %eb? That accepts one line, and moreover, you can set it as read only.
Eddie |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Sat Sep 26, 2020 2:41 am Post subject: |
|
|
The ability to make it read-only is not in the main documentation! It took me a bit to find it.
Thanks, I'll try it.
Bill |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Sat Sep 26, 2020 2:53 am Post subject: |
|
|
Eddie, the %eb control is workable. It does what I wish, and looks so much like the %rs that I'll need to color it to indicate it is read-only!
Thanks,
Bill |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Sat Sep 26, 2020 12:47 pm Post subject: |
|
|
Glad to be of some assistance, and pleased that it works, I found the read-only bit in FTN95.CHM, but from the perspective of the user it's read-only: from the perspective of a programmer it's write-only! (Pedant of the year award?)
Eddie |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1891
|
Posted: Sat Sep 26, 2020 3:59 pm Post subject: |
|
|
INTENT(IN) variables can be used in output lists of WRITE statements, and INTENT(OUT) variables can be written to in READ statements, so nothing remarkable here.
Pedant of the Year? Good try, keep it up, Eddie! |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Mon Sep 28, 2020 9:12 pm Post subject: |
|
|
... shouldeth that not beeth the other way roundus Bill ? _________________ ''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... " |
|
Back to top |
|
|
|