Neo
0.5.0
Developer Documentation
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
MenuBar.h
Go to the documentation of this file.
1
/*
2
* Copyright 2014 (C) Yannick Pflanzer <neo-engine.de>
3
*
4
* This file is part of Neo2D.
5
*
6
* Neo2D is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU Lesser General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* Neo2D is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with Neo2D. If not, see <http://www.gnu.org/licenses/>.
18
*
19
* Diese Datei ist Teil von Neo2D.
20
*
21
* Neo2D ist Freie Software: Sie können es unter den Bedingungen
22
* der GNU Lesser General Public License, wie von der Free Software Foundation,
23
* Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
24
* veröffentlichten Version, weiterverbreiten und/oder modifizieren.
25
*
26
* Neo2D wird in der Hoffnung, dass es nützlich sein wird, aber
27
* OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
28
* Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
29
* Siehe die GNU Lesser General Public License für weitere Details.
30
*
31
* Sie sollten eine Kopie der GNU Lesser General Public License zusammen mit diesem
32
* Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
33
*/
34
35
#ifndef __MENUBAR_H__
36
#define __MENUBAR_H__
37
38
#include <string>
39
#include <vector>
40
#include <
NeoEngine.h
>
41
#include <
Widget.h
>
42
#include <
Button.h
>
43
#include <
Menu.h
>
44
45
namespace
Neo2D
46
{
47
namespace
Gui
48
{
49
50
static
int
MENU_LINE_HEIGHT
= 20;
51
52
using namespace
Neo
;
53
61
class
NEO2D_EXPORT
MenuBar
:
public
Widget
62
{
63
protected
:
64
65
int
m_selectedEntry
;
66
std::vector<Menu*>
m_entries
;
67
std::vector<Button>
m_buttons
;
68
69
static
void
buttonCallback(
Widget
* w,
long
int
data);
70
71
struct
CallbackData
72
{
73
unsigned
int
index
;
74
MenuBar
*
parent
;
75
};
76
77
public
:
78
MenuBar
(
unsigned
int
height)
79
:
Widget
(0, 0, 0, height,
""
)
80
{
81
}
82
83
~
MenuBar
();
84
85
Menu
*
getEntry
(
unsigned
int
idx) {
return
m_entries[idx]; }
86
DISOWN(
Menu
* l)
void
addEntry(
Menu
* l);
87
88
void
draw(
Vector2
offset);
89
void
update();
90
91
virtual
bool
isMouseOver();
92
};
93
}
94
}
95
#endif
NeoEngine.h
Neo2D::Gui::MenuBar
The MenuBar class implements the global menu bar on the top of the window.
Definition:
MenuBar.h:61
Button.h
Neo2D::Gui::Menu
The Menu class implements a basic drop-down menu.
Definition:
Menu.h:58
Neo2D::Gui::MenuBar::m_entries
std::vector< Menu * > m_entries
Definition:
MenuBar.h:66
Neo2D::Gui::MenuBar::m_buttons
std::vector< Button > m_buttons
Definition:
MenuBar.h:67
Neo2D::Gui::MenuBar::CallbackData
Definition:
MenuBar.h:71
Neo2D::Widget
The Widget class contains all information that is common to all GUI widgets.
Definition:
Widget.h:72
Neo2D::Gui::MenuBar::m_selectedEntry
int m_selectedEntry
Definition:
MenuBar.h:65
Neo::Vector2
Definition:
Vector2.h:31
Neo2D
Definition:
Button.h:42
Neo2D::Gui::MenuBar::CallbackData::parent
MenuBar * parent
Definition:
MenuBar.h:74
Widget.h
Neo2D::Gui::MENU_LINE_HEIGHT
static int MENU_LINE_HEIGHT
Definition:
MenuBar.h:50
Neo2D::Gui::MenuBar::MenuBar
MenuBar(unsigned int height)
Definition:
MenuBar.h:78
Neo2D::Gui::MenuBar::CallbackData::index
unsigned int index
Definition:
MenuBar.h:73
Neo2D::Gui::MenuBar::getEntry
Menu * getEntry(unsigned int idx)
Definition:
MenuBar.h:85
Menu.h
Neo
Definition:
Color.h:29
neoengine
SDK
Neo2D
include
MenuBar.h
Generated on Thu Oct 22 2015 18:55:57 for Neo by
1.8.9.1