Class VerticalFlowLayout

GEOS-SC:  Library toolkit_lib: Class VerticalFlowLayout


The VerticalFlowLayout class implements a layout manager that arranges components along a vertical line with a variety of spacing options.

#include <toolkit/lmvflow.h>


Class Data and Methods

public:
// VerticalFlowLayout members
enum Y_Justify;
enum X_Justify;
VerticalFlowLayout();
VerticalFlowLayout(WinCoord gap, Y_Justify yjustify , X_Align align , X_Justify xjustify );
void EnforceMinimumSize(Boolean enforce);
X_Align GetAlignment(void);
X_Justify GetXJustification(void);
Y_Justify GetYJustification(void);
Boolean IsMinimumSizeEnforced(void);
void LayoutContainer(FlexContainer *parent);
Dimension MinimumLayoutSize(FlexContainer *parent);
Dimension PreferredLayoutSize(FlexContainer *parent);
void SetAlignment(X_Align align);
void SetXJustification(X_Justify xjustify);
void SetYJustification(Y_Justify yjustify);
void SetOptions(X_Align align, Y_Justify yjustify, X_Justify xjustify , WinCoord gap );
protected:

Inherited Data and Methods:

public:
// LayoutManagerInterface members
enum X_Align;
enum Y_Align;
enum X_Place;
enum Y_Place;
void AddLayoutComponent(LayoutTagType tag, uint32 position, FlexComponent *comp);
void DoLayout(FlexContainer *parent);
void DoPreLayout(FlexContainer *parent);
Dimension MinimumLayoutSize(FlexContainer *parent);
Dimension PreferredLayoutSize(FlexContainer *parent);
void RemoveLayoutComponent(FlexComponent *comp, uint32 position);
// LayoutManagerInterface utilities
static void AlignX(FlexComponent *comp, FlexComponent *toComp, X_Align xalign);
static void AlignY(FlexComponent *comp, FlexComponent *toComp, Y_Align yalign);
static WinCoord AlignCalcX(WinCoord areaWidth, WinCoord toX, WinCoord toWidth, X_Align xalign);
static WinCoord AlignCalcY(WinCoord areaHeight, WinCoord toY, WinCoord toHeight, Y_Align yalign);
static void AlignWithParent(FlexComponent *comp, X_Align xalign, Y_Align yalign, WinCoord leftInset , WinCoord rightInset , WinCoord topInset , WinCoord bottomInset );
static void AlignWithParentX(FlexComponent *comp, X_Align xalign, WinCoord leftInset , WinCoord rightInset );
static void AlignWithParentY(FlexComponent *comp, Y_Align yalign, WinCoord topInset , WinCoord bottomInset );
static WinXYPoint GetAppRelativeLocation(FlexComponent *comp);
static void PlaceX(FlexComponent *comp, FlexComponent *toComp, X_Place xplace);
static void PlaceY(FlexComponent *comp, FlexComponent *toComp, Y_Place yplace);
Dimension GetComponentSizes(void);
WinCoord GetGap(void);
LayoutTagType GetLayoutTag(void);
void SetGap(WinCoord gap);
void SetComponentSizes(WinCoord widths, WinCoord heights);
void SetLayoutTag(LayoutTagType tag);
protected:
void LayoutContainer(FlexContainer *parent);

Back to the top of VerticalFlowLayout


Ancestors

Inheritance tree for VerticalFlowLayout, in the order of the most derived to the most ancestral base class:

Back to the top of VerticalFlowLayout


Descendants

Back to the top of VerticalFlowLayout


OVERVIEW

VerticalFlowLayout extends FlowLayout by providing extra functions to control the location and spacing of components in terms of:

Horizontal alignment (LayoutManagerInterface::X_Align).

Vertical justification (VerticalFlowLayout::Y_Justify).

Horizontal justification (VerticalFlowLayout::X_Justify).

Back to the top of VerticalFlowLayout


Descriptions of Class Data and Methods


enum Y_Justify;

These values control the vertical location of the components (as a group) within the container.

Y_JUSTIFY_TOP
Components are grouped near the top of the parent.
Y_JUSTIFY_CENTER
Components are grouped at the vertical center of the parent.
Y_JUSTIFY_BOTTOM
Components are grouped near the bottom of the parent.
Y_JUSTIFY_FULL
Components are spread out and all available vertical space is divided equally between them.
Y_JUSTIFY_FULL_WITH_ENDS
Same as Y_JUSTIFY_FULL, but an extra gap space is divided between the top/bottom ends of the flow. This preserves the center position of components if their sizes change.

Declared as:

enum {
        Y_JUSTIFY_TOP,
        Y_JUSTIFY_CENTER,
        Y_JUSTIFY_BOTTOM,
        Y_JUSTIFY_FULL,
        Y_JUSTIFY_FULL_WITH_ENDS
    } Y_Justify;

Back to the top of VerticalFlowLayout


enum X_Justify;

These values control the horizontal location of the components (as a group) within the container.

X_JUSTIFY_LEFT
Flow is grouped near the left edge.
X_JUSTIFY_CENTER
Flow is grouped at the vertical center.
X_JUSTIFY_RIGHT
Flow is grouped near the right edge.

Declared as:

enum {
        X_JUSTIFY_LEFT,
        X_JUSTIFY_CENTER,
        X_JUSTIFY_RIGHT
    } X_Justify;

