[haiku-development] Re: documentation/help with layout system needed

  • From: "Stephan Assmus" <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 26 Aug 2008 12:56:58 +0200

-------- Original-Nachricht --------
> Datum: Tue, 26 Aug 2008 12:16:36 +0200
> Von: julun <host.haiku@xxxxxx>
> An: haiku-development@xxxxxxxxxxxxx
> Betreff: [haiku-development] Re: documentation/help with layout system needed

> Hi Ingo,
> 
> Ingo Weinhold schrieb:
> > On 2008-08-26 at 10:53:33 [+0200], julun <host.haiku@xxxxxx> wrote:
> >> Stephan Assmus schrieb:
> >> <snip>
> >>
> >>>     BGridLayout* sizeBoxLayout = new BGridLayout(10, 10);
> >>>     sizeBox->SetLayout(sizeBoxLayout);
> >>>
> >>>     AddChild(BGroupLayoutBuilder(B_VERTICAL, 10)
> >>>         .Add(BGroupLayoutBuilder(B_HORIZONTAL, 10)
> >>>             .Add(nameEdit->CreateLabelLayoutItem())
> >>>             .Add(nameEdit->CreateTextViewLayoutItem())
> >>>         )
> >>>         .Add(BGridLayoutBuilder(sizeBoxLayout)
> >>>             .Add(widthEdit->CreateLabelLayoutItem(), 0, 0)
> >>>             .Add(widthEdit->CreateTextViewLayoutItem(), 1, 0)
> >>>             .Add(widthLabel, 2, 0)
> >>>             .Add(heightEdit->CreateLabelLayoutItem(), 0, 1)
> >>>             .Add(heightEdit->CreateTextViewLayoutItem(), 1, 1)
> >> while using layouts and e.g BTextControl, i noticed that one has to
> >> always call CreateLabelLayoutItem(), even only interested in the
> >> textview layout item. Same goes for BPopUpMenu/BMenuField combo.
> > 
> > Wouldn't one simply use the whole object in such a case?
> 
> hmm, no. Maybe i don't understand your question fully, but i had this:
> 
> * RadioButton 1
> * RadioButton 2 TextContolView1 TextControlLabel2 TextControlView2
> * RadioButton 3
> 
> Done like this one had at least to call CreateLabelLayoutItem() for 
> TextContol1, even if not interested in the label. Well one can argue 
> don't use the RadioButton label, which would then not work when used 
> in e.g GridLayout etc. I intended to set the min column width for both 
> TextControlView's, which works fine btw.

I think he meant that in your above case, you would simply attach the 
TextControlView1 itself, not it's CreateTextViewLayoutItem(). In another words, 
either layout items could be regarded as not making sense by just themselves.

Best regards,
-Stephan



Other related posts: