libAlgAudio  v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UISpinEntry.hpp
Go to the documentation of this file.
1 #ifndef UISPINENTRY_HPP
2 #define UISPINENTRY_HPP
3 /*
4 This file is part of AlgAudio.
5 
6 AlgAudio, Copyright (C) 2015 CeTA - Audiovisual Technology Center
7 
8 AlgAudio is free software: you can redistribute it and/or modify
9 it under the terms of the GNU Lesser General Public License as
10 published by the Free Software Foundation, either version 3 of the
11 License, or (at your option) any later version.
12 
13 AlgAudio is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU Lesser General Public License for more details.
17 
18 You should have received a copy of the GNU Lesser General Public License
19 along with AlgAudio. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #include "UI/UIBox.hpp"
23 
24 namespace AlgAudio{
25 
26 class UIButton;
27 class UITextEntry;
28 class UISeparator;
29 class UILabel;
30 
31 class UISpinEntry : public UIHBox{
32 public:
33  static std::shared_ptr<UISpinEntry> Create(std::weak_ptr<Window> parent_window, std::string name = "", int value = 0, int start = 0, int end = 10);
35  void SetValue(int v);
36  int GetValue() const;
39  void SetRange(int start, int end);
40 private:
41  UISpinEntry(std::weak_ptr<Window>);
42  void Init(std::string name = "", int value = 0);
43 
44  int range_min = 0;
45  int range_max = 10;
46 
48  void FinalizeEdit();
49 
50  int value = 0; // The stored number
51 
52  std::shared_ptr<UISeparator> child_sep;
53  std::shared_ptr<UILabel> child_label;
54  std::shared_ptr<UITextEntry> child_entry;
55  std::shared_ptr<UIVBox> child_box_buttons;
56  std::shared_ptr<UIButton> child_button_up;
57  std::shared_ptr<UIButton> child_button_down;
58 };
59 
60 } // namespace AlgAudio
61 
62 #endif // UISPINENTRY_HPP
Definition: UIBox.hpp:92
Signal on_changed
Definition: UISpinEntry.hpp:34
int GetValue() const
Definition: Alertable.hpp:26
void SetRange(int start, int end)
Definition: UISpinEntry.hpp:31
Definition: Signal.hpp:145
static std::shared_ptr< UISpinEntry > Create(std::weak_ptr< Window > parent_window, std::string name="", int value=0, int start=0, int end=10)
void SetValue(int v)