YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Menu.hpp
Go to the documentation of this file.
1
#ifndef YAPOG_MENU_HPP
2
# define YAPOG_MENU_HPP
3
4
# include "
YAPOG/Graphics/Gui/BaseWidget.hpp
"
5
# include "
YAPOG/Collection/Array.hpp
"
6
# include "
YAPOG/Graphics/Gui/MenuItem.hpp
"
7
# include "
YAPOG/Graphics/Gui/LayoutBox.hpp
"
8
# include "
YAPOG/Graphics/Gui/Padding.hpp
"
9
# include "
YAPOG/Graphics/Gui/PartialLayoutManager.hpp
"
10
# include "
YAPOG/System/Event/Event.hpp
"
11
12
namespace
yap
13
{
14
class
YAPOG_LIB
Menu
:
public
BaseWidget
15
{
16
DISALLOW_COPY
(
Menu
);
17
18
public
:
19
Event<const Menu&, const EmptyEventArgs&>
OnDesactivated
;
20
21
enum class
Type
22
{
23
VERTICAL
,
24
HORIZONTAL
25
};
26
27
Menu
(
Type
type,
Padding
ext,
Padding
in,
bool
fixed);
28
void
AddChild (
MenuItem
& child,
LayoutBox::Align
align
29
= LayoutBox::Align::CENTER);
30
virtual
~
Menu
();
31
32
void
SetSelectedBackground (
WidgetBackground
& background);
33
void
SetSelectedBorder (
WidgetBorder
& border);
34
virtual
bool
IsFocusable ()
const
;
35
uint
GetCurrentSelect ()
const
;
36
void
SetFixed (
bool
state);
37
void
Clear ();
38
protected
:
39
virtual
void
HandleItemActivated ();
40
virtual
void
HandleItemSelected ();
41
42
virtual
Vector2
HandleGetSize ()
const
;
43
virtual
void
HandleMove (
const
Vector2
& offset);
44
virtual
void
HandleScale (
const
Vector2
& factor);
45
46
virtual
void
HandleDraw (
IDrawingContext
& context);
47
48
virtual
void
HandleShow (
bool
isVisible);
49
virtual
void
HandleChangeColor (
const
sf::Color& color);
50
51
virtual
void
HandleUpdate (
const
Time
& dt);
52
bool
HandleOnEvent (
const
GuiEvent
& guiEvent);
53
private
:
54
void
SetFormItem ();
55
void
SetUnformItem ();
56
57
collection::Array<MenuItem*>
itemz_
;
58
uint
currentSelec_
;
59
LayoutBox
*
layout_
;
60
61
WidgetBackground
*
selecBckgrd_
;
62
WidgetBorder
*
selecBrdr_
;
63
uint
selecBrdSize_
;
64
bool
isFixed_
;
65
Type
type_
;
66
PartialLayoutManager
*
layoutManager_
;
67
68
};
69
}
// namespace yap
70
71
#endif
/* YAPOG_MENU_HPP! */
YAPOG
include
YAPOG
Graphics
Gui
Menu.hpp
Generated on Mon Sep 17 2012 22:24:24 for YAPOG by
1.8.1.1