1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-25 05:35:25 +02:00

FormSpec : Add an auto vertical scrollbar to the textarea

This commit is contained in:
adelcoding1
2017-02-18 11:40:37 -08:00
committed by Loic Blot
parent c830347a57
commit 9b8fa99fe3
8 changed files with 1856 additions and 34 deletions

View File

@@ -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;
};