TGUI  v0.6.10
Checkbox.hpp
1 //
3 // TGUI - Texus's Graphical User Interface
4 // Copyright (C) 2012-2015 Bruno Van de Velde (vdv_b@tgui.eu)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24 
25 
26 #ifndef TGUI_CHECKBOX_HPP
27 #define TGUI_CHECKBOX_HPP
28 
29 
30 #include <TGUI/RadioButton.hpp>
31 
33 
34 namespace tgui
35 {
37 
38  class TGUI_API Checkbox : public RadioButton
39  {
40  public:
41 
43 
44 
49  Checkbox();
50 
51 
54  // Makes a copy of the widget by calling the copy constructor.
55  // This function calls new and if you use this function then you are responsible for calling delete.
57  virtual Checkbox* clone();
58 
59 
69  virtual bool load(const std::string& configFileFilename, const std::string& sectionName = "Checkbox");
70 
71 
76  void check();
77 
78 
83  void uncheck();
84 
85 
89  virtual void leftMouseReleased(float x, float y);
90 
94  virtual void keyPressed(const sf::Event::KeyEvent& event);
95 
96 
99  // This function is a (slow) way to set properties on the widget, no matter what type it is.
100  // When the requested property doesn't exist in the widget then the functions will return false.
102  virtual bool setProperty(std::string property, const std::string& value);
103 
104 
106  public:
107 
112  {
113  AllCheckboxCallbacks = RadioButtonCallbacksCount - 1,
114  CheckboxCallbacksCount = RadioButtonCallbacksCount
115  };
116 
117 
119  };
120 
122 
123 }
124 
126 
127 #endif // TGUI_CHECKBOX_HPP
Namespace that contains all TGUI functions and classes.
Definition: AnimatedPicture.hpp:33
Definition: RadioButton.hpp:38
CheckboxCallbacks
Defines specific triggers to Checkbox.
Definition: Checkbox.hpp:111
Definition: Checkbox.hpp:38
Definition: SharedWidgetPtr.hpp:44