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/>.
27 #include "nel/misc/types_nl.h"
28 #include "nel/misc/event_listener.h"
29 #include "nel/misc/ucstring.h"
38 using NLMISC::IEventListener
;
43 * Class to manage the keyboard capture.
44 * \author Guillaume PUZIN
45 * \author Nevrax France
48 class CCapture
: public CControl
, public CPen
, public IEventListener
51 /// Initialize the button (1 function called for all constructors -> easier).
52 inline void init(uint numFunc
);
54 virtual void operator () (const CEvent
& event
);
58 /// the max number of char on a line
60 /// the memorized line
62 /// the prompt (displayed at the beginning of the control, before the edited line)
64 /// the mode, if insert==true, the line is being edited
70 CCapture(uint id
, float x
, float y
, float x_pixel
, float y_pixel
, float w
, float h
, float w_pixel
, float h_pixel
, uint numFunc
, const CPen
&pen
);
71 CCapture(uint id
, float x
, float y
, float x_pixel
, float y_pixel
, float w
, float h
, float w_pixel
, float h_pixel
, uint numFunc
, uint32 fontSize
, CRGBA color
, bool shadow
);
76 /// Display the Bitmap.
77 virtual void display();
78 /// Manage the click of the mouse for the Bitmap.
79 virtual void click(float x
, float y
, bool &taken
);
82 /// set the string contained in the class : _Str.
83 void setStr(const ucstring
&str
)
88 /// Return the string contained in the class : _Str.
89 const ucstring
&getStr() const
94 void setPrompt(const ucstring
&str
)
99 const ucstring
&getPrompt() const { return _Prompt
; }
101 /// Set if the Control is in Insert mode.
102 inline void insert(bool i
) {_Insert
= i
;}
103 /// Return if the control is in insert mode.
104 inline bool insert() const {return _Insert
;}
108 #endif // CL_CAPTURE_H
110 /* End of capture.h */