YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
WidgetBorder.hpp
Go to the documentation of this file.
1
#ifndef YAPOG_WIDGET_BORDER_HPP
2
# define YAPOG_WIDGET_BORDER_HPP
3
4
# include "
YAPOG/Graphics/Gui/BaseWidget.hpp
"
5
# include "
YAPOG/Graphics/Texture.hpp
"
6
# include "
YAPOG/Graphics/Gui/TextureManager.hpp
"
7
# include "
YAPOG/System/IntTypes.hpp
"
8
# include "
YAPOG/Collection/Array.hpp
"
9
10
namespace
yap
11
{
12
class
YAPOG_LIB
WidgetBorder
:
public
BaseWidget
13
{
14
DISALLOW_COPY
(
WidgetBorder
);
15
16
public
:
17
18
struct
EventArgsTexture
19
{
20
Texture
&
newContent
;
21
EventArgsTexture
(
Texture
& content)
22
: newContent (content)
23
{
24
}
25
};
26
27
WidgetBorder
();
28
WidgetBorder
(
String
file);
29
WidgetBorder
(
Texture
& top,
30
Texture
& topRight,
31
Texture
& right,
32
Texture
& botRight,
33
Texture
& bot,
34
Texture
& botLeft,
35
Texture
& left,
36
Texture
& topLeft,
37
bool
isScalable);
38
39
virtual
~
WidgetBorder
();
40
41
virtual
bool
IsFocusable ()
const
;
42
Event<const WidgetBorder&, const EventArgsTexture&>
OnBorderSet
;
43
void
SetBorder (
Vector2
size,
uint
width);
44
void
SetBorder (
Vector2
size);
45
const
Texture
& GetTexture ()
const
;
46
void
SetScalable (
bool
state);
47
uint
GetWidth ()
const
;
48
49
private
:
50
uint
GetTextureWidth ()
const
;
51
virtual
Vector2
HandleGetSize ()
const
;
52
virtual
void
HandleMove (
const
Vector2
& offset);
53
virtual
void
HandleScale (
const
Vector2
& factor);
54
55
virtual
void
HandleDraw (
IDrawingContext
& context);
56
57
virtual
void
HandleShow (
bool
isVisible);
58
virtual
void
HandleChangeColor (
const
sf::Color& color);
59
60
virtual
void
HandleUpdate (
const
Time
& dt);
61
62
Texture
*
border_
;
63
String
file_
;
64
65
collection::Array<Texture*>
textures_
;
66
collection::Array<TextureManager*>
tms_
;
67
TextureManager
*
tmTop_
;
68
TextureManager
*
tmBottom_
;
69
TextureManager
*
tmLeft_
;
70
TextureManager
*
tmRight_
;
71
uint
width_
;
72
73
bool
isInit
;
74
bool
basic_
;
75
bool
isScalable_
;
76
77
};
78
}
// namespace yap
79
80
#endif
/* YAPOG_WIDGET_BORDER_HPP! */
YAPOG
include
YAPOG
Graphics
Gui
WidgetBorder.hpp
Generated on Mon Sep 17 2012 22:24:24 for YAPOG by
1.8.1.1