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

#include <BaseWidget.hpp>

Inheritance diagram for yap::BaseWidget:
Collaboration diagram for yap::BaseWidget:

List of all members.

Classes

struct  EventArgs
struct  EventArgsColor
struct  EventArgsDraw
struct  EventArgsIWidget

Public Member Functions

 BaseWidget ()
virtual ~BaseWidget ()
virtual void AddDrawable (IDrawable &drawable)
virtual void AddChild (IWidget &child)
virtual void FrontAddChild (IWidget &child)
virtual void RemoveChild (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 ()
virtual bool IsFocusable () const =0
Vector2 GetUserSize () const
virtual void SetToTop ()
virtual void SetEnable (bool enable)
virtual void Open ()
virtual void Close ()
ISpatial members.
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)
IDrawable members.
virtual void Draw (IDrawingContext &context)
virtual bool IsVisible () const
virtual void Show (bool isVisible)
virtual void ChangeColor (const sf::Color &color)
IEventHandler members.
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.
IUpdateable members.
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 ()

Public Attributes

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

Protected Member Functions

void RefreshBorder ()
virtual void SetFocused (bool state)
virtual void Refresh ()
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)
virtual bool HandleOnEvent (const GuiEvent &guiEvent)
virtual bool HandleOnPriorityEvent (const GuiEvent &guiEvent)

Protected Attributes

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_

Static Protected Attributes

static const bool DEFAULT_VISIBLE_STATE = true
static const bool DEFAULT_ENABLED_STATE = true
static const sf::Color DEFAULT_COLOR = sf::Color::Black

Private Member Functions

 DISALLOW_COPY (BaseWidget)
void SetPosAfterBorder (uint width, uint height, bool refreshing)

Detailed Description

Definition at line 18 of file BaseWidget.hpp.


Constructor & Destructor Documentation

yap::BaseWidget::BaseWidget ( )

Definition at line 14 of file BaseWidget.cpp.

yap::BaseWidget::~BaseWidget ( )
virtual

Definition at line 35 of file BaseWidget.cpp.


Member Function Documentation

void yap::BaseWidget::AddChild ( IWidget child)
virtual

Implements yap::IWidget.

Definition at line 296 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::AddDrawable ( IDrawable drawable)
virtual

Implements yap::IWidget.

Definition at line 291 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::ChangeColor ( const sf::Color &  color)
virtual

Implements yap::IDrawable.

Definition at line 207 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::Close ( )
virtual

Implements yap::IWidget.

Definition at line 456 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

yap::BaseWidget::DISALLOW_COPY ( BaseWidget  )
private
void yap::BaseWidget::Draw ( IDrawingContext context)
virtual

Implements yap::IDrawable.

Definition at line 155 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::FrontAddChild ( IWidget child)
virtual

Implements yap::IWidget.

Definition at line 309 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

WidgetBorder * yap::BaseWidget::GetBorder ( ) const
virtual

Implements yap::IWidget.

Definition at line 39 of file BaseWidget.cpp.

const Vector2 & yap::BaseWidget::GetBottomRight ( ) const
virtual

Implements yap::ISpatial.

Definition at line 60 of file BaseWidget.cpp.

Here is the call graph for this function:

const Vector2 & yap::BaseWidget::GetCenter ( ) const
virtual

Implements yap::ISpatial.

Definition at line 65 of file BaseWidget.cpp.

Here is the call graph for this function:

const Vector2 & yap::BaseWidget::GetPosition ( ) const
virtual

Gets the coordinates in pixels of the origin of this ISpatial from the global origin.

Returns:
The coordinates in pixels of the origin of this ISpatial from the global origin.

Implements yap::ISpatial.

Definition at line 43 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

const sf::FloatRect & yap::BaseWidget::GetRectangle ( ) const
virtual

Implements yap::ISpatial.

Definition at line 70 of file BaseWidget.cpp.

Here is the call graph for this function:

IWidget & yap::BaseWidget::GetRoot ( ) const
virtual

Implements yap::IWidget.

Definition at line 331 of file BaseWidget.cpp.

const Vector2 & yap::BaseWidget::GetSize ( ) const
virtual

Gets the size in pixels of this ISpatial.

Returns:
The size in pixels of this ISpatial.

Implements yap::ISpatial.

Definition at line 48 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

const Vector2 & yap::BaseWidget::GetTopLeft ( ) const
virtual

Implements yap::ISpatial.

Definition at line 55 of file BaseWidget.cpp.

Here is the call graph for this function:

Vector2 yap::BaseWidget::GetUserSize ( ) const

Definition at line 173 of file BaseWidget.cpp.

Here is the caller graph for this function:

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

Reimplemented in yap::WidgetBorder, yap::Label, yap::LayoutBox, ycl::ChatWidget, ycl::PokemonTeamWidget, yap::Menu, yap::WidgetBackground, ycl::BattleInfoWidget, yap::GridMenu, yap::DialogBoxWidget, yap::MultiLabelWidget, ycl::PokedexWidget, ycl::TrainerCardWidget, yap::TextBoxWidget, yap::MenuItem, yap::PictureBox, and ycl::PokedexCompositeWidget.

Definition at line 286 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool yap::BaseWidget::HandleOnEvent ( const GuiEvent guiEvent)
protectedvirtual

Reimplemented in ycl::PokemonTeamWidget, yap::Menu, ycl::ChatWidget, yap::GridMenu, ycl::PokedexWidget, ycl::TrainerCardWidget, ycl::PokemonInfoWidget, yap::DialogBoxWidget, yap::MultiLabelWidget, yap::TextBoxWidget, ycl::GameGuiManager, ycl::GameMenu, and ycl::OpponentBattleInfoWidget.

Definition at line 435 of file BaseWidget.cpp.

Here is the caller graph for this function:

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

Reimplemented in yap::LayoutBox, ycl::ChatWidget, and yap::GuiManager.

Definition at line 440 of file BaseWidget.cpp.

Here is the caller graph for this function:

bool yap::BaseWidget::IsVisible ( ) const
virtual

Implements yap::IDrawable.

Definition at line 189 of file BaseWidget.cpp.

Here is the caller graph for this function:

void yap::BaseWidget::Move ( const Vector2 offset)
virtual

Implements yap::ISpatial.

Definition at line 75 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool yap::BaseWidget::OnEvent ( const GuiEvent guiEvent)
virtual

Treats an event. Transferts the event before treating it.

Parameters:
guiEventThe event to treat.
Returns:
True if the handler is concerned by the events and treated it, else false.

Implements yap::IEventHandler.

Definition at line 224 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool yap::BaseWidget::OnPriorityEvent ( const GuiEvent guiEvent)
virtual

Treats an event. Treats the event before transfering it.

Parameters:
guiEventThe event to treat.
Returns:
True if the handler is concerned by the events and treated it, else false.

Implements yap::IEventHandler.

Definition at line 244 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::Open ( )
virtual

Implements yap::IWidget.

Reimplemented in ycl::TrainerCardWidget.

Definition at line 450 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::Refresh ( )
protectedvirtual

Implements yap::IWidget.

Reimplemented in yap::Label, yap::LayoutBox, yap::DialogBoxWidget, yap::MultiLabelWidget, yap::TextBoxWidget, and yap::MenuItem.

Definition at line 348 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::RefreshBorder ( )
protected

Definition at line 401 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Implements yap::IWidget.

Reimplemented in yap::LayoutBox.

Definition at line 323 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::Scale ( const Vector2 factor)
virtual

Implements yap::ISpatial.

Definition at line 93 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::SetBackground ( WidgetBackground background)
virtual

Implements yap::IWidget.

Reimplemented in yap::Label.

Definition at line 354 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::SetBorder ( WidgetBorder border,
uint  width 
)
virtual

Implements yap::IWidget.

Definition at line 384 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::SetBorder ( WidgetBorder border)
virtual

Definition at line 418 of file BaseWidget.cpp.

Here is the call graph for this function:

void yap::BaseWidget::SetDefaultColor ( const sf::Color &  color)
virtual

Implements yap::IWidget.

Reimplemented in yap::Label.

Definition at line 267 of file BaseWidget.cpp.

Here is the caller graph for this function:

void yap::BaseWidget::SetEnable ( bool  enable)
virtual

Implements yap::IWidget.

Definition at line 445 of file BaseWidget.cpp.

Here is the caller graph for this function:

void yap::BaseWidget::SetFocused ( bool  state)
protectedvirtual

Implements yap::IWidget.

Definition at line 194 of file BaseWidget.cpp.

void yap::BaseWidget::SetPadding ( const Padding padding)
virtual

Implements yap::IWidget.

Definition at line 342 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::SetParent ( IWidget parent)
virtual

Implements yap::IWidget.

Definition at line 336 of file BaseWidget.cpp.

Here is the call graph for this function:

void yap::BaseWidget::SetPosAfterBorder ( uint  width,
uint  height,
bool  refreshing 
)
private

Definition at line 364 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::SetPosition ( const Vector2 position)
virtual

Implements yap::ISpatial.

