@@ -38,7 +38,7 @@ namespace GUI {
3838 public:
3939 TextureTemplate (const Window& window);
4040 void blit () const override ;
41- bool in (const Mouse mouse) const ;
41+ virtual bool in (const Mouse mouse) const ;
4242 };
4343
4444
@@ -114,14 +114,25 @@ namespace GUI {
114114 };
115115
116116
117- // Class of backplate for better understability
118- class Backplate : public TextureTemplate {
117+ // Class of rounded backplate for better understability
118+ class RoundedBackplate : public TextureTemplate {
119119 public:
120- Backplate (const Window& window, float centerX, float centerY, float width, float height,
120+ RoundedBackplate (const Window& window, float centerX, float centerY, float width, float height,
121121 float radius, float border, Color frontColor = GREY, Color backColor = BLACK);
122- Backplate (const Window& window, const SDL_FRect& rect, float radius, float border,
122+ RoundedBackplate (const Window& window, const SDL_FRect& rect, float radius, float border,
123123 Color frontColor = GREY, Color backColor = BLACK);
124- ~Backplate ();
124+ ~RoundedBackplate ();
125+ };
126+
127+
128+ // Class with rectangular backplate for typeBox
129+ class RectBackplate : public TextureTemplate {
130+ public:
131+ RectBackplate (const Window& window, float centerX, float centerY, float width, float height,
132+ float border, Color frontColor = GREY, Color backColor = BLACK);
133+ RectBackplate (const Window& window, const SDL_FRect& rect,
134+ float border, Color frontColor = GREY, Color backColor = BLACK);
135+ ~RectBackplate ();
125136 };
126137
127138
@@ -181,30 +192,27 @@ namespace GUI {
181192 const char * getString (); // Function of getting typed string
182193 void setString (const char * string); // Function for replace text with new string
183194 void blit () const override ; // Function for draw at screen
184- bool in (const Mouse mouse) const ; // Function of checking pressing
185195 };
186196
187197
188198 // Object for typying in text with backplate for visability
189199 template <unsigned bufferSize = 16 >
190200 class TypeBox : public TypeField <bufferSize> {
191201 private:
192- // Backplate part
193- SDL_Texture* backTexture; // Texture of backplate
194- const SDL_FRect backRect; // Rect of backplate
202+ RectBackplate backplate;
195203
196204 public:
197205 TypeBox (const Window& window, float posX, float posY, float height, const char *startText = " " ,
198206 Aligment aligment = Aligment::Midle, unsigned frameWidth = 2 , Color textColor = BLACK);
199- ~TypeBox ();
200207 void blit () const override ; // Function for draw inputting text with backplate
208+ bool in (const Mouse mouse) const override ;
201209 };
202210
203211
204212 // Class of buttons with text on it
205213 class TextButton : public HighlightedStaticText {
206214 private:
207- const Backplate backplate;
215+ const RoundedBackplate backplate;
208216
209217 public:
210218 TextButton (const Window& window, float X, float Y, const LanguagedText texts, float size,
0 commit comments