[haiku-development] Re: Layout Question With Checkboxes / Window

  • From: "Adrien Destugues" <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 06 Apr 2020 11:01:03 +0000

6 avril 2020 12:57 "Andrew Lindesay" <apl@xxxxxxxxxxxxxx> a écrit:

- Use a grid layout instead, and leave an empty column to the right of
your checkboxes:

Hello Adrien;

Thank you for the guidance. I managed to get my desired outcome with a mix of 
more fiddling
together your suggestion;

BGridView* messageAndSettingsGridView = new BGridView();
BLayoutBuilder::Grid<>(messageAndSettingsGridView, B_VERTICAL)

Grid builder does not take a B_HORIZONTAL argument.

.Add(fMessageTextView, 0, 0, 2)
.Add(fConfirmMinimumAgeCheckBox, 0, 1, 1)
.Add(fConfirmUserUsageConditionsCheckBox, 0, 2, 1)
.Add(fUserUsageConditionsLink, 0, 3, 2);

BLayoutBuilder::Group<>(this, B_VERTICAL)
.Add(messageAndSettingsGridView, 1)

You can use .AddGrid() here (it works similarly to AddGroup()) if you want to 
inline the addition of all widgets.

.AddGroup(B_HORIZONTAL, 1)
.AddGlue()
.Add(fLogoutButton)
.Add(fAgreeButton)
.End()
.Add(fWorkerIndicator, 1)
.SetInsets(B_USE_WINDOW_INSETS);

I think a comment might be required. ;-)

Regards.


-- 
Adrien.


Other related posts: