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

wftk::Box Class Reference

a box which can hold multiple screen areas More...

#include <box.h>

Inheritance diagram for wftk::Box:

wftk::ScreenArea List of all members.

Public Types

typedef std::list< ScreenArea * > ChildList
 internal type

enum  Orientation { LEFT_TO_RIGHT, RIGHT_TO_LEFT, TOP_TO_BOTTOM, BOTTOM_TO_TOP }
 The orientation of the box. More...


Public Member Functions

 Box (Orientation)
 create a box with a particular orientation

Orientation orientation () const
 get the box's orientation

void setOrientation (Orientation)
 set the box's orientation

iterator begin ()
 the beginning of the box's list of children

iterator end ()
 the end of the box's list of children

void pack (ScreenArea *, const iterator &)
 add a child to the box (better to use packFront() and packBack())

void erase (const iterator &)
 remove a child from the box

void packFront (ScreenArea *sa)
 Add a child ScreenArea to the front of the box.

void packBack (ScreenArea *sa)
 add a child ScreenArea to the back of the box

void clear ()
 remove all children from the box

iterator find (ScreenArea &)
 find a child in the box (O(N), but N won't be too large in any reasonable case)


Protected Member Functions

virtual void setPackingInfo ()
 recalculate the object's prefered size

virtual void handleResize (Uint16 w, Uint16 h)
 Calculate new shape for shaped widgets, call to setShape() after a resize.


Detailed Description

a box which can hold multiple screen areas

Boxes have an Orientation, either vertical or horizontal. Elements (ScreenAreas) inside the box are ordered within the box using the packBack() and packFront() methods.

If you want to mix horizontal and vertical alignments, use boxes within boxes with varying alignments for each.


Member Enumeration Documentation

enum wftk::Box::Orientation
 

The orientation of the box.

Possible values: LEFT_TO_RIGHT, RIGHT_TO_LEFT, TOP_TO_BOTTOM, BOTTOM_TO_TOP


Member Function Documentation

void wftk::Box::packBack ScreenArea sa  )  [inline]
 

add a child ScreenArea to the back of the box

Boxes have a notion of Orientation, which defines the order and direction that contained Widgets are drawn.

Screen areas at the 'back' of the container are drawn first, with areas at the 'front' of the container following, in the direction specified by the Orientation of this Box.

Screen areas contained in this box do not overlap.

void wftk::Box::packFront ScreenArea sa  )  [inline]
 

Add a child ScreenArea to the front of the box.

Boxes have a notion of Orientation, which defines the order and direction that contained Widgets are drawn.

Screen areas at the 'back' of the container are drawn first, with areas at the 'front' of the container following, in the direction specified by the Orientation of this Box.

Screen areas contained in this box do not overlap.


The documentation for this class was generated from the following files:

Generated Wed Jul 28 17:28:43 2004.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.