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 

Status bar %sb
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
LitusSaxonicum



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

PostPosted: Thu Apr 25, 2019 2:34 pm    Post subject: Status bar %sb Reply with quote

The help file states somewhat confusingly:

Quote:
Modifiers
Tilde (~) - indicates that the first panel of the status bar is to be used for help strings.

Description
N is optional. When N > 1, it specifies the number of panels and iar is an integer array specifying the width (in average characters) of each panel in turn. The width of the last panel is set automatically to extend to the right hand edge of the window. When N is not provided, iar is also omitted, resulting in just one panel. A grave accent can be applied and indicates that the first panel of the status bar is to be used for help strings.


Not that it matters, because the truth can be established by some simple trials.

My question is: Is there a way of determining at runtime how many characters are (roughly) available in a status bar ?

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


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

PostPosted: Thu Apr 25, 2019 3:13 pm    Post subject: Reply with quote

Eddie

I have corrected the help file but this is probably not in time for the next release.

ClearWin+ does not currently provide a simple way to get the current size of a given panel in the status bar.

The information is available via a call to SendMessage by using the HWND of the status bar and SB_GETRECT. If you want to try this then the first step would be to test to see if %lc works for %sb.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



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

PostPosted: Thu Apr 25, 2019 4:16 pm    Post subject: Reply with quote

Paul,

Thanks. SET_STATUS_TEXT@ doesn't appear to be in the Library Reference either.

When is the next version due?

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


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

PostPosted: Thu Apr 25, 2019 6:28 pm    Post subject: Reply with quote

We are working on it right now.
Back to top
View user's profile Send private message AIM Address
John-Silver



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

PostPosted: Thu Apr 25, 2019 9:27 pm    Post subject: Reply with quote

looks like it'll be May to me
_________________
''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
John-Silver



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

PostPosted: Thu Apr 25, 2019 10:17 pm    Post subject: Reply with quote

Paul wrote:
Quote:
ClearWin+ does not currently provide a simple way to get the current size of a given panel in the status bar


... except that for multģiple panels the user specifies their lengtth via iar !!! Smile

I guess the problem is determining the 1 panel case

There must be a WindowsAPI which can be easily called do that.

In ClearWin there's the function GET_TEXT_SIZE@ but that gives th length for a given string.

The key I guess is getting hold of the aerage character width for a given font.

Just a thought - I assume that there's a check built into %sb which flags an error oģif the total length of all panels is greaer than the overal available length ?
_________________
''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
PaulLaidler
Site Admin


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

PostPosted: Fri Apr 26, 2019 6:44 am    Post subject: Reply with quote

Quote:
I assume that there's a check built into %sb which flags an error...


No check is carried out.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



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

PostPosted: Fri Apr 26, 2019 2:49 pm    Post subject: Reply with quote

Paul,

I followed up the suggestion, and it isn't a lot of help. I came across SBARS_SIZEGRIP - that is something that puts the sizing icon in the bottom rhs of the window. Aesthetically, when the client area extends to the bottom of the window, the window looks a bit unbalanced, and even when a status bar is in use, (because everything is clustered to the left), the 'size-grip' is a nice feature, even if it is rather obsolete as all window edges are resizable these days.

I also saw that the status bar can have tooltips. My suggestion is therefore for:

%sb[sizegrip][tooltips]

I'm not much of a fan of straying outside Clearwin+, as you probably guessed.

I probably didn't express myself well in the original post. What I really want to do is find out how much capacity the status bar has before I invoke winio@('%sb so that I don't simply program invisible stuff off the end. I know this will be wrong for different logical dpi settings, so it will need to be assessed conservatively. Perhaps it's a question of running some tests and measuring using my onscreen pixel ruler: 'RulerByGeorge!'

Eddie

PS. Just about everything I write is run fullscreen, because the maximum number of pixels is required for the best graphical interaction.
Back to top
View user's profile Send private message
John-Silver



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

PostPosted: Fri Apr 26, 2019 4:10 pm    Post subject: Reply with quote

Eddie,
try GETFONTSIZE@

http://www.silverfrost.com/ftn95-help/clearwinp/library/getfontsize_.aspx

which calls the API :
https://docs.microsoft.com/en-gb/windows/desktop/api/wingdi/ns-wingdi-taglogfonta

Then use it with the pixel width of the sb/window to determine the approx. no. of characters
_________________
''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
PaulLaidler
Site Admin


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

PostPosted: Fri Apr 26, 2019 4:52 pm    Post subject: Reply with quote

Eddie

I have made a note of your request/suggestion.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



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

PostPosted: Sun Apr 28, 2019 2:19 pm    Post subject: Reply with quote

Paul,

Many thanks for considering this.

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



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

PostPosted: Mon Apr 29, 2019 1:26 pm    Post subject: Reply with quote

I've done some measurements, and with a standard dpi setting, the text typically has a length that equates to about 5.3 pixels per character.

I run a dual monitor setup, with two 1920x1080 screens side by side. When my app with a %sb is launched, the statusbar doesn't have a 'sizegrip' If I move the window to straddle the two monitors, the window extends laterally, and the status bar then shows a 'sizegrip', which then remains part of it even if the window is shrunk back to fit on one screen. Weird.

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


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

PostPosted: Wed May 01, 2019 1:24 pm    Post subject: Reply with quote

Eddie

I have had a look at this.

SBARS_SIZEGRIP does not appear to do anything useful. If the window can be resize then you get the gripper anyway. If the window can't be resized then SBARS_SIZEGRIP adds the gripper but you can't use it to resize the window.

I will see if anything can be done with tooltips.
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: Wed May 01, 2019 5:08 pm    Post subject: Reply with quote

Eddie

The SBARS_TOOLTIPS style is rather limited. Its purpose is to provide a tooltip for when the text is too long to fit into the pane. When the pane is big enough the tooltip does not appear. The tooltip is simply a copy of the text in the pane and the user sets this by calling set_status_text@.

This will probably not work with the first pane and %`sb where menu item info is controlling the content of the pane.

I have added this style but it may not be of much interest to users.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



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

PostPosted: Fri May 03, 2019 9:41 am    Post subject: Reply with quote

Hi Paul,

Thanks for looking at this.

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
Goto page 1, 2  Next
Page 1 of 2

 
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