My Project
 
Loading...
Searching...
No Matches
wndtabbed.h
Go to the documentation of this file.
1#pragma once
2
3#include "window.h"
4#include "button.h"
5#include "ninepatch.h"
6#include "bitmaptext.h"
7
8class WndTabbed :public Window{
9protected:
10 class Tab :public Button{
11 friend class WndTabbed;
12 public:
15 protected:
16 const int CUT = 5;
17
19
20 NinePatch* bg;
21
22 virtual void layout();
23
24 virtual void select(bool value);
25
26 virtual void onClick();
27 };
28public:
29 class LabeledTab :public Tab{
30 private:
31 BitmapText* btLabel;
32 public:
33 LabeledTab(WndTabbed* wnd, const std::string& label);
34 protected:
35 virtual void createChildren();
36 virtual void layout();
37 virtual void select(bool value);
38 };
39
40protected:
41 void onClick(Tab* tab);
42 int tabHeight() { return 25; }
43 Tab* add(Tab* tab);
44
45 std::vector<Tab*> tabs;
47public:
48 virtual void resize(int w, int h);
49
50 void select(Tab* tab);
51 void select(int index);
52
53 WndTabbed();
54};
55
56class Buff;
57class TextureFilm;
58
59class WndHero :public WndTabbed{
60private:
61 class StatsTab :public Group{
62 private:
63 static const String TXT_TITLE;
64 static const String TXT_CATALOGUS;
65 static const String TXT_JOURNAL;
66
67 static const int GAP = 5;
68
69 float pos;
70
71 void statSlot(const String& label, const String& value);
72 void statSlot(const String& label, int value);
73 public:
74 WndHero* wh;
75 StatsTab(WndHero* w);
76 float height() {
77 return pos;
78 }
79 };
80
81 class BuffsTab :public Group{
82 private:
83 static const int GAP = 2;
84
85 float pos;
86
87 void buffSlot(Buff* buff);
88 public:
89 WndHero* wh;
90 BuffsTab(WndHero* w);
91 float height() {
92 return pos;
93 }
94 };
95private:
96 static const String TXT_STATS;
97 static const String TXT_BUFFS;
98
99 static const String TXT_EXP;
100 static const String TXT_STR;
101 static const String TXT_HEALTH;
102 static const String TXT_GOLD;
103 static const String TXT_DEPTH;
104
105 static const int WIDTH = 100;
106 static const int TAB_WIDTH = 40;
107
108 StatsTab* stats;
109 BuffsTab* buffs;
110
111 SmartTexture* icons;
112 TextureFilm* film;
113
114
115};
116
117class ItemSprite;
118class ScrollPane;
119
121public:
122 class ListItem :public Component{
123 private:
124 Item* item;
125 boolean identified;
126
127 ItemSprite* sprite;
128 BitmapText* label;
129
130 public:
131 ListItem(const std::string& cl);
132 boolean onClick(float x, float y);
133 protected:
134 virtual void createChildren();
135 virtual void layout();
136 };
137private:
138 static const int WIDTH_P = 112;
139 static const int HEIGHT_P = 160;
140
141 static const int WIDTH_L = 128;
142 static const int HEIGHT_L = 128;
143
144 static const int ITEM_HEIGHT = 18;
145
146 static const int TAB_WIDTH = 50;
147
148 static const String TXT_POTIONS;
149 static const String TXT_SCROLLS;
150 static const String TXT_TITLE;
151
152 BitmapText* txtTitle;
153 ScrollPane* list;
154
155public:
156 static boolean showPotions;
157
158 void updateList();
159
161 WndCatalogus();
162};
Definition typedefine.h:59
Definition buff.h:10
Definition item.h:15
Definition itemsprite.h:8
Definition scrollpane.h:9
Window()
Definition window.cpp:47
int height
Definition window.h:17
ListItem(const std::string &cl)
Definition wndtabbed.cpp:444
boolean onClick(float x, float y)
Definition wndtabbed.cpp:460
virtual void createChildren()
Definition wndtabbed.cpp:471
virtual void layout()
Definition wndtabbed.cpp:480
void updateList()
Definition wndtabbed.cpp:315
WndCatalogus()
Definition wndtabbed.cpp:411
ArrayList< ListItem * > items
Definition wndtabbed.h:160
static boolean showPotions
Definition wndtabbed.h:156
Definition wndtabbed.h:59
virtual void layout()
Definition wndtabbed.cpp:70
LabeledTab(WndTabbed *wnd, const std::string &label)
Definition wndtabbed.cpp:56
virtual void createChildren()
Definition wndtabbed.cpp:64
virtual void select(bool value)
Definition wndtabbed.cpp:82
Definition wndtabbed.h:10
const int CUT
Definition wndtabbed.h:16
WndTabbed * wnd
Definition wndtabbed.h:13
virtual void onClick()
Definition wndtabbed.cpp:50
friend class WndTabbed
Definition wndtabbed.h:11
NinePatch * bg
Definition wndtabbed.h:20
Tab(WndTabbed *wnd)
Definition wndtabbed.cpp:16
bool selected
Definition wndtabbed.h:18
virtual void layout()
Definition wndtabbed.cpp:23
virtual void select(bool value)
Definition wndtabbed.cpp:35
virtual void resize(int w, int h)
Definition wndtabbed.cpp:93
void select(Tab *tab)
Definition wndtabbed.cpp:126
int tabHeight()
Definition wndtabbed.h:42
void onClick(Tab *tab)
Definition wndtabbed.cpp:88
Tab * selected
Definition wndtabbed.h:46
Tab * add(Tab *tab)
Definition wndtabbed.cpp:151
WndTabbed()
Definition wndtabbed.cpp:165
std::vector< Tab * > tabs
Definition wndtabbed.h:45
std::string String
Definition typedefine.h:8