Merge branch '138-toggle-free-look-with-hotkey' into main/gingo-test
[ryzomcore.git] / ryzom / client / src / interfaces_manager / radio_button.h
blobb4c57be423c648c7ff721a1470e3b1f93e0077d7
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
8 //
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_BUTTON_H
20 #define CL_RADIO_BUTTON_H
22 //Misc
23 #include "nel/misc/types_nl.h"
25 //Client
26 #include "button.h"
29 // forward declaration of the CRadioController class (see radio_controler.h)
30 class CRadioController;
32 /**
33 * <Class description>
34 * \author David Fleury
35 * \author Nevrax France
36 * \date 2001
38 class CRadioButton : public CButton
40 public:
42 /// default constructor
43 CRadioButton(uint id);
45 /// constructors
46 explicit CRadioButton(uint id, float x, float y, float x_pixel, float y_pixel, float w, float h, float w_pixel, float h_pixel, uint numFuncOn, uint numFuncR, uint numFuncD, const CButtonBase &buttonBase);
47 explicit CRadioButton(uint id, float x, float y, float x_pixel, float y_pixel, float w, float h, float w_pixel, float h_pixel, uint numFuncOn, uint numFuncR, uint numFuncD, CRGBA on, CRGBA off, CRGBA disable);
50 /// the click method, does nothing if linked to a radio controller, calls radioClick otherwise
51 virtual void click(float x, float y, bool &taken);
53 /**
54 * method called by the radio controller of the radio button,, do like the click method for regular buttons
55 * \param float x : the x position of the mouse
56 * \param float y : the y position of the mouse
57 * \param bool& taken : boolean indicating if the click has be taken by another control before or not
59 void radioClick(float x, float y, bool &taken);
61 /**
62 * select this radio button (call unselectAll on the radio controller before calling the CButton::select method)
64 virtual void select();
66 /**
67 * set the radio controller which controls this radio button
68 * \param pointer on the CRadioController
70 void setController(CRadioController *controller);
73 // attributes
74 private:
75 /// the radio controller of this radio button
76 CRadioController *_Controller;
80 #endif // CL_RADIO_BUTTON_H
82 /* End of radio_button.h */