- Debugger: Getting mixed signals
- 'Packaging Infrastructure' Contract Weekly Report #4
- Haiku monthly activity report - 06/2015
- 'Packaging Infrastructure' Contract Weekly Report #3
- 'Packaging Infrastructure' Contract Weekly Report #2
- GCI 2014 winners trip report (mentor side)
- TeX Live and LyX; Changes to the boot code
- 'Packaging Infrastructure' Contract Weekly Report #1
- Beginning of 'Packaging Infrastructure' Contract
- Haiku monthly activity report - 05/2015
Layout docs landing
It's been a long time coming, and they're still not done, but I've committed some initial documentation for the Layout API. For the curious, you can access the documented classes here, there is also an introduction to building a GUI with the Layout API here. If you happen to find a typo, or inaccurate info, please contact me so I can fix it. Finally, note that, like the documentation, the Layout API is not yet finalized.
- yourpalal's blog
- Login or register to post comments

Comments
Re: Layout docs landing
Hi,
thanks for this Documents.
I think some Graphics/Shots in the Documents are better for understands!
Ralf
Re: Layout docs landing
It's a pleasure to see, how fast and easy a layout can be built. It's simply great.
Could you perhaps also explain a little in what sense the Layout Api is not yet finished? (What is still missing, and how long could it take to finish it. Is there something important/critical that is still missing from the api?)
Re: Layout docs landing
The API itself is actually pretty complete right now, but the ABI is not yet stabilized, so distributing binary apps that use the Layout API is not a good idea.
Re: Layout docs landing
I was working with the layout API and I had a few questions. I have a window with a menubar and a view covering the rest of the screen. I add the view to the grid using mainGrid->AddView(summaryView);. If I select a menu item, I would like to close/remove/hide the summaryview and its controls and display another view in the mainwindow say called editView. I'm unclear of the best way to add/remove or show/hide the views.
I mean, based on the api, it seems like I should add the view, then remove it and add my other view, but i'm not sure how to get the view to remove it? I mean, when you select edit, i call mainGrid->RemoveView(summaryView); and then mainGrid->AddView(editView);. But if i call the same menu item, the editView dissapears and nothing shows up.
It seemed like a good idea to have different views with controls and add and remove as needed, but I can't determine what view is currently part of the grid, to ensure I remove that and ensure the view I want isn't added.
Anyway, I love the layout api, it works great and is much easier than hard coding all the values. hopefully you can provide a little input on my problem. If not, I'll hop over to the third party mailing list and ask there.
Thanks and keep up the great work.
Re: Layout docs landing
pjrinaldi, I think the best solution for you is actually BCardLayout, which functions like a stack of cards, only displaying the view (card) that is on top. You add each view to the layout and then use BCardLayout::SetVisibleItem() to dictate which view is visible. I haven't documented it yet, but hopefully this + CardLayout.h should tell you everything you need to know.
Re: Layout docs landing
Related to the LayoutBuilder.
I think it should be easier to Add Boxes (frames) to the Layout...
For example:
Would put a box/frame around that certain Group.
Re: Layout docs landing
cipri: Actually, the layout classes are meant to deal only with sizing and positioning, you can achieve what you want by placing your BGroupViews and BGridViews in a BBox, which provides a nice frame around its contents (and an optional title).
Re: Layout docs landing
cipri: Actually, the layout classes are meant to deal only with sizing and positioning, you can achieve what you want by placing your BGroupViews and BGridViews in a BBox, which provides a nice frame around its contents (and an optional title).
yes, that would be possible, but it would make the code look more complicated.
For example there exists also AddSplit, in that case you could have said the same, that you can add views to o SplitView.... und you see, that AddSplit is very useful, and makes the code a lot less complicated. Something like AddBox could also very useful too.
And in general it would be good/useful if more different frames/borders would be available, to be able to decorate the gui better.
Re: Layout docs landing
How, do i do, if after I set the layout of a window, and later, I want to remove that layout and replace it with another?
I saw your advice with CardLayout, but I think it would use less memory, if it would be easier to modify the existing layout. So I guess it would be useful, if the BWindow would have a method like RemoveLayout , (without deleting the layout) , so that I can remove it, and modify it, and then set it again as the layout of the window.
Re: Layout docs landing
The BCardLayout sounds exactly what I would need. I should be able to work off of the header file. I missed the obvious while concentrating on trying to get the views working with gridlayout and didn't even look to see if there was something else i could use. Thanks for the information. Hopefully I'll get a chance in the next few weeks to try it out and see how it goes.