Definition at line 115 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::SetSize ( const Vector2 size)
virtual

Implements yap::ISpatial.

Definition at line 129 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::SetToTop ( )
virtual

Implements yap::IWidget.

Definition at line 178 of file BaseWidget.cpp.

Here is the call graph for this function:

void yap::BaseWidget::Show ( bool  isVisible)
virtual

Implements yap::IDrawable.

Definition at line 200 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::BaseWidget::UnsetBackground ( )
virtual

Definition at line 120 of file BaseWidget.cpp.

Here is the caller graph for this function:

void yap::BaseWidget::UnsetBorder ( )
virtual

Definition at line 124 of file BaseWidget.cpp.

Here is the caller graph for this function:

void yap::BaseWidget::Update ( const Time dt)
virtual

Makes the object evolve for one frame of the game.

Parameters:
dtDelta time since the last frame.

Implements yap::IUpdateable.

Definition at line 272 of file BaseWidget.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

WidgetBackground* yap::BaseWidget::background_
protected

Reimplemented in yap::WidgetBackground, and ycl::PokedexCompositeWidget.

Definition at line 165 of file BaseWidget.hpp.

WidgetBorder* yap::BaseWidget::border_
protected

Reimplemented in yap::WidgetBorder.

Definition at line 166 of file BaseWidget.hpp.

collection::List<IWidget*> yap::BaseWidget::childen_
protected

Definition at line 160 of file BaseWidget.hpp.

sf::Color yap::BaseWidget::color_
protected

Definition at line 157 of file BaseWidget.hpp.

const sf::Color yap::BaseWidget::DEFAULT_COLOR = sf::Color::Black
staticprotected

Definition at line 152 of file BaseWidget.hpp.

const bool yap::BaseWidget::DEFAULT_ENABLED_STATE = true
staticprotected

Definition at line 150 of file BaseWidget.hpp.

const bool yap::BaseWidget::DEFAULT_VISIBLE_STATE = true
staticprotected

Definition at line 149 of file BaseWidget.hpp.

collection::List<IDrawable*> yap::BaseWidget::drawables_
protected

Definition at line 158 of file BaseWidget.hpp.

collection::List<IEventHandler*> yap::BaseWidget::eventHandlers_
protected

Definition at line 159 of file BaseWidget.hpp.

bool yap::BaseWidget::isChangeColorCall_
protected

Definition at line 171 of file BaseWidget.hpp.

bool yap::BaseWidget::isEnabled_
protected

Definition at line 156 of file BaseWidget.hpp.

bool yap::BaseWidget::isExtensible_
protected

Definition at line 168 of file BaseWidget.hpp.

bool yap::BaseWidget::isFocused_
protected

Definition at line 169 of file BaseWidget.hpp.

bool yap::BaseWidget::isVisible_
protected

Definition at line 155 of file BaseWidget.hpp.

Event<const BaseWidget&, const EventArgsIWidget&> yap::BaseWidget::OnChildAdded

Definition at line 66 of file BaseWidget.hpp.

Event<const BaseWidget&, const EventArgsColor&> yap::BaseWidget::OnColorChanged

Definition at line 65 of file BaseWidget.hpp.

Event<const BaseWidget&, const EventArgsDraw&> yap::BaseWidget::OnDraw

Definition at line 64 of file BaseWidget.hpp.

Event<const BaseWidget&, const EventArgs&> yap::BaseWidget::OnMoved

Definition at line 61 of file BaseWidget.hpp.

Event<const BaseWidget&, const EventArgs&> yap::BaseWidget::OnScaled

Definition at line 62 of file BaseWidget.hpp.

Event<const BaseWidget&, const EventArgs&> yap::BaseWidget::OnSizeSet

Definition at line 63 of file BaseWidget.hpp.

Padding yap::BaseWidget::padding_
protected

Definition at line 164 of file BaseWidget.hpp.

IWidget* yap::BaseWidget::parent_
protected

Definition at line 163 of file BaseWidget.hpp.

IWidget* yap::BaseWidget::root_
protected

Definition at line 162 of file BaseWidget.hpp.

SpatialInfo yap::BaseWidget::spatialInfo_
mutableprotected

Definition at line 154 of file BaseWidget.hpp.

collection::List<IUpdateable*> yap::BaseWidget::updatables_
protected

Definition at line 161 of file BaseWidget.hpp.

sf::Color yap::BaseWidget::userColor_
protected

Definition at line 170 of file BaseWidget.hpp.

Vector2 yap::BaseWidget::userSize_
protected

Definition at line 167 of file BaseWidget.hpp.


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