]> git.lizzy.rs Git - dragonfireclient.git/blob - src/gui/guiEditBoxWithScrollbar.h
Use "Aux1" key name consistently everywhere
[dragonfireclient.git] / src / gui / guiEditBoxWithScrollbar.h
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
4
5 #ifndef GUIEDITBOXWITHSCROLLBAR_HEADER
6 #define GUIEDITBOXWITHSCROLLBAR_HEADER
7
8 #include "guiEditBox.h"
9
10 class GUIEditBoxWithScrollBar : public GUIEditBox
11 {
12 public:
13
14         //! constructor
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);
18
19         //! destructor
20         virtual ~GUIEditBoxWithScrollBar() {}
21
22         //! Sets whether to draw the background
23         virtual void setDrawBackground(bool draw);
24
25         //! draws the element and its children
26         virtual void draw();
27
28         //! Updates the absolute position, splits text if required
29         virtual void updateAbsolutePosition();
30
31         //! Change the background color
32         virtual void setBackgroundColor(const video::SColor &bg_color);
33
34         //! Writes attributes of the element.
35         virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
36
37         //! Reads attributes of the element
38         virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
39
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;
46
47 protected:
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();
58
59         s32 getCursorPos(s32 x, s32 y);
60
61         bool m_background;
62
63         bool m_bg_color_used;
64         video::SColor m_bg_color;
65 };
66
67
68 #endif // GUIEDITBOXWITHSCROLLBAR_HEADER
69