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_BUTTON_H
20 #define CL_RADIO_BUTTON_H
23 #include "nel/misc/types_nl.h"
29 // forward declaration of the CRadioController class (see radio_controler.h)
30 class CRadioController
;
34 * \author David Fleury
35 * \author Nevrax France
38 class CRadioButton
: public CButton
42 /// default constructor
43 CRadioButton(uint id
);
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
);
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
);
62 * select this radio button (call unselectAll on the radio controller before calling the CButton::select method)
64 virtual void select();
67 * set the radio controller which controls this radio button
68 * \param pointer on the CRadioController
70 void setController(CRadioController
*controller
);
75 /// the radio controller of this radio button
76 CRadioController
*_Controller
;
80 #endif // CL_RADIO_BUTTON_H
82 /* End of radio_button.h */