Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / client / src / interfaces_manager / casting_bar.h
blobcb32e47f8c2144260dca857223301e3c9abfff80
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_CASTING_BAR_H
20 #define CL_CASTING_BAR_H
22 #include "nel/misc/types_nl.h"
23 #include "progress_bar.h"
27 /**
28 * class for casting bar : a progress bar but with auto modification of the position every 'x' 1/10s
29 * \author David Fleury
30 * \author Nevrax France
31 * \date 2002
33 class CCastingBar : public CProgressBar
35 public:
36 /// Constructor
37 CCastingBar(uint id, float x, float y, float x_pixel, float y_pixel, float w, float h, float w_pixel, float h_pixel, uint range)
38 :CProgressBar(id, x, y, x_pixel, y_pixel, w, h, w_pixel, h_pixel, range)
40 _Running = false;
41 _LastChangePosTime = ryzomGetLocalTime ();
42 _AutoHide = true;
45 /**
46 * start the control
48 inline void start()
50 _Running = true;
51 _LastChangePosTime = ryzomGetLocalTime ();
54 /**
55 * stop the control
57 inline void stop() { _Running = false; }
59 /// display the control
60 virtual void display();
62 /// set the auto hide mode (hide the control when the pos == 0
63 inline void autoHide( bool autoHide ) { _AutoHide = autoHide; }
65 private:
66 /// true : the control is active, false : the control is stopped (no modification of the bar)
67 bool _Running;
69 /// the time of the last modif of pos
70 mutable NLMISC::TTime _LastChangePosTime;
72 /// time
73 mutable NLMISC::TTime _Time;
75 /// auto hide mode
76 bool _AutoHide;
81 #endif // CL_CASTING_BAR_H
83 /* End of casting_bar.h */