The Layout Library: MBViewWrapper

Derived from: public MView, public BView

Declared in: <MBViewWrapper.h>


Overview

An MBViewWrapper is a wrapper-class for a standard BView. By attaching a standard BView to an MBViewWrapper, the BView can participate in the layout-process, without being a layoutable class itself.
Although this is a simple method of making any BView participate, it does have one disadvantage: it adds a little more overhead, as there are now two BViews (the wrapper and your own BView), where there would otherwise have been only one.


Constructor and Destructor


MBViewWrapper()

      MBViewWrapper(BView *bview, bool usepreferred=true, bool x_fixed=true, bool y_fixed=true)

Initializes an MBViewWrapper that will contain the BView view
If usepreferred is true, view will be queried through its GetPreferredSize() memberfunction for its preferred size. This size will be used as the minimum size. If usepreferred is false, then the minimum size of view will be equal to the size with which it was constructed.
If x_fixed is true and bview'sresizing mode does not include B_FOLLOW_LEFT_RIGHT, the size of the object will be fixed in the horizontal direction, and will be equal to its minimum size.
If y_fixed is true and bview'sresizing mode does not include B_FOLLOW_TOP_BOTTOM, the size of the object will be fixed in the vertical direction, and will be equal to its minimum size.

Note that the x_fixed and y_fixed arguments are essentially obsolete. If you use their default values, you can control the resizing behaviour of the view by setting its resizing mode.


~MBViewWrapper()

      virtual ~MBViewWrapper(void)

Cleans up after the MBViewWrapper.



Copyright © 1997 Marco Nelissen (marcone@xs4all.nl) All rights reserved.

Be, BeOS, BeBox, BeWare, GeekPort, the Be logo, the BeOS logo, roColour, Beatware and Beatware painter are trademarks or registered trademarks of their respective owners.