Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / client / src / interfaces_manager / brick_control.h
blobddcbb7fed03d0ab134240ea772603b6f59f31d25
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_BRICK_CONTROL_H
20 #define CL_BRICK_CONTROL_H
22 // Misc
23 #include "nel/misc/types_nl.h"
24 // Game_share
26 // Client
27 #include "control.h"
28 #include "bitmap_base.h"
29 #include "base_spell_client.h"
33 class CBrickControl;
36 /**
37 * <Class description>
38 * \author David Fleury
39 * \author Nevrax France
40 * \date 2001
42 class CBrickControl : public CControl
44 public:
46 /// default Constructor
47 CBrickControl(uint id = 0);
49 /// Constructor
50 CBrickControl(uint id, float x, float y, float x_pixel, float y_pixel, float w, float h, float w_pixel, float h_pixel, uint numFuncOn = 0, uint numFuncR = 0);
52 // copy constructor
53 // CBrickControl( const CBrickControl &b);
55 /// Destructor
56 ~CBrickControl()
59 /**
60 * get the brick associated to this control
61 * \return CBrickClient* the brick or NULL if no brick is associated with this control
63 inline CBrickClient *getAssociatedBrick() { return _AssociatedBrick; }
65 /**
66 * set the brick associated to this control
67 * \param CBrickClient* brick the brick associated to this control
69 inline void setAssociatedBrick(CBrickClient *brick)
71 //nlassert( brick) ;
72 if ( !brick )
74 nlwarning("<CBrickClient::setAssociatedBrick> : param in NULL");
75 return;
77 _AssociatedBrick = brick;
80 /// display the control
81 virtual void display();
83 /**
84 * set the color of the control
85 * \param CRGBA &color new color of the control
87 inline void rgba( const CRGBA &color) { _RGBA = color; }
89 /**
90 * get the color of the control
91 * \return CRGBA& color of the control
93 inline const CRGBA &rgba() const { return _RGBA; }
95 /// Manage the click for the control.
96 virtual void click(float x, float y, bool &taken);
98 /// Manage the right click for the control.
99 virtual void clickRight(float x, float y, bool &taken);
102 private:
104 * init the control
106 void init(uint numFuncOn = 0, uint numFuncR = 0);
108 private:
109 /// the brick associated to this control
110 CBrickClient *_AssociatedBrick;
112 // color applied on the texture of the brick, default = 255 255 255 255
113 CRGBA _RGBA;
115 /// function called with a left click on the control
116 uint _NumFuncOn;
117 /// function called with a right click on the control
118 uint _NumFuncR;
123 #endif // CL_BRICK_CONTROL_H
125 /* End of brick_control.h */