diff options
Diffstat (limited to 'indra/llui/lllineeditor.h')
-rw-r--r-- | indra/llui/lllineeditor.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 76d0187712..a1aa6b71c6 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -59,11 +59,19 @@ public: typedef boost::function<void (LLLineEditor* caller)> keystroke_callback_t; + struct MaxLength : public LLInitParam::Choice<MaxLength> + { + Alternative<S32> bytes, chars; + + MaxLength() : bytes("max_length_bytes", 254), + chars("max_length_chars", 0) + {} + }; + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> { Optional<std::string> default_text; - Optional<S32> max_length_bytes; - + Optional<MaxLength> max_length; Optional<keystroke_callback_t> keystroke_callback; Optional<LLTextValidate::validate_func_t, LLTextValidate::ValidateTextNamedFuncs> prevalidate_callback; @@ -214,6 +222,7 @@ public: void setKeystrokeCallback(callback_t callback, void* user_data); void setMaxTextLength(S32 max_text_length); + void setMaxTextChars(S32 max_text_chars); // Manipulate left and right padding for text void getTextPadding(S32 *left, S32 *right); void setTextPadding(S32 left, S32 right); @@ -277,6 +286,7 @@ protected: LLViewBorder* mBorder; const LLFontGL* mGLFont; S32 mMaxLengthBytes; // Max length of the UTF8 string in bytes + S32 mMaxLengthChars; // Maximum number of characters in the string S32 mCursorPos; // I-beam is just after the mCursorPos-th character. S32 mScrollHPos; // Horizontal offset from the start of mText. Used for scrolling. LLFrameTimer mScrollTimer; |