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 

User-defined %tt button widths?

 
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: Mon Mar 17, 2014 6:50 pm    Post subject: User-defined %tt button widths? Reply with quote

I have a vertical stack of buttons, currently coded with %bt which allows me to set them all the same width. However %bt makes for a bulky button and a high stack. %tt would be much neater, but I can't control the width, which seems to be set automatically depending on the text width. Is there any way to control the width of a %tt button? The only solution I can think of is to define all the text strings the same length with a '.' at the start and end of the string, such as
Code:

     .     scaling      .
     .  annotation     .
     .       exit       . 

but this looks messy and involves extra coding to centre the text on the button.
Maybe I should be using %ib instead, but then I would need to supply a bitmap resource which I really don't need for any other reason, and it would make the program a bit more complicated. Would be nice if %tt could simply take an optional width like %bt
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: Mon Mar 17, 2014 11:55 pm    Post subject: Reply with quote

You've also got %bb that can be sized and doesn't always need an icon - and it is lower height than %bt. If room is really limited, you can use a %ls list box instead of a stack of buttons.

The %tt appears to have been designed with horizontal toolbars in mind (e.g. the tt means 'textual toolbar'), in which case minimising vertical height, and having a restricted range of widths seem to be sensible design choices (originally). When using %tt in a horizontal row you also can't easily get small gaps between the buttons.

You may find that a fixed number of characters doesn't always work perfectly because the characters are not fixed width.

I agree that the differences in the sizing mechanism can be frustrating, and for this reason I abandoned vertical stacks of buttons in my own code some years ago.

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


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

PostPosted: Tue Mar 18, 2014 8:35 am    Post subject: Reply with quote

It might be worth looking at %dy as well as %bb. %dy provides vertical height adjustment between controls (i.e. buttons in this case).
Back to top
View user's profile Send private message AIM Address
silicondale



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

PostPosted: Tue Mar 18, 2014 10:12 am    Post subject: Reply with quote

Many thanks, each. I shall try these suggestions. Not so sure about the %ls to create the stack - although I'm using %ls elsewhere in the program to select different actions, it's not really appropriate here.

----
update 18/3 11:45 -- tried %bb and it's just the ticket! I have to remember that anything I can't find in the CHM file could well be in cwplus.enh -- in fact it seems there's so much there that the CHM file is long overdue for an update!
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: Tue Mar 18, 2014 3:19 pm    Post subject: Reply with quote

There are a lot of possibilities with %bb, and there is a thread on it somewhere in the forum.

In particular, there are a couple of possibilities with the treatment of the icon (if you use one) when the button is greyed out. The mechanism to grey the icon turns it into a blob if you have crafted it carefully with antialiasing, and I use the variant where the button text greys but the icon doesn't [// between icon name and text, not just one /].

I am a big fan of cwplus.enh and recommend it to all and sundry, but in the case of %bb it is of little use - the requisite information is elsewhere in the Forum!

I am a big believer in reading documentation before asking for help, and agree that FTN95.CHM could well do with some work on it - or I have to change my behaviour to ask first and look for myself second!

Eddie
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