YAPOG  0.0.1
Yet Another Pokemon Online Game
RegistrationWidget.cpp
Go to the documentation of this file.
5 
7 #include "Game.hpp"
8 
9 namespace ycl
10 {
12  : yap::BaseWidget ()
13  , registrationBox_ (
14  yap::Padding (5, 5, 5, 5)
15  , yap::Padding (5, 5, 5, 5)
16  , true)
17  , loginBox_ (
18  yap::Padding (5, 5, 5, 5)
19  , yap::Padding (5, 5, 5, 5)
20  , true)
21  , loginTextBox_ ()
22  , loginLabel_ ("Votre nom d'utilisateur: ")
23  , passwordBox_ (
24  yap::Padding (5, 5, 5, 5)
25  , yap::Padding (5, 5, 5, 5)
26  , true)
27  , passwordTextBox_ ()
28  , passwordLabel_ ("Votre mot de passe: ")
29  , emailBox_ (
30  yap::Padding (5, 5, 5, 5)
31  , yap::Padding (5, 5, 5, 5)
32  , true)
33  , emailTextBox_ ()
34  , emailLabel_ ("Votre Email: ")
35  , errorLabel_ ()
36  {
37  }
38 
40  {
41  yap::WidgetBackground* menuBck =
43  "WindowSkins/BasicSkin/Global/WindowBackgroundTexture.png", true);
44 
45  yap::Texture* ti = new yap::Texture ();
46  yap::Texture* tri = new yap::Texture ();
47  yap::Texture* ri = new yap::Texture ();
48  yap::Texture* bri = new yap::Texture ();
49  yap::Texture* bi = new yap::Texture ();
50  yap::Texture* bli = new yap::Texture ();
51  yap::Texture* li = new yap::Texture ();
52  li->LoadFromFile ("WindowSkins/BasicSkin/Global/Cursor.png");
53  yap::Texture* tli = new yap::Texture ();
54  yap::WidgetBorder* menuItemBrd =
55  new yap::WidgetBorder (*ti, *tri, *ri, *bri, *bi, *bli, *li, *tli, false);
56 
57  yap::Texture* t = new yap::Texture ();
58  t->LoadFromFile ("WindowSkins/BasicSkin/Global/TopBorder.png");
59  yap::Texture* tr = new yap::Texture ();
60  tr->LoadFromFile ("WindowSkins/BasicSkin/Global/TopRightCorner.png");
61  yap::Texture* r = new yap::Texture ();
62  r->LoadFromFile ("WindowSkins/BasicSkin/Global/RightBorder.png");
63  yap::Texture* br = new yap::Texture ();
64  br->LoadFromFile ("WindowSkins/BasicSkin/Global/BottomRightCorner.png");
65  yap::Texture* b = new yap::Texture ();
66  b->LoadFromFile ("WindowSkins/BasicSkin/Global/BottomBorder.png");
67  yap::Texture* bl = new yap::Texture ();
68  bl->LoadFromFile ("WindowSkins/BasicSkin/Global/BottomLeftCorner.png");
69  yap::Texture* l = new yap::Texture ();
70  l->LoadFromFile ("WindowSkins/BasicSkin/Global/LeftBorder.png");
71  yap::Texture* tl = new yap::Texture ();
72  tl->LoadFromFile ("WindowSkins/BasicSkin/Global/TopLeftCorner.png");
73 
74  yap::WidgetBorder* menuBorder =
75  new yap::WidgetBorder (*t, *tr, *r, *br, *b, *bl, *l, *tl, true);
76 
80 
81  errorLabel_.ChangeColor (sf::Color::Red);
82 
85 
88 
91 
92  registrationBox_.AddChild (loginBox_, yap::LayoutBox::Align::LEFT);
93  registrationBox_.AddChild (passwordBox_, yap::LayoutBox::Align::LEFT);
94  registrationBox_.AddChild (emailBox_, yap::LayoutBox::Align::LEFT);
95 
96  registrationBox_.AddChild (errorLabel_, yap::LayoutBox::Align::LEFT);
97 
99 
103  ));
104 
105  registrationBox_.SetBackground (*menuBck);
106  registrationBox_.SetBorder (*menuBorder);
107 
108  loginTextBox_.SetBorder (*new yap::WidgetBorder ("Test/Black.png"));
109  passwordTextBox_.SetBorder (*new yap::WidgetBorder ("Test/Green.png"));
110  emailTextBox_.SetBorder (*new yap::WidgetBorder ("Test/Red.png"));
111  menuBck->Move (yap::Vector2 (-20, -20));
112  menuBck->SetSize (registrationBox_.GetSize ());
113  menuBck->ChangeColor (sf::Color (255, 255, 255, 200));
114  loginTextBox_.Move (yap::Vector2 (10, 0));
116  emailTextBox_.Move (yap::Vector2 (140, 0));
117  }
118 
120  {
121  }
122 
125  { return loginTextBox_; }
126 
128  { return passwordTextBox_; }
129 
131  { return emailTextBox_; }
132 
135  {
136  errorLabel_.SetText (error);
137  }
138 
140  {
141  return false;
142  }
143 
145  {
146  }
147 
149  {
150  }
151 
153  {
154  }
155 
156  void RegistrationWidget::HandleShow (bool isVisible)
157  {
158  }
159 
160  void RegistrationWidget::HandleChangeColor (const sf::Color& color)
161  {
162  }
163 
165  {
166  }
167 
168 } // namespace ycl