YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Label.hpp
Go to the documentation of this file.
1
#ifndef YAPOG_LABEL_HPP
2
# define YAPOG_LABEL_HPP
3
4
# include <SFML/Graphics/Color.hpp>
5
# include <SFML/Graphics/Text.hpp>
6
7
# include "
YAPOG/Graphics/Gui/BaseWidget.hpp
"
8
# include "
YAPOG/System/String.hpp
"
9
# include "
YAPOG/System/Event/Event.hpp
"
10
11
namespace
yap
12
{
13
class
YAPOG_LIB
Label
:
public
BaseWidget
14
{
15
DISALLOW_COPY
(
Label
);
16
17
public
:
18
19
struct
EventArgsString
20
{
21
EventArgsString
(
String
content)
22
{
23
newContent = content;
24
}
25
26
String
newContent
;
27
};
28
29
Label
();
30
Label
(
String
content);
31
32
virtual
~
Label
();
33
virtual
bool
IsFocusable ()
const
;
34
35
void
SetText (
const
String
& content);
36
void
SetTextSize (
uint
size);
37
String
GetText ()
const
;
38
Event<const Label&, const EventArgsString&>
OnTextChanged
;
39
float
GetCharWidth ()
const
;
40
uint
GetCharHeight ()
const
;
41
Vector2
CharPos (
uint
pos)
const
;
42
uint
Length ()
const
;
43
virtual
void
SetDefaultColor (
const
sf::Color& color);
44
virtual
void
SetBackground (
WidgetBackground
& background);
45
private
:
46
virtual
void
Refresh ();
47
virtual
Vector2
HandleGetSize ()
const
;
48
49
virtual
void
HandleMove (
const
Vector2
& offset);
50
virtual
void
HandleScale (
const
Vector2
& factor);
51
52
virtual
void
HandleDraw (
IDrawingContext
& context);
53
54
virtual
void
HandleShow (
bool
isVisible);
55
virtual
void
HandleChangeColor (
const
sf::Color& color);
56
57
virtual
void
HandleUpdate (
const
Time
& dt);
58
59
60
String
textContent_
;
61
sf::Text
drawableText_
;
62
bool
isPosSet_
;
63
64
static
const
String
DEFAULT_FONT
;
65
};
66
}
// namespace yap
67
68
#endif
/* YAPOG_LABEL_HPP! */
YAPOG
include
YAPOG
Graphics
Gui
Label.hpp
Generated on Mon Sep 17 2012 22:24:24 for YAPOG by
1.8.1.1