Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ONE::gui::ViewportLayout Class Reference

Inheritance diagram for ONE::gui::ViewportLayout:

Inheritance graph
[legend]
List of all members.

Detailed Description

a Viewport -typical layout

This layout is very similar to the WindowLayout. However, it adds four corner components, so that the top and bottom components have the same width as the center component.

Author:
Daniel Seibert


Public Member Functions

void add (Component *, const LayoutConstraint *)
 adds a component to be laid out later
const BoundsgetCenterBounds () const
 retrieves the bounding rectangle of the center component
void layout (Widget *, const Bounds &)
 lays out the given object
Size preferredLayoutSize (const Widget *) const
 calculates the preferred size for the given object
void remove (Component *)
 removes a component
 ViewportLayout ()

Static Public Attributes

static const ViewportConstraint BOTTOM
static const ViewportConstraint BOTTOM_LEFT
static const ViewportConstraint BOTTOM_RIGHT
static const ViewportConstraint CENTER
static const ViewportConstraint LEFT
static const ViewportConstraint RIGHT
static const ViewportConstraint TOP
static const ViewportConstraint TOP_LEFT
static const ViewportConstraint TOP_RIGHT

Classes

struct  ViewportConstraint


Constructor & Destructor Documentation

ONE::gui::ViewportLayout::ViewportLayout  ) 
 


Member Function Documentation

void ONE::gui::ViewportLayout::add Component ,
const LayoutConstraint
[virtual]
 

adds a component to be laid out later

The components are only modified when LayoutManager::layout is called.

Parameters:
comp the component
cons a constraint object which helps the layout manager determine the component's placement

Implements ONE::gui::LayoutManager.

const Bounds& ONE::gui::ViewportLayout::getCenterBounds  )  const
 

retrieves the bounding rectangle of the center component

This function retrieves a valid dimension even if no center component is set. This is possible because that field's size is determined by the sizes of the surrounding components. This function assumes that layout has been called.

Returns:
the bounds of the (possibly nonexistent) center component

void ONE::gui::ViewportLayout::layout Widget ,
const Bounds
[virtual]
 

lays out the given object

This function will rearrange and resize obj 's content to fit inside inner according to this LayoutManager 's layout strategy.

Parameters:
obj the object that will be laid out
inner obj 's inner bounds

Implements ONE::gui::LayoutManager.

Size ONE::gui::ViewportLayout::preferredLayoutSize const Widget  )  const [virtual]
 

calculates the preferred size for the given object

The size is calculated based on this layout manager's layout strategy and the content's preferred sizes. Note, hovever, that this function does not check for the presence of a border around obj.

Parameters:
obj the target of the operation
Returns:
the optimal size for obj

Implements ONE::gui::LayoutManager.

void ONE::gui::ViewportLayout::remove Component  )  [virtual]
 

removes a component

Parameters:
comp the component

Implements ONE::gui::LayoutManager.


Member Data Documentation

const ViewportConstraint ONE::gui::ViewportLayout::BOTTOM [static]
 

const ViewportConstraint ONE::gui::ViewportLayout::BOTTOM_LEFT [static]
 

const ViewportConstraint ONE::gui::ViewportLayout::BOTTOM_RIGHT [static]
 

const ViewportConstraint ONE::gui::ViewportLayout::CENTER [static]
 

const ViewportConstraint ONE::gui::ViewportLayout::LEFT [static]
 

const ViewportConstraint ONE::gui::ViewportLayout::RIGHT [static]
 

const ViewportConstraint ONE::gui::ViewportLayout::TOP [static]
 

const ViewportConstraint ONE::gui::ViewportLayout::TOP_LEFT [static]
 

const ViewportConstraint ONE::gui::ViewportLayout::TOP_RIGHT [static]
 


Generated on Wed Sep 7 19:03:21 2005 for ONEngine by  doxygen 1.4.3