forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Scroll text w/o changing?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Thu Sep 24, 2020 4:55 am    Post subject: Scroll text w/o changing? Reply with quote

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
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Sep 24, 2020 9:04 am    Post subject: Reply with quote

I would start by looking at %`re and %cw. There may be other possibilities.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Sep 24, 2020 9:27 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Sep 24, 2020 10:07 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Thu Sep 24, 2020 2:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Sep 24, 2020 2:55 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Fri Sep 25, 2020 4:05 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Fri Sep 25, 2020 4:14 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Fri Sep 25, 2020 5:36 pm    Post subject: Reply with quote

Bill,

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

Eddie
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Sat Sep 26, 2020 2:41 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Sat Sep 26, 2020 2:53 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Sat Sep 26, 2020 12:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Sat Sep 26, 2020 3:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Mon Sep 28, 2020 9:12 pm    Post subject: Reply with quote

... 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 ... Smile "
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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