Crazy Eddie's GUI System  0.8.4
CEGUI::LayoutContainer Class Reference

An abstract base class providing common functionality and specifying the required interface for derived classes. More...

+ Inheritance diagram for CEGUI::LayoutContainer:
+ Collaboration diagram for CEGUI::LayoutContainer:

List of all members.

Public Member Functions

 LayoutContainer (const String &type, const String &name)
 Constructor for Window base class.
virtual ~LayoutContainer (void)
 Destructor for Window base class.
void markNeedsLayouting ()
 marks this layout container for relayouting before drawing
bool needsLayouting () const
 returns true if this layout container will be relayouted before drawing
virtual void layout ()=0
 (re)layouts all windows inside this layout container immediately
virtual void layoutIfNecessary ()
 (re)layouts all windows inside this layout container if it was marked necessary
virtual void update (float elapsed)
virtual const CachedRectf & getClientChildContentArea () const
 Return a Rect that is used by client child elements as content area.
virtual void notifyScreenAreaChanged (bool recursive)
 Inform the window, and optionally all children, that screen area rectangles have changed.

Static Public Attributes

static const String EventNamespace
 Namespace for global events.

Protected Types

typedef std::multimap< Window
*, Event::Connection
ConnectionTracker

Protected Member Functions

virtual Rectf getUnclippedInnerRect_impl (bool skipAllPixelAlignment) const
Rectf getClientChildContentArea_impl (bool skipAllPixelAlignment) const
size_t getIdxOfChild (Window *wnd) const
virtual void addChild_impl (Element *element)
virtual void removeChild_impl (Element *element)
virtual bool handleChildSized (const EventArgs &e)
 Handler called when child window gets sized.
virtual bool handleChildMarginChanged (const EventArgs &e)
 Handler called when child window changes margin(s)
virtual bool handleChildAdded (const EventArgs &e)
 Handler called when child window gets added.
virtual bool handleChildRemoved (const EventArgs &e)
 Handler called when child window gets removed.
virtual UVector2 getOffsetForWindow (Window *window) const
 returns margin offset for given window
virtual UVector2 getBoundingSizeForWindow (Window *window) const
 returns bounding size for window, including margins
void onParentSized (ElementEventArgs &e)
 Handler called when this window's parent window has been resized. If this window is the root / GUI Sheet window, this call will be made when the display size changes.

Protected Attributes

bool d_needsLayouting
ConnectionTracker d_eventConnections
 Tracks event connections we make.
CachedRectf d_clientChildContentArea

Detailed Description

An abstract base class providing common functionality and specifying the required interface for derived classes.

Layout Container provide means for automatic positioning based on sizes of it's child Windows. This is useful for dynamic UIs.


Constructor & Destructor Documentation

CEGUI::LayoutContainer::LayoutContainer ( const String type,
const String name 
)

Constructor for Window base class.

Parameters:
typeString object holding Window type (usually provided by WindowFactory).
nameString object holding unique name for the Window.

Member Function Documentation

virtual void CEGUI::LayoutContainer::addChild_impl ( Element element) [protected, virtual]

Add given element to child list at an appropriate position.

Reimplemented from CEGUI::Window.

Reimplemented in CEGUI::GridLayoutContainer.

virtual const CachedRectf& CEGUI::LayoutContainer::getClientChildContentArea ( ) const [virtual]

Return a Rect that is used by client child elements as content area.

Client content area is used for relative sizing, positioning and clipping of child elements that are client (their NonClient property is "false").

See also:
Element::getChildContentArea

Reimplemented from CEGUI::Element.

virtual Rectf CEGUI::LayoutContainer::getUnclippedInnerRect_impl ( bool  skipAllPixelAlignment) const [protected, virtual]

Default implementation of function to return Element's inner rect area.

Reimplemented from CEGUI::Window.

virtual bool CEGUI::LayoutContainer::handleChildAdded ( const EventArgs e) [protected, virtual]

Handler called when child window gets added.

Parameters:
eWindowEventArgs object whose 'window' pointer field is set to the window that triggered the event. For this event the trigger window is the one that was added.
virtual bool CEGUI::LayoutContainer::handleChildMarginChanged ( const EventArgs e) [protected, virtual]

Handler called when child window changes margin(s)

Parameters:
eWindowEventArgs object whose 'window' pointer field is set to the window that triggered the event. For this event the trigger window is the one that has had it's margin(s) changed.
virtual bool CEGUI::LayoutContainer::handleChildRemoved ( const EventArgs e) [protected, virtual]

Handler called when child window gets removed.

Parameters:
eWindowEventArgs object whose 'window' pointer field is set to the window that triggered the event. For this event the trigger window is the one that was removed.
virtual bool CEGUI::LayoutContainer::handleChildSized ( const EventArgs e) [protected, virtual]

Handler called when child window gets sized.

Parameters:
eWindowEventArgs object whose 'window' pointer field is set to the window that triggered the event. For this event the trigger window is the one that was sized.
virtual void CEGUI::LayoutContainer::notifyScreenAreaChanged ( bool  recursive) [virtual]

Inform the window, and optionally all children, that screen area rectangles have changed.

Parameters:
recursive
  • true to recursively call notifyScreenAreaChanged on attached child Window objects.
  • false to just process this Window.

Reimplemented from CEGUI::Window.

void CEGUI::LayoutContainer::onParentSized ( ElementEventArgs e) [protected, virtual]

Handler called when this window's parent window has been resized. If this window is the root / GUI Sheet window, this call will be made when the display size changes.

Parameters:
eWindowEventArgs object whose 'window' pointer field is set the the window that caused the event; this is typically either this window's parent window, or NULL to indicate the screen size has changed.

Reimplemented from CEGUI::Window.

virtual void CEGUI::LayoutContainer::removeChild_impl ( Element element) [protected, virtual]

Remove given element from child list.

Reimplemented from CEGUI::Window.

Reimplemented in CEGUI::GridLayoutContainer.

virtual void CEGUI::LayoutContainer::update ( float  elapsed) [virtual]

Cause window to update itself and any attached children. Client code does not need to call this method; to ensure full, and proper updates, call the injectTimePulse methodname method provided by the System class.

Note:
The update order is such that 'this' window is updated prior to any child windows, this is so that child windows that access the parent in their update code get the correct updated state.
Parameters:
elapsedfloat value indicating the number of seconds passed since the last update.
Returns:
Nothing.

Reimplemented from CEGUI::Window.

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends