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

ONE::gui::StackLayout Class Reference

Inheritance diagram for ONE::gui::StackLayout:

Inheritance graph
[legend]
List of all members.

Detailed Description

arranges components in a row or a column

Depending on the values passed to the constructor, components are laid out horizontally (in a row) or vertically (in a column), aligned as specified and with an inter-component space of gp. If the container using this manager offers enough space, components receive their preferred size. Otherwise, they are scaled down according to their respective requests. This layout manager ignores any constraint passed to its add function.

Author:
Daniel Seibert


Public Types

enum  { HORIZONTAL, VERTICAL }
enum  { CENTER = 0, LEFT = 1, RIGHT = 2 }
enum  { TOP = 1, BOTTOM = 2 }

Public Member Functions

void add (Component *, const LayoutConstraint *)
 adds a component to be laid out later
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
 StackLayout (char or=HORIZONTAL, char al=LEFT, int gp=0)


Member Enumeration Documentation

anonymous enum
 

Enumerator:
HORIZONTAL 
VERTICAL 

anonymous enum
 

Enumerator:
CENTER 
LEFT 
RIGHT 

anonymous enum
 

Enumerator:
TOP 
BOTTOM 


Constructor & Destructor Documentation

ONE::gui::StackLayout::StackLayout char  or = HORIZONTAL,
char  al = LEFT,
int  gp = 0
 


Member Function Documentation

void ONE::gui::StackLayout::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.

void ONE::gui::StackLayout::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::StackLayout::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::StackLayout::remove Component  )  [virtual]
 

removes a component

Parameters:
comp the component

Implements ONE::gui::LayoutManager.


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