aboutsummaryrefslogtreecommitdiff
path: root/src/intlGUIEditBox.h
diff options
context:
space:
mode:
authoradelcoding1 <mustapha.tachouct@actionware.net>2017-02-18 11:40:37 -0800
committerLoic Blot <loic.blot@unix-experience.fr>2017-10-09 08:11:00 +0200
commit9b8fa99fe30728c1fcfa73cdf74211841bdae9fb (patch)
tree30c9986d9fc814d37b89d5e20cdea9561c4aa5be /src/intlGUIEditBox.h
parentc830347a57c63698f14803233dfc43adeb3fd51f (diff)
downloadminetest-9b8fa99fe30728c1fcfa73cdf74211841bdae9fb.tar.gz
minetest-9b8fa99fe30728c1fcfa73cdf74211841bdae9fb.tar.bz2
minetest-9b8fa99fe30728c1fcfa73cdf74211841bdae9fb.zip
FormSpec : Add an auto vertical scrollbar to the textarea
Diffstat (limited to 'src/intlGUIEditBox.h')
-rw-r--r--src/intlGUIEditBox.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/intlGUIEditBox.h b/src/intlGUIEditBox.h
index 941d83c1c..aa35e2e71 100644
--- a/src/intlGUIEditBox.h
+++ b/src/intlGUIEditBox.h
@@ -10,6 +10,7 @@
#include "IGUIEditBox.h"
#include "irrArray.h"
#include "IOSOperator.h"
+#include "IGUIScrollBar.h"
namespace irr
{
@@ -21,7 +22,8 @@ namespace gui
//! constructor
intlGUIEditBox(const wchar_t* text, bool border, IGUIEnvironment* environment,
- IGUIElement* parent, s32 id, const core::rect<s32>& rectangle);
+ IGUIElement* parent, s32 id, const core::rect<s32>& rectangle,
+ bool writable = true, bool has_vscrollbar = false);
//! destructor
virtual ~intlGUIEditBox();
@@ -118,6 +120,9 @@ namespace gui
//! Updates the absolute position, splits text if required
virtual void updateAbsolutePosition();
+ //! set true if this EditBox is writable
+ virtual void setWritable(bool can_write_text);
+
//! Writes attributes of the element.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
@@ -144,6 +149,12 @@ namespace gui
bool processMouse(const SEvent& event);
s32 getCursorPos(s32 x, s32 y);
+ //! Create a vertical scrollbar
+ void createVScrollBar();
+
+ //! Update the vertical scrollbar (visibilty & scroll position)
+ void updateVScrollBar();
+
bool MouseMarking = false;
bool Border;
bool OverrideColorEnabled = false;
@@ -174,6 +185,10 @@ namespace gui
core::rect<s32> CurrentTextRect = core::rect<s32>(0,0,1,1);
core::rect<s32> FrameRect; // temporary values
+ u32 m_scrollbar_width;
+ IGUIScrollBar *m_vscrollbar;
+ bool m_writable;
+
};