Improve input box text handling
Change-Id: I79cfaac1adf85d1ee5514bf5266930823c1a15ff
diff --git a/gui/objects.hpp b/gui/objects.hpp
index 6c6fa5e..7913b36 100644
--- a/gui/objects.hpp
+++ b/gui/objects.hpp
@@ -192,8 +192,7 @@
// Set maximum width in pixels
virtual int SetMaxWidth(unsigned width);
- // Set number of characters to skip (for scrolling)
- virtual int SkipCharCount(unsigned skip);
+ void SetText(string newtext);
public:
bool isHighlighted;
@@ -209,7 +208,6 @@
int mIsStatic;
int mVarChanged;
int mFontHeight;
- unsigned charSkip;
};
// GUIImage - Used for static image
@@ -1001,7 +999,10 @@
virtual int GetSelection(int x, int y);
// Handles displaying the text properly when chars are added, deleted, or for scrolling
- virtual int HandleTextLocation(int x);
+ void HandleTextLocation(int x);
+ void UpdateTextWidth();
+ void HandleCursorByTouch(int x);
+ void HandleCursorByText();
protected:
GUIText* mInputText;
@@ -1013,15 +1014,16 @@
std::string mLastValue;
std::string mVariable;
std::string mMask;
- std::string mMaskVariable;
+ std::string displayValue;
COLOR mBackgroundColor;
COLOR mCursorColor;
int scrollingX;
+ int cursorX;
int lastX;
int mCursorLocation;
int mBackgroundX, mBackgroundY, mBackgroundW, mBackgroundH;
int mFontY;
- unsigned skipChars;
+ int textWidth;
unsigned mFontHeight;
unsigned CursorWidth;
bool mRendered;