1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef CL_RADIO_CONTROLLER_H
20 #define CL_RADIO_CONTROLLER_H
22 #include "nel/misc/types_nl.h"
25 #include "radio_button.h"
32 * CRadioController : manage several CRadioButtons objects, ensuring only one is selected at a time
33 * \author Fleury David
34 * \author Nevrax France
37 class CRadioController
: public CControl
39 typedef vector
<CRadioButton
*> TVectButtons
;
40 /// the radio buttons controled by this radio controller
41 TVectButtons _Buttons
;
45 CRadioController(uint id
);
50 virtual void display() {}
52 /// Manage the click of the mouse for the control
53 virtual void click(float x
, float y
, bool &taken
);
56 virtual void resize(uint32 width
, uint32 height
) {}
58 virtual void ref(float x
, float y
, float width
, float height
) {}
60 /// Add a button to the group; Return true if the button have been inserted.
61 bool add(CRadioButton
*button
);
62 /// Select the button corresponding to the id.
64 /// Return the number of buttons.
65 uint
size() {return (uint
)_Buttons
.size();}
68 * unselect all the radio buttons
74 #endif // CL_RADIO_CONTROLLER_H
76 /* End of radio_button.h */