1//************************************ bs::framework - Copyright 2018 Marko Pintera **************************************//
2//*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********//
3#pragma once
4
5#include "BsPrerequisites.h"
6
7namespace bs
8{
9 /** @addtogroup GUI
10 * @{
11 */
12
13 /** Object that allows you to group multiple GUI toggle buttons. Only one button among the grouped ones can be active. */
14 class BS_EXPORT GUIToggleGroup
15 {
16 public:
17 ~GUIToggleGroup();
18
19 public: // ***** INTERNAL ******
20 /** @name Internal
21 * @{
22 */
23
24 /** Registers a new toggle button with the group. */
25 void _add(GUIToggle* toggle);
26
27 /** Unregisters a toggle button from the group. */
28 void _remove(GUIToggle* toggle);
29
30 /** @} */
31 private:
32 friend class GUIToggle;
33
34 GUIToggleGroup(bool allowAllOff);
35
36 /** Initializes the toggle group. To be called right after construction. */
37 void initialize(const SPtr<GUIToggleGroup>& sharedPtr);
38
39 Vector<GUIToggle*> mButtons;
40 bool mAllowAllOff;
41 std::weak_ptr<GUIToggleGroup> mThis;
42 };
43
44 /** @} */
45}