1 // Copyright (C) 2002-2012 Nikolaus Gebhardt, Modified by Mustapha Tachouct
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
5 #ifndef GUIEDITBOXWITHSCROLLBAR_HEADER
6 #define GUIEDITBOXWITHSCROLLBAR_HEADER
8 #include "guiEditBox.h"
10 class GUIEditBoxWithScrollBar : public GUIEditBox
15 GUIEditBoxWithScrollBar(const wchar_t* text, bool border, IGUIEnvironment* environment,
16 IGUIElement* parent, s32 id, const core::rect<s32>& rectangle,
17 bool writable = true, bool has_vscrollbar = true);
20 virtual ~GUIEditBoxWithScrollBar() {}
22 //! Sets whether to draw the background
23 virtual void setDrawBackground(bool draw);
25 //! draws the element and its children
28 //! Updates the absolute position, splits text if required
29 virtual void updateAbsolutePosition();
31 //! Change the background color
32 virtual void setBackgroundColor(const video::SColor &bg_color);
34 //! Writes attributes of the element.
35 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
37 //! Reads attributes of the element
38 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
40 virtual bool isDrawBackgroundEnabled() const;
41 virtual bool isDrawBorderEnabled() const;
42 virtual void setCursorChar(const wchar_t cursorChar);
43 virtual wchar_t getCursorChar() const;
44 virtual void setCursorBlinkTime(irr::u32 timeMs);
45 virtual irr::u32 getCursorBlinkTime() const;
48 //! Breaks the single text line.
49 virtual void breakText();
50 //! sets the area of the given line
51 virtual void setTextRect(s32 line);
52 //! calculates the current scroll position
53 void calculateScrollPos();
54 //! calculated the FrameRect
55 void calculateFrameRect();
56 //! create a Vertical ScrollBar
57 void createVScrollBar();
59 s32 getCursorPos(s32 x, s32 y);
64 video::SColor m_bg_color;
68 #endif // GUIEDITBOXWITHSCROLLBAR_HEADER