Back to the top of VerticalFlowLayout


VerticalFlowLayout();

Constructs a VerticalFlowLayout with default settings.

Prototype:

    VerticalFlowLayout();

Back to the top of VerticalFlowLayout


VerticalFlowLayout(WinCoord gap, Y_Justify yjustify , X_Align align , X_Justify xjustify );

Constructs a VerticalFlowLayout with the specified settings.

Parameters:

in gap
Space to put between components.
in yjustify
Vertical justification of components.
in align
Horizontal alignment of components.
in xjustify
Horizontal justification of components.

Prototype:

    VerticalFlowLayout(WinCoord  gap,
                       Y_Justify yjustify = Y_JUSTIFY_CENTER,
                       X_Align   align    = X_ALIGN_CENTER,
                       X_Justify xjustify = X_JUSTIFY_CENTER);

Back to the top of VerticalFlowLayout


void EnforceMinimumSize(Boolean enforce);

Tells the flow whether to enforce a minimum size restriction on the container being laid out (it can't be smaller than the layout's preferred size). This is used for situations where the container might be resized by the user. If the minimum size is enforced, the user won't be able to make the container smaller than the layout but it could still be made larger if the container does not use its preferred size.

Parameters:

in enforce
TRUE to enforce minimum size.

See also: IsMinimumSizeEnforced()

Prototype:

    void EnforceMinimumSize(Boolean enforce);

Back to the top of VerticalFlowLayout


X_Align GetAlignment(void);

Returns the alignment being used.

Return value: X_Align value being used.

See also: SetAlignment()

Prototype:

    X_Align GetAlignment(void);

Back to the top of VerticalFlowLayout


X_Justify GetXJustification(void);

Returns the vertical justification being used.

Return value: Y_Justify value being used.

See also: SetXJustification()

Prototype:

    X_Justify GetXJustification(void);

Back to the top of VerticalFlowLayout


Y_Justify GetYJustification(void);

Returns the vertical justification being used.

Return value: Y_Justify value being used.

See also: SetYJustification()

Prototype:

    Y_Justify GetYJustification(void);

Back to the top of VerticalFlowLayout


Boolean IsMinimumSizeEnforced(void);

Finds out if the layout manager always enforces a minimum size (its preferred size) on the container. If a minimum size is enforced, the container can be larger but not smaller.

Return value: TRUE if minimum size is enforced.

See also: EnforceMinimumSize()

Prototype:

    Boolean IsMinimumSizeEnforced(void);

Back to the top of VerticalFlowLayout


void LayoutContainer(FlexContainer *parent);

Lays out a container.

Parameters:

in parent
Container to be laid out.

Overrides: LayoutManagerInterface::LayoutContainer

Prototype:

    virtual void LayoutContainer(FlexContainer *parent);

Back to the top of VerticalFlowLayout


Dimension MinimumLayoutSize(FlexContainer *parent);

Determines the minimum size of the passed container when laid out with this layout manager.

Parameters:

in parent
Pointer to the container to measure.

Return value: The minimum size as a Dimension value.

Overrides: LayoutManagerInterface::MinimumLayoutSize

Prototype:

    virtual Dimension MinimumLayoutSize(FlexContainer *parent);

Back to the top of VerticalFlowLayout


Dimension PreferredLayoutSize(FlexContainer *parent);

Determines the preferred size of the passed container when laid out with this layout manager.

Parameters:

in parent
Pointer to the container to measure.

Return value: The preferred size as a Dimension value.

Overrides: LayoutManagerInterface::PreferredLayoutSize

Prototype:

    virtual Dimension PreferredLayoutSize(FlexContainer *parent);

Back to the top of VerticalFlowLayout


void SetAlignment(X_Align align);

Sets the alignment to use.

Parameters:

in align
X_Align value to use.

See also: GetAlignment()

Prototype:

    void SetAlignment(X_Align align);

Back to the top of VerticalFlowLayout


void SetXJustification(X_Justify xjustify);

Sets the horizontal justification to use.

Calling this will not cause the parent to become invalidated.

Parameters:

in xjustify
Horizontal justification of the components.

See also: GetXJustification()

Prototype:

    void SetXJustification(X_Justify xjustify);

Back to the top of VerticalFlowLayout


void SetYJustification(Y_Justify yjustify);

Sets the vertical justification to use.

Calling this will not cause the parent to become invalidated.

Parameters:

in yjustify
Vertical justification of the components.

See also: GetYJustification()

Prototype:

    void SetYJustification(Y_Justify yjustify);

Back to the top of VerticalFlowLayout


void SetOptions(X_Align align, Y_Justify yjustify, X_Justify xjustify , WinCoord gap );

Initializes an existing flow with the passed parameters. This does not cause any containers to become invalidated.

Parameters:

in align
Alignment of the flow components.
in yjustify
Vertical justification.
in xjustify
Horizontal justification.
in gap
Space to put between components.

Prototype:

    void SetOptions(X_Align   align, 
                    Y_Justify yjustify, 
                    X_Justify xjustify  = X_JUSTIFY_CENTER,
                    WinCoord  gap       = 5);

Back to the top of VerticalFlowLayout


Generated from source by Geoworks on Sat Dec 12 18:32:00 1998 .