-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathController.h
61 lines (46 loc) · 1.62 KB
/
Controller.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef __GCONTROLLER_H__
#define __GCONTROLLER_H__
#include "FairyGUIMacros.h"
#include "cocos2d.h"
#include "event/UIEventDispatcher.h"
NS_FGUI_BEGIN
class GComponent;
class ControllerAction;
class ByteBuffer;
class GController : public UIEventDispatcher
{
public:
GController();
virtual ~GController();
GComponent* getParent() const { return _parent; }
void setParent(GComponent* value) { _parent = value; }
int getSelectedIndex() const { return _selectedIndex; }
void setSelectedIndex(int value, bool triggerEvent = true);
const std::string& getSelectedPage() const;
void setSelectedPage(const std::string& value, bool triggerEvent = true);
const std::string& getSelectedPageId() const;
void setSelectedPageId(const std::string& value, bool triggerEvent = true);
int getPrevisousIndex() const { return _previousIndex; }
const std::string& getPreviousPage() const;
const std::string& getPreviousPageId() const;
int getPageCount() const;
bool hasPage(const std::string& aName) const;
int getPageIndexById(const std::string& value) const;
const std::string& getPageNameById(const std::string& value) const;
const std::string& getPageId(int index) const;
void setOppositePageId(const std::string& value);
void runActions();
void setup(ByteBuffer* buffer);
std::string name;
bool changing;
bool autoRadioGroupDepth;
private:
GComponent* _parent;
int _selectedIndex;
int _previousIndex;
std::vector<std::string> _pageIds;
std::vector<std::string> _pageNames;
std::vector<ControllerAction*> _actions;
};
NS_FGUI_END
#endif