[haiku-bugs] Re: [Haiku] #3787: Poorman: Use layoutmanager

  • From: "yourpalal" <trac@xxxxxxxxxxxx>
  • Date: Sat, 16 Jun 2012 16:29:53 -0000

#3787: Poorman: Use layoutmanager
------------------------------------+----------------------------
   Reporter:  humdinger             |      Owner:  yourpalal
       Type:  enhancement           |     Status:  assigned
   Priority:  normal                |  Milestone:  R1
  Component:  Applications/PoorMan  |    Version:  R1/Development
 Resolution:                        |   Keywords:
 Blocked By:                        |   Blocking:
Has a Patch:  1                     |   Platform:  All
------------------------------------+----------------------------

Comment (by yourpalal):

 Hi mks, thanks for working on this ticket.

 Some comments on layout building:

  * Please switch from using BGroupLayoutBuilder (GroupLayoutBuilder.h) to
 BLayoutBuilder::Group (LayoutBuilder.h) BGroupLayoutBuilder will be
 deprecated soon, so we don't want to introduce any more code that uses it
 into our codebase. This isn't really documented anywhere, so I can't blame
 you for not knowing it! Thankfully the interfaces are very similar, and
 it's quite fast to switch from one to the other.
  * Once you've made the switch, instead of doing Add(BGroupLayoutBuilder()
 ... ), please use the AddGroup() method, which is very similar.
  * Instead of someBBox->AddChild(BGroupLayoutBuilder(..)... you can use
 BLayoutBuilder::Group<>(someBBox, ...) to build a group layout in the
 bbox.
  * You can also use the BLayouBuilder::Group<>::AddGroup() methods in a
 similar way to add a view with a group layout
  * Instead of setting the layout on a view/window and then adding a
 GroupView in the view/window, it is preferred to build the layout directly
 in the view/window, just start with a
 BLayoutBuilder::Group<>(view_or_window, ...)
  * For some documentation of the BLayoutBuilder classes, including a short
 tutorial on using them, you can see http://api.haiku-
 os.org/layout_intro.html and the docs it links to.

 I appreciate the style fixes, but the style for inline methods is
 different from what you used in PoorManLoggingView.h . For instance,
 SetLogConsoleValue should look like this:


 {{{
         void SetLogConsoleValue(bool state) {
              if (state)
                  fLogConsole->SetValue(B_CONTROL_ON);
              else
                  fLogConsole->SetValue(B_CONTROL_OFF);
         }
 }}}


 misc:

  * You included SpaceLayoutItem.h in PoorManPreferencesWindow but didn't
 use any classes from it.
  * In the future, if there are that many style issues, it is better to fix
 them in a separate patch, so that the functional changes are easier to
 spot. I know this was inherited from tokyo6pm, but it's something to keep
 in mind for your future endeavours :)


 I didn't apply/compile/test the patch, but try making these changes. If
 you are still having issues with the BBoxes once that's done, I can
 hopefully look deeper into the problem sometime in the future.

 Thanks again for your work :)

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/3787#comment:10>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: