Toolbar height?

I’m using Xojo 2013 R3.3 (last version to run on Snow Leo)

In the debugger the height of the Toolbar is shown as 32, however it really is 78.

Is this a bug in my version or am I misunderstanding something here?

Reason for asking: I use bounds:

NewBounds.Height = Window1.Height + Toolbar1.Height // not working

NewBounds.Height = Window1.Height + 78 // working

I just created a window in 2013R3.3 under Yosemite, and added a toolbar. It does show as 32 in the IDE.

I measured the height of elements on the screen. The toolbar is actually 77 pixels high. When there are no icons, height is 41.

However, height and bounds are accurate, I do get the height of the toolbar with
self.Bounds.Height-self.height gives 77.

There is definitely the wrong height for the toolbar in the IDE.

Thanks for checking, Michel.

Does the latest Xojo also still say 32?

Toolbar is not a regular control. Though it is a subclass of RectControl, and therefore shows all kind of properties which RectControl implements (Height, Handle, etc.), most of these properties don’t do anything or return nonsense values – at least on OS X. The docs are really insufficient in this case.

[quote=178403:@Markus Winter]Thanks for checking, Michel.

Does the latest Xojo also still say 32?[/quote]

Yes indeed, up to the last beta. But since the toolbar size is variable according to what it contains, 41 when empty and 77 when it has icons and text, whatever the size at design is irrelevant.

The same goes for Timer which is not a rectcontrol, but yet has left and top. I don’t know why these properties are exposed…

But it is not just in the IDE, it is in the debugger where it says 32 (see my iriginal post).

And that is probably a bug.

[quote=178459:@Markus Winter]But it is not just in the IDE, it is in the debugger where it says 32 (see my iriginal post).

And that is probably a bug.[/quote]

Oops. Sorry. Yes indeed, the debugger is dead wrong and it should instead give the actual height of the toolbar. Time for a bug report :wink:

Did you issue a bug report (Feedback) ?

I can’t (am currently in hospital with my iPad)

38839 - Toolbar Height property inaccurate

OS: OS X 10.10.2

Xojo: Xojo 2015r1

Steps: See forum https://forum.xojo.com/21367-toolbar-height

The Toolbar height property in the IDE and at runtime remains 32, while in fact it is 41 without icons and 77 with icons, as seen on screen and reported by the difference between self.bounds.height and self.height.

See attached project.

<https://xojo.com/issue/38839>

Oh ! Sorry.

I hope that it was for a benign reason (that you go to the hospital).

Thanks Michel.

@Emile: new hips. Will soon jump around like a young hippopotomus again :stuck_out_tongue_winking_eye:

Now that some times ellapsed, this 78 (yes, 78 pixels) pixels value recalls me something.

Oh, yes, last year or so, I got this trouble and I do not recall how I squash it. It was a quest to understand why this happened, and then I was able to tell it was because of the ToolBar.

A Conversation, one year ago, ended with:
Xojo 2013r4.1
OS X 10.8.5
Windows XP SP III

another one dates from Nov 10, 2014.

Nota: a search in this forum is not easy (in term of report): I think the report is done for all asked words, not for the addition of all search words: if I put Emile in the search string, I will get all entries with Emile, then with the first other word, the next other word, etc.
(bad english here, sorry: I hope you will understand what I meant).

This is the correct answer. Is there any reason you can’t use the window’s Bounds property? or if you’re already using the bounds property, why do you care about the toolbar’s height?

Hi,

my trouble was because I loaded a lot of images whose height (and width) were unknow.
The number of images is also unknow.

I wanted to set the window at the topmost and leftmost position in the screen.

And, at last, I started to use Bounds.

As far as I can tell, I do not have the problem anymore, and the solution I found in my code was:

a. get the image width and height and store them in a couple of local variables

b. before leaving the method, and after applying Bounds, set Window1.Width and Window1.Height sizes using the image size stored in the variables (see a).

The trouble I found was that each time I display an image, the window height was resized down by 78 pixels, and after some displayed images, my window height was negative.

Very bad for a multimedia software.

In reality, I do not care about the ToolBar Height, but in my testings, I discovered that my code (my window) without a ToolBar worked fine.

BTW: I think my application works fine under both OS X and Windows…

I am moving some controls (think like a drawer, but inside the window).

To know the required top I need to add the toolbar height to the Window.top. So it is quite annoying that ToolBar has a height property but it always contains the wrong value.