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 

Word wrap

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



Joined: 15 Mar 2007
Posts: 243
Location: Matlock, Derbyshire, UK

PostPosted: Thu Apr 14, 2016 2:51 pm    Post subject: Word wrap Reply with quote

It would be incredibly useful to have a word wrap feature, either as a basic option in a simple i=winio@ ('.....') call or as an option for %eb

As it is, I haven't found any alternative to writing text as fixed-length lines which don't necessarily fill the full width of a window - since that width is generated at run-time depending on the particular set of controls that are being used.

Example:
[/img]

It would be much neater if the block of text at the top could be output as a single string, automatically word-wrapped to the width of the window.

Maybe there's a way to do this (other than going to VS and using Visual Clearwin) but I haven't found it!
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 Apr 14, 2016 4:48 pm    Post subject: Reply with quote

You could try %re without a horizontal scroll.
Back to top
View user's profile Send private message AIM Address
silicondale



Joined: 15 Mar 2007
Posts: 243
Location: Matlock, Derbyshire, UK

PostPosted: Thu Apr 14, 2016 5:39 pm    Post subject: Reply with quote

Thanks - that certainly goes some way to what is needed. Seems to do the word wrap OK. However the width and height of the %re box seem to be fixed. This means that when the text is very short, there is a lot of blank space in the box. Also, I have set the width to a reasonable maximum, but the required width can be different for different applications.

[/img]

However, there are a limited number of options for both width and depth, so this is livable with. I don't suppose there is any way to use integer variables in place of M and N in winio@('%N.Mre[options]', buffer) is there ?

Anyway, many thanks for the workaround!
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 Apr 14, 2016 7:31 pm    Post subject: Reply with quote

In format codes, N and M can usually be replaced by * (i.e. %*.*re in this case) and the integer values are then provided in the argument list (before the associated character argument in this case).

In some contexts it is helpful to construct the format string for winio@ dynamically in the program by an internal WRITE to a character variable.
Back to top
View user's profile Send private message AIM Address
silicondale



Joined: 15 Mar 2007
Posts: 243
Location: Matlock, Derbyshire, UK

PostPosted: Fri Apr 15, 2016 11:37 am    Post subject: Reply with quote

Excellent - thanks for that, Paul. Internal write of the format string fixed it. Something I hadn't done before but now I see how it could help in a few other situations too!

I needed to set the font to FixedSys so I could calculate the correct number of lines (with Arial, the text looked better but took less space so there were a few blank lines!).
Very Happy
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 Apr 15, 2016 1:10 pm    Post subject: Reply with quote

Blimey Paul. Where does it say that in the documentation?

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Fri Apr 15, 2016 5:15 pm    Post subject: Reply with quote

It was in my head so I must have read/written it somewhere but when I came to look I could not find it either. I am wondering if a few links in the help file have got lost on the way.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



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

PostPosted: Sat Apr 16, 2016 12:25 pm    Post subject: Reply with quote

I know that there's a lot on what with the 64-bit version, keeping pace with visual studio, fixing bugs, coping with whatever Microsoft throws up in terms of changes to Windows, and all the rest of it, so I am completely understanding about priorities and all that. I also understand that printing documentation is an expensive overhead. I had a look at the costs of small runs of properly bound booklets and my goodness, aren't they expensive.

When I look at the online documentation (and by that I include web, the help file, the PDFs of old documents and the enhancements file) I know that if there is something that I know already exists, that I might have used but don't really remember the details, then if I'm prepared to put in the time and effort I can find it. Well mostly. I'm also someone who has taken the time to read the documentation in advance of having specific needs in my programs. But I'll never be able to find something that simply isn't there!

The help documentation isn't always very searchable, it is often not complete, and it definitely doesn't often list some of the deficiencies or limitations. As to the 5000 separate choices, I'm glad I'm not running that particular bit of software. But it might have been useful to point out in the documentation that the list was limited to 64K characters. Perhaps yet another file on this site or in the distribution listing known limitations and "issues" could be at least in part an answer.

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Apr 16, 2016 4:26 pm    Post subject: Reply with quote

Thanks for the feedback Eddie. Your support is much appreciated.
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: Sat Apr 23, 2016 2:04 pm    Post subject: Reply with quote

The use of asterisks is described under Win32 platform->ClearWin+->Input and output->Data output. This section relates to %wd etc.. It should say that the same principle also applies to %rd etc..

The other place to look is Win32 platform->ClearWin+->Format windows->Advanced use of format windows.
Back to top
View user's profile Send private message AIM Address
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