Bubba-3D  0.9.0
Awesome game engine!
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ListLayout Class Reference

#include <ListLayout.h>

Inheritance diagram for ListLayout:
Layout

Public Types

enum  Orientation { HORIZONTAL, VERTICAL }
 
- Public Types inherited from Layout
enum  ListenerType { ON_CLICK_LISTENER, ON_HOVER_LISTENER }
 
typedef std::function< void(int x, int y, Layout *element, bool enteredElseLeaving)> EventFunction
 

Public Member Functions

virtual void addChild (Layout *child)
 
virtual Dimension getWidth ()
 
virtual Dimension getHeight ()
 
 ListLayout (Orientation orientation, Dimension width, Dimension height)
 
virtual void getGLSquares (float layoutXPos, float layoutYPos, float layoutWidth, float layoutHeight, std::map< std::string, IHudDrawable * > *map)
 
- Public Member Functions inherited from Layout
virtual std::map< std::string, IHudDrawable * > getGLSquares (float layoutXPos, float layoutYPos, float layoutWidth, float layoutHeight)
 
virtual HUDGraphicgetGraphic ()
 
virtual LayoutsetBackground (HUDGraphic *graphic)
 
virtual LayoutsetLayoutId (std::string id)
 

Protected Member Functions

unsigned int wrapSize (Orientation orientation)
 
void checkChildCompatibility (Layout *child)
 

Protected Attributes

Orientation orientation
 
Dimension width
 
Dimension height
 

Detailed Description

A layout to create a list of other layouts.

Definition at line 24 of file ListLayout.h.

Constructor & Destructor Documentation

ListLayout::ListLayout ( Orientation  orientation,
Dimension  width,
Dimension  height 
)

Creates a list where the children are placed after each other in the specified orientation

Definition at line 32 of file ListLayout.cpp.

Member Function Documentation

void ListLayout::addChild ( Layout child)
virtual

The child of a wrapping layout can only use Dimension::WRAP or Dimension::PIXELS

Definition at line 105 of file ListLayout.cpp.

void ListLayout::getGLSquares ( float  layoutXPos,
float  layoutYPos,
float  layoutWidth,
float  layoutHeight,
std::map< std::string, IHudDrawable * > *  map 
)
virtual

The function to fetch all GLSquares from this layout and its children based on the position and dimensions given. The parent calculates the dimensions and implementing classes must assume that the dimensions are correct. The parent uses getWidth() and getHeight() to determine the dimensions.

The overridden method should always call Layout::getGLSquares(float layoutXPos, float layoutYPos, float layoutWidth, float layoutHeight, map<string,IHudDrawable*>* list) before doing anything else. Otherwise Layout::setBackground() won't have an effect.

Implements Layout.

Definition at line 36 of file ListLayout.cpp.


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