YAPOG  0.0.1
Yet Another Pokemon Online Game
yap::LayoutBox Class Reference

#include <LayoutBox.hpp>

Inheritance diagram for yap::LayoutBox:
Collaboration diagram for yap::LayoutBox:

List of all members.

Public Types

enum  Align {
  LEFT, CENTER, RIGHT, TOP,
  BOTTOM
}

Public Member Functions

 LayoutBox ()
 LayoutBox (Padding ext, Padding in, bool isExt)
virtual ~LayoutBox ()
virtual bool IsFocusable () const
virtual void AddChild (IWidget &child, Align align=Align::CENTER)
void RemoveChild (IWidget &child)
virtual float GetWidthItem ()=0
void SetExtensible (bool isExt)
bool GetExtensible ()
void SetAlign (Align global)
Align GetAlign ()
void Clear ()
virtual void Refresh ()
const PaddingGetInnerPadding () const
uint Count () const
- Public Member Functions inherited from yap::BaseWidget
 BaseWidget ()
virtual ~BaseWidget ()
virtual void AddDrawable (IDrawable &drawable)
virtual void AddChild (IWidget &child)
virtual void FrontAddChild (IWidget &child)
virtual IWidgetGetRoot () const
virtual void SetDefaultColor (const sf::Color &color)
virtual void SetParent (IWidget &parent)
virtual void SetPadding (const Padding &padding)
virtual void SetBackground (WidgetBackground &background)
virtual void SetBorder (WidgetBorder &border, uint width)
virtual void SetBorder (WidgetBorder &border)
virtual void UnsetBackground ()
virtual void UnsetBorder ()
Vector2 GetUserSize () const
virtual void SetToTop ()
virtual void SetEnable (bool enable)
virtual void Open ()
virtual void Close ()
virtual const Vector2GetPosition () const
 Gets the coordinates in pixels of the origin of this ISpatial from the global origin.
virtual const Vector2GetSize () const
 Gets the size in pixels of this ISpatial.
virtual const Vector2GetTopLeft () const
virtual const Vector2GetBottomRight () const
virtual const Vector2GetCenter () const
virtual const sf::FloatRect & GetRectangle () const
virtual WidgetBorderGetBorder () const
virtual void Move (const Vector2 &offset)
virtual void Scale (const Vector2 &factor)
virtual void SetPosition (const Vector2 &position)
virtual void SetSize (const Vector2 &size)
virtual void Draw (IDrawingContext &context)
virtual bool IsVisible () const
virtual void Show (bool isVisible)
virtual void ChangeColor (const sf::Color &color)
virtual bool OnEvent (const GuiEvent &guiEvent)
 Treats an event. Transferts the event before treating it.
virtual bool OnPriorityEvent (const GuiEvent &guiEvent)
 Treats an event. Treats the event before transfering it.
virtual void Update (const Time &dt)
 Makes the object evolve for one frame of the game.
- Public Member Functions inherited from yap::IWidget
virtual ~IWidget ()
- Public Member Functions inherited from yap::ISpatial
virtual ~ISpatial ()
- Public Member Functions inherited from yap::IDrawable
virtual ~IDrawable ()
- Public Member Functions inherited from yap::IEventHandler
virtual ~IEventHandler ()
- Public Member Functions inherited from yap::IUpdateable
virtual ~IUpdateable ()

Protected Member Functions

virtual void GeneratePosition ()=0
virtual Vector2 HandleGetSize () const
virtual void HandleMove (const Vector2 &offset)
virtual void HandleScale (const Vector2 &factor)
virtual void HandleDraw (IDrawingContext &context)
virtual void HandleShow (bool isVisible)
virtual void HandleChangeColor (const sf::Color &color)
virtual void HandleUpdate (const Time &dt)
float MaxSize (char coord)
virtual bool HandleOnPriorityEvent (const GuiEvent &guiEvent)
- Protected Member Functions inherited from yap::BaseWidget
void RefreshBorder ()
virtual void SetFocused (bool state)
virtual bool HandleOnEvent (const GuiEvent &guiEvent)

Protected Attributes

collection::Map< IWidget *, Alignitems_
collection::Array< IWidget * > focusables_
Padding innerPad_
Padding externPad_
Align globalAlign_
Vector2 realSize_
uint focusedChild_
- Protected Attributes inherited from yap::BaseWidget
SpatialInfo spatialInfo_
bool isVisible_
bool isEnabled_
sf::Color color_
collection::List< IDrawable * > drawables_
collection::List< IEventHandler * > eventHandlers_
collection::List< IWidget * > childen_
collection::List< IUpdateable * > updatables_
IWidgetroot_
IWidgetparent_
Padding padding_
WidgetBackgroundbackground_
WidgetBorderborder_
Vector2 userSize_
bool isExtensible_
bool isFocused_
sf::Color userColor_
bool isChangeColorCall_

Private Member Functions

 DISALLOW_COPY (LayoutBox)

Additional Inherited Members

- Public Attributes inherited from yap::BaseWidget
Event< const BaseWidget
&, const EventArgs & > 
OnMoved
Event< const BaseWidget
&, const EventArgs & > 
OnScaled
Event< const BaseWidget
&, const EventArgs & > 
OnSizeSet
Event< const BaseWidget
&, const EventArgsDraw & > 
OnDraw
Event< const BaseWidget
&, const EventArgsColor & > 
OnColorChanged
Event< const BaseWidget
&, const EventArgsIWidget & > 
OnChildAdded
- Static Protected Attributes inherited from yap::BaseWidget
static const bool DEFAULT_VISIBLE_STATE = true
static const bool DEFAULT_ENABLED_STATE = true
static const sf::Color DEFAULT_COLOR = sf::Color::Black

Detailed Description

Definition at line 12 of file LayoutBox.hpp.


Member Enumeration Documentation

Enumerator:
LEFT 
CENTER 
RIGHT 
TOP 
BOTTOM 

Definition at line 18 of file LayoutBox.hpp.


Constructor & Destructor Documentation

yap::LayoutBox::LayoutBox ( )

Definition at line 8 of file LayoutBox.cpp.

yap::LayoutBox::LayoutBox ( Padding  ext,
Padding  in,
bool  isExt 
)

Definition at line 18 of file LayoutBox.cpp.

yap::LayoutBox::~LayoutBox ( )
virtual

Definition at line 77 of file LayoutBox.cpp.


Member Function Documentation

void yap::LayoutBox::AddChild ( IWidget child,
Align  align = Align::CENTER 
)
virtual

Definition at line 95 of file LayoutBox.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::LayoutBox::Clear ( )

Definition at line 41 of file LayoutBox.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

uint yap::LayoutBox::Count ( ) const

Definition at line 29 of file LayoutBox.cpp.

Here is the call graph for this function:

yap::LayoutBox::DISALLOW_COPY ( LayoutBox  )
private
virtual void yap::LayoutBox::GeneratePosition ( )
protectedpure virtual

Implemented in yap::HorizontalLayout, and yap::VerticalLayout.

Here is the caller graph for this function:

LayoutBox::Align yap::LayoutBox::GetAlign ( )

Definition at line 72 of file LayoutBox.cpp.

bool yap::LayoutBox::GetExtensible ( )

Definition at line 62 of file LayoutBox.cpp.

const Padding & yap::LayoutBox::GetInnerPadding ( ) const

Definition at line 90 of file LayoutBox.cpp.

Here is the caller graph for this function:

virtual float yap::LayoutBox::GetWidthItem ( )
pure virtual

Implemented in yap::HorizontalLayout, and yap::VerticalLayout.

Here is the caller graph for this function:

void yap::LayoutBox::HandleChangeColor ( const sf::Color &  color)
protectedvirtual

Reimplemented from yap::BaseWidget.

Reimplemented in yap::HorizontalLayout, and yap::VerticalLayout.

Definition at line 177 of file LayoutBox.cpp.

void yap::LayoutBox::HandleDraw ( IDrawingContext context)
protectedvirtual

Reimplemented from yap::BaseWidget.

Reimplemented in yap::HorizontalLayout, and yap::VerticalLayout.

Definition at line 157 of file LayoutBox.cpp.

Vector2 yap::LayoutBox::HandleGetSize ( ) const
protectedvirtual

Reimplemented from yap::BaseWidget.

Definition at line 81 of file LayoutBox.cpp.

Here is the call graph for this function:

void yap::LayoutBox::HandleMove ( const Vector2 offset)
protectedvirtual

Reimplemented from yap::BaseWidget.

Reimplemented in yap::HorizontalLayout, and yap::VerticalLayout.

Definition at line 165 of file LayoutBox.cpp.

bool yap::LayoutBox::HandleOnPriorityEvent ( const GuiEvent guiEvent)
protectedvirtual

Reimplemented from yap::BaseWidget.

Definition at line 117 of file LayoutBox.cpp.

Here is the call graph for this function:

void yap::LayoutBox::HandleScale ( const Vector2 factor)
protectedvirtual

Reimplemented from yap::BaseWidget.

Reimplemented in yap::HorizontalLayout, and yap::VerticalLayout.

Definition at line 169 of file LayoutBox.cpp.

void yap::LayoutBox::HandleShow ( bool  isVisible)
protectedvirtual

Reimplemented from yap::BaseWidget.

Reimplemented in yap::HorizontalLayout, and yap::VerticalLayout.

Definition at line 161 of file LayoutBox.cpp.

void yap::LayoutBox::HandleUpdate ( const Time dt)
protectedvirtual

Reimplemented from yap::BaseWidget.

Reimplemented in yap::HorizontalLayout, and yap::VerticalLayout.

Definition at line 173 of file LayoutBox.cpp.

bool yap::LayoutBox::IsFocusable ( ) const
virtual

Implements yap::BaseWidget.

Definition at line 52 of file LayoutBox.cpp.

float yap::LayoutBox::MaxSize ( char  coord)
protected

Definition at line 181 of file LayoutBox.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::LayoutBox::Refresh ( )
virtual

Reimplemented from yap::BaseWidget.

Definition at line 33 of file LayoutBox.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::LayoutBox::RemoveChild ( IWidget child)
virtual

Reimplemented from yap::BaseWidget.

Definition at line 106 of file LayoutBox.cpp.

Here is the call graph for this function:

void yap::LayoutBox::SetAlign ( Align  global)

Definition at line 67 of file LayoutBox.cpp.

void yap::LayoutBox::SetExtensible ( bool  isExt)

Definition at line 57 of file LayoutBox.cpp.


Member Data Documentation

Padding yap::LayoutBox::externPad_
protected

Definition at line 66 of file LayoutBox.hpp.

collection::Array<IWidget*> yap::LayoutBox::focusables_
protected

Definition at line 64 of file LayoutBox.hpp.

uint yap::LayoutBox::focusedChild_
protected

Definition at line 70 of file LayoutBox.hpp.

Align yap::LayoutBox::globalAlign_
protected

Definition at line 67 of file LayoutBox.hpp.

Padding yap::LayoutBox::innerPad_
protected

Definition at line 65 of file LayoutBox.hpp.

collection::Map<IWidget*, Align> yap::LayoutBox::items_
protected

Definition at line 63 of file LayoutBox.hpp.

Vector2 yap::LayoutBox::realSize_
protected

Definition at line 69 of file LayoutBox.hpp.


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