[haiku-development] Re: BBox and layout
- From: Clemens <clemens.zeidler@xxxxxxxxxxxxxx>
- To: haiku-development@xxxxxxxxxxxxx
- Date: Tue, 08 May 2012 16:19:09 +1200
no that would just make thinks more complicated and mix BView and BLayoutmore then necessary. As said before the BView::AddChild api is notsufficient to create arbitrary layouts. For example, a beginner who creates a simple BGroupLayout using AddChild would face the problem that he is notable to add a BSpacerLayoutItem. That is very confusing.I don't think this is necessarily a big problem. You can add spacers to a group layout using the AddChild(BLayoutItem* method). In the case of a
Oh yes, missed that there is also a AddChild(BLayoutItem* method)...
BGridLayout, for instance would an api user really expect the layout to becreated to their liking using just AddChild()?
exactly, the user would use the special BGridLayout's methods, but what does happened if BView::AddChild adds something to BGridLayout? Its a bit random...
Using just BLayout for layout stuff is much cleaner. Furthermore, a separation would make it possible to add a view to multiple layouts and switch between the different layouts on the fly :)I don't understand what you mean by that. A view can only have one parent view, and that's an unchangeable part of the api. However, if you want to have a very flat view hierarchy and use nested layouts, you could potentially have a view in multiple layouts, using multiple layouts.
what I'm meant is that you have e.g. two slightly different layouts and you can switch between them using SetLayout. The current solution would disassemble the old layout in this case. Each view is only child of exactly one parent but it could still be child of an unconnected layout...
ps. I would even remove the main AddItem(...) and AddView(...) fromBLayout. Already in a grid layout I would not be sure what it will do or if it is allowed to used these methods. Each specialized layout should provideappropriated methods by itself.They're a bit uncomfortable in some contexts, but I think they're useful tokeep the simple things simple.
Yeah, but why not add this simple methods where they really make sense, i.e. in BGroupLayout and maybe BGridLayout. But IMHO they do not belong into the BLayout interface because they are not meaningful for all layouts.
cheers,
Clemens
- Follow-Ups:
- [haiku-development] Re: BBox and layout
- From: Alex Wilson
- [haiku-development] Re: BBox and layout
- References:
- [haiku-development] Re: BBox and layout
- From: Ingo Weinhold
- [haiku-development] Re: BBox and layout
- From: Stephan Aßmus
- [haiku-development] Re: BBox and layout
- From: Axel Dörfler
- [haiku-development] Re: BBox and layout
- From: Clemens Zeidler
- [haiku-development] Re: BBox and layout
- From: Alex Wilson
- [haiku-development] Re: BBox and layout
Other related posts:
- » [haiku-development] BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Ingo Weinhold
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Stephan Aßmus
- » [haiku-development] Re: BBox and layout - Axel Dörfler
- » [haiku-development] Re: BBox and layout - Clemens Zeidler
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - clemens . zeidler
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Axel Dörfler
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Ingo Weinhold
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Ingo Weinhold
- » [haiku-development] Re: BBox and layout - Stephan Aßmus
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Ingo Weinhold
- » [haiku-development] Re: BBox and layout - pulkomandy
- » [haiku-development] Re: BBox and layout - Clemens Zeidler
- » [haiku-development] Re: BBox and layout - Clemens Zeidler
- » [haiku-development] Re: BBox and layout - Ingo Weinhold
- » [haiku-development] Re: BBox and layout - Alex Wilson
- » [haiku-development] Re: BBox and layout - Clemens Zeidler
- » [haiku-development] Re: BBox and layout - Ingo Weinhold
- » [haiku-development] Re: BBox and layout - Clemens
- » [haiku-development] Re: BBox and layout - Ingo Weinhold
- » [haiku-development] Re: BBox and layout - Clemens Zeidler
- » [haiku-development] Re: BBox and layout - Ingo Weinhold