View previous topic :: View next topic |
Author |
Message |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Thu Apr 25, 2019 2:34 pm Post subject: Status bar %sb |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7931 Location: Salford, UK
|
Posted: Thu Apr 25, 2019 3:13 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Thu Apr 25, 2019 4:16 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7931 Location: Salford, UK
|
Posted: Thu Apr 25, 2019 6:28 pm Post subject: |
|
|
We are working on it right now. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
John-Silver
![](http://i.postimg.cc/K8HMTnXq/Bart-Unrivalled-Native-Plotting256.jpg)
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Thu Apr 25, 2019 9:27 pm Post subject: |
|
|
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 ... " |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
John-Silver
![](http://i.postimg.cc/K8HMTnXq/Bart-Unrivalled-Native-Plotting256.jpg)
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Thu Apr 25, 2019 10:17 pm Post subject: |
|
|
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 !!!
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 ... " |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7931 Location: Salford, UK
|
Posted: Fri Apr 26, 2019 6:44 am Post subject: |
|
|
Quote: | I assume that there's a check built into %sb which flags an error... |
No check is carried out. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Fri Apr 26, 2019 2:49 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
John-Silver
![](http://i.postimg.cc/K8HMTnXq/Bart-Unrivalled-Native-Plotting256.jpg)
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7931 Location: Salford, UK
|
Posted: Fri Apr 26, 2019 4:52 pm Post subject: |
|
|
Eddie
I have made a note of your request/suggestion. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Sun Apr 28, 2019 2:19 pm Post subject: |
|
|
Paul,
Many thanks for considering this.
Eddie |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Mon Apr 29, 2019 1:26 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7931 Location: Salford, UK
|
Posted: Wed May 01, 2019 1:24 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7931 Location: Salford, UK
|
Posted: Wed May 01, 2019 5:08 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Fri May 03, 2019 9:41 am Post subject: |
|
|
Hi Paul,
Thanks for looking at this.
Eddie |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|