Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#9857 closed bug (invalid)

BMenufields behaving strangely

Reported by: scanty Owned by: nobody
Priority: normal Milestone: R1
Component: - General Version: R1/alpha4.1
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

I have a view with a number of statically sized BMenuFields stacked one above the previous in a column. It should appear as a column of same-sized BMenuFields as they are all the same size in width and height when created. However this does not occur. It looks as if the BMenuFields are smudged downward and increase in size despite their BRects. Here is the code I use to create them:

BRect r (8, 128, 120, 32);
	fHueField = new BMenuField(r, "_hue_menu", "Hue", fHueMenu, true);
	fHueField->SetDivider(0);
	
	r.Set(8, 156, 120, 172);
	fSaturationField = new BMenuField(r, "_sat_menu", "Saturation", fSatMenu, true);
	fSaturationField->SetDivider(0);
	
	r.Set(8, 184, 120, 312);
	fContrastField = new BMenuField(r, "_contrast_menu", "Contrast", fContrastMenu, true);
	fContrastField->SetDivider(0);
	
	r.Set(8, 212, 120, 452);
	fBrightnessField = new BMenuField(r, "_bright_menu", "Brightness", fBrightnessMenu, true);
	fBrightnessField->SetDivider(0);
	
	r.Set(8, 240, 120, 592);
	fGammaField = new BMenuField(r, "_gamma_menu", "Gamma", fGammaMenu, true);
	fGammaField->SetDivider(0);

And a screenshot follows.

Attachments (1)

menufields.png (11.2 KB ) - added by scanty 11 years ago.
MenuFields

Download all attachments as: .zip

Change History (4)

by scanty, 11 years ago

Attachment: menufields.png added

MenuFields

comment:1 by anevilyak, 11 years ago

Resolution: invalid
Status: newclosed

Your rects are completely broken.

The first one's top is greater than its bottom, while the third and fourth are > 100 pixels high.

comment:2 by jscipione, 11 years ago

The reason that this might have worked before is that in http://cgit.haiku-os.org/haiku/commit/?id=9af9f51 fixed sized BMenuFields were changed to not be resized in the constructor. This was done in the name of BeOS R5 compatibility and it makes sense that if you are using a fixed size menu field you should have direct control over the width and height of the menu field based on the frame rectangle you specify.

So you need to fix the code on your end and get the sizes and positions of the frame rectangles right.

comment:3 by scanty, 11 years ago

Yes, the code used to work fine. In any event, I have fixed my rects and buttoned up the problem. Thanks for the tips guys.

Note: See TracTickets for help on using tickets.