Page 1 of 2
Reaction Floating Speedbar
Posted: Sun Nov 18, 2012 5:12 pm
by tbreeden
I'm trying to create a floating toolbar by opening a window containing one gadget, a Reaction speedbar.
It appears to be vary difficult to, say, have all speedbar items displayed and also no extra space when opening the window.
This is the speed bar on AOS 4.1 upd 5 and public SDK 53.20.
Anyone have an easy solution?
The problem is that the speedbar itself seems to autosize to fit about four images (AISS 24x24) and there is no way to ask it to size to a different number, and difficult to find out how big the buttons will be until after the window is opened. For image only speedbars of current sized AISS icons, it's enough to read the image size and add some padding for spacing and bevels to get a reasonable value to call SetAttrs() for the speedbar. It becomes more involved for text only or text and image buttons.
It would be nice if there were a speedbar attribute to explicitly request a toolbar the right size for n buttons.
Also, there seems to be a probem with EvenSized buttons with text - they seem to ignore the text (size to the largest image only?)
Thanks for any info.
Tom
Re: Reaction Floating Speedbar
Posted: Sat Dec 01, 2012 4:48 pm
by chris
Does CHILD_WeightedWidth, 0 not do what you want?
There's some discussion about speedbar.gadget on amigans.net currently. The main points are that button events aren't fired off the same as the other gadgets (speedbar ought to work more like clicktab in that regard), and the user experience is unintuitive (hold shift and drag the bar left/right - wtf? Surely a left/right button at each end when required would be better - or even dragging without holding shift).
I'd like to be able to set it to display the images to the left of the text too.
Re: Reaction Floating Speedbar
Posted: Sat Dec 01, 2012 6:39 pm
by tbreeden
chris wrote:Does CHILD_WeightedWidth, 0 not do what you want?
That seems to result in a speedbar initial size to contain four image buttons.
I've had to pixel count the image sizes and add in sizing and estimated bevel width to get a explicit horizontal (or vertical) size for the speedbar gadget in order to get it to open up the exact size for other than four images.
I'd like to be able to set it to display the images to the left of the text too.
Yes. With text and small images that seems more natural for a vertical toolbar.
Tom
Re: Reaction Floating Speedbar
Posted: Mon Dec 03, 2012 1:03 pm
by salass00
@tbreeden
If you just want the speedbar to show all image buttons all the time then you can set CHILD_NominalWidth to TRUE. This is what I do in PlayCDDA for the button bar there. IIRC this method may only work with AmigaOS 4.x speedbar.gadget though.
Re: Reaction Floating Speedbar
Posted: Wed Dec 05, 2012 3:03 am
by tbreeden
salass00 wrote:@tbreeden
If you just want the speedbar to show all image buttons all the time then you can set CHILD_NominalWidth to TRUE. This is what I do in PlayCDDA for the button bar there. IIRC this method may only work with AmigaOS 4.x speedbar.gadget though.
Didn't think of trying that. Thanks, it seems to work as desired for any combination of vertical/horizontal/image/text/image+text !
Tom
Re: Reaction Floating Speedbar
Posted: Fri Dec 14, 2012 5:36 pm
by chris
tbreeden wrote:The problem is that the speedbar itself seems to autosize to fit about four images (AISS 24x24) and there is no way to ask it to size to a different number, and difficult to find out how big the buttons will be until after the window is opened. For image only speedbars of current sized AISS icons, it's enough to read the image size and add some padding for spacing and bevels to get a reasonable value to call SetAttrs() for the speedbar. It becomes more involved for text only or text and image buttons.
Can one of the OS4 devs/betatesters please confirm this and raise it as a bug? I can confirm the same happens on NetSurf, even if I only have one long-ish titled text button which easily fits in the window, the speedbar.gadget itself sizes itself to fit at least four of these across. In my case, that amount of space is actually wider than the window and even the layout groups it is in fail to constrain it. It has a cascading effect on the rest of the gadgets on the window, which now believe they can size past the window borders!
See screenshot here:
http://homepage.ntlworld.com/cdyoung/tm ... barbug.jpg
This is a pretty serious layout defect.
Re: Reaction Floating Speedbar
Posted: Fri Dec 14, 2012 7:56 pm
by kas1e
@Chris
Can one of the OS4 devs/betatesters please confirm this and raise it as a bug?
If you can make simply test code which i can just run, and point out on the error, i can check it and copy+paste to BZ.
Re: Reaction Floating Speedbar
Posted: Sat Dec 15, 2012 12:12 pm
by chris
kas1e wrote:@Chris
If you can make simply test code which i can just run, and point out on the error, i can check it and copy+paste to BZ.
Attached. Curiously the code I modified for that example has CHILD_MinWidth set, and the bug doesn't show when that tag is present. Note that if CHILD_MinWidth is set, that a different bug manifests - the button completely disappears when it should ideally resize and truncate the text.
Re: Reaction Floating Speedbar
Posted: Sat Dec 15, 2012 1:15 pm
by kas1e
@Chris
Tested your attach now, and that what i have:
1). With disabled CHILD_MinWidth, 160, (at line 406 in your test-src) i have on running:
Any resizing of the window and pressing on the button with wods "This is quite long text for a speedbar button label" do not broken layoyt. So far all seems ok for me there.
2). With enabled CHILD_MinWidth, 160, the default look of window looks like this:

- enabled.jpg (23.19 KiB) Viewed 8754 times
And if i a bit resize it, the text of the button shows:

- enabled_a_bit_resize.jpg (27.22 KiB) Viewed 8754 times
But no cascades, no overlapping of areas or so. Did that "non-showing button at all" with enabled CHILD_MinWidht, 160 is the error, and button should be shown even if not with all the text ?
As i understand you say about 2 errors: one is that non showing button which just disappear, and another one should show me some layout errors (that one cant find now)
Re: Reaction Floating Speedbar
Posted: Sat Dec 15, 2012 5:48 pm
by chris
kas1e wrote:@Chris
Tested your attach now, and that what i have:
1). With disabled CHILD_MinWidth, 160, (at line 406 in your test-src) i have on running:
The attachment disabled.jpg is no longer available
Any resizing of the window and pressing on the button with wods "This is quite long text for a speedbar button label" do not broken layoyt. So far all seems ok for me there.
That's not what I get:
When the window opens it resizes to the maximum width available. It's not terribly obvious, but the gadgets are all getting truncated at the window border. If I try to resize it, it only lets me resize it to bigger sizes (bigger than the width of my screen).
What resolution are you running in? Perhaps you need to make the button text longer for the resulting gadget to be wide enough to show the problem?
2). With enabled CHILD_MinWidth, 160, the default look of window looks like this:
The attachment enabled.jpg is no longer available
And if i a bit resize it, the text of the button shows:
The attachment enabled_a_bit_resize.jpg is no longer available
But no cascades, no overlapping of areas or so. Did that "non-showing button at all" with enabled CHILD_MinWidht, 160 is the error, and button should be shown even if not with all the text ?
Yes, at least that's what I would expect from a user interface perspective. A button bar with no visible buttons is clearly not intuitive! I'd argue the same for when there are too many buttons to fit - it's not obvious there are further buttons that aren't currently visible.