Silverfrost Forums

Welcome to our forums

Scroll text w/o changing?

24 Sep 2020 3:55 #26385

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

24 Sep 2020 8:04 #26386

I would start by looking at %`re and %cw. There may be other possibilities.

24 Sep 2020 8:27 #26387
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
24 Sep 2020 9:07 #26388

With vertical scroll...

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
24 Sep 2020 1:28 #26389

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?

24 Sep 2020 1:55 #26390

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.

25 Sep 2020 3:05 #26393

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.

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
25 Sep 2020 3:14 #26394

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....

25 Sep 2020 4:36 #26396

Bill,

What's wrong with %eb? That accepts one line, and moreover, you can set it as read only.

Eddie

26 Sep 2020 1:41 #26397

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

26 Sep 2020 1:53 #26398

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

26 Sep 2020 11:47 #26402

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

26 Sep 2020 2:59 #26403

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!

Please login to reply.