diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llui/lllineeditor.h | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/llui/lllineeditor.h')
-rw-r--r-- | linden/indra/llui/lllineeditor.h | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/linden/indra/llui/lllineeditor.h b/linden/indra/llui/lllineeditor.h index c96e34d..09a240b 100644 --- a/linden/indra/llui/lllineeditor.h +++ b/linden/indra/llui/lllineeditor.h | |||
@@ -63,9 +63,9 @@ class LLLineEditor | |||
63 | { | 63 | { |
64 | 64 | ||
65 | public: | 65 | public: |
66 | LLLineEditor(const LLString& name, | 66 | LLLineEditor(const std::string& name, |
67 | const LLRect& rect, | 67 | const LLRect& rect, |
68 | const LLString& default_text = LLString::null, | 68 | const std::string& default_text = LLStringUtil::null, |
69 | const LLFontGL* glfont = NULL, | 69 | const LLFontGL* glfont = NULL, |
70 | S32 max_length_bytes = 254, | 70 | S32 max_length_bytes = 254, |
71 | void (*commit_callback)(LLUICtrl* caller, void* user_data) = NULL, | 71 | void (*commit_callback)(LLUICtrl* caller, void* user_data) = NULL, |
@@ -132,14 +132,16 @@ public: | |||
132 | // assumes UTF8 text | 132 | // assumes UTF8 text |
133 | virtual void setValue(const LLSD& value ) { setText(value.asString()); } | 133 | virtual void setValue(const LLSD& value ) { setText(value.asString()); } |
134 | virtual LLSD getValue() const { return LLSD(getText()); } | 134 | virtual LLSD getValue() const { return LLSD(getText()); } |
135 | virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ); | 135 | virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); |
136 | virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); | 136 | virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); |
137 | 137 | ||
138 | void setLabel(const LLStringExplicit &new_label) { mLabel = new_label; } | 138 | void setLabel(const LLStringExplicit &new_label) { mLabel = new_label; } |
139 | void setText(const LLStringExplicit &new_text); | 139 | void setText(const LLStringExplicit &new_text); |
140 | 140 | ||
141 | const LLString& getText() const { return mText.getString(); } | 141 | const std::string& getText() const { return mText.getString(); } |
142 | const LLWString& getWText() const { return mText.getWString(); } | 142 | const LLWString& getWText() const { return mText.getWString(); } |
143 | LLWString getConvertedText() const; // trimmed text with paragraphs converted to newlines | ||
144 | |||
143 | S32 getLength() const { return mText.length(); } | 145 | S32 getLength() const { return mText.length(); } |
144 | 146 | ||
145 | S32 getCursor() const { return mCursorPos; } | 147 | S32 getCursor() const { return mCursorPos; } |
@@ -205,7 +207,7 @@ public: | |||
205 | static BOOL prevalidatePrintableNoSpace(const LLWString &str); | 207 | static BOOL prevalidatePrintableNoSpace(const LLWString &str); |
206 | static BOOL prevalidateASCII(const LLWString &str); | 208 | static BOOL prevalidateASCII(const LLWString &str); |
207 | 209 | ||
208 | static BOOL postvalidateFloat(const LLString &str); | 210 | static BOOL postvalidateFloat(const std::string &str); |
209 | 211 | ||
210 | // line history support: | 212 | // line history support: |
211 | void setEnableLineHistory( BOOL enabled ) { mHaveHistory = enabled; } // switches line history on or off | 213 | void setEnableLineHistory( BOOL enabled ) { mHaveHistory = enabled; } // switches line history on or off |
@@ -242,12 +244,12 @@ private: | |||
242 | 244 | ||
243 | protected: | 245 | protected: |
244 | LLUIString mText; // The string being edited. | 246 | LLUIString mText; // The string being edited. |
245 | LLString mPrevText; // Saved string for 'ESC' revert | 247 | std::string mPrevText; // Saved string for 'ESC' revert |
246 | LLUIString mLabel; // text label that is visible when no user text provided | 248 | LLUIString mLabel; // text label that is visible when no user text provided |
247 | 249 | ||
248 | // line history support: | 250 | // line history support: |
249 | BOOL mHaveHistory; // flag for enabled line history | 251 | BOOL mHaveHistory; // flag for enabled line history |
250 | std::vector<LLString> mLineHistory; // line history storage | 252 | std::vector<std::string> mLineHistory; // line history storage |
251 | U32 mCurrentHistoryLine; // currently browsed history line | 253 | U32 mCurrentHistoryLine; // currently browsed history line |
252 | 254 | ||
253 | LLViewBorder* mBorder; | 255 | LLViewBorder* mBorder; |
@@ -307,7 +309,7 @@ protected: | |||
307 | private: | 309 | private: |
308 | // Utility on top of LLUI::getUIImage, looks up a named image in a given XML node and returns it if possible | 310 | // Utility on top of LLUI::getUIImage, looks up a named image in a given XML node and returns it if possible |
309 | // or returns a given default image if anything in the process fails. | 311 | // or returns a given default image if anything in the process fails. |
310 | static LLPointer<LLUIImage> parseImage(LLString name, LLXMLNodePtr from, LLPointer<LLUIImage> def); | 312 | static LLPointer<LLUIImage> parseImage(std::string name, LLXMLNodePtr from, LLPointer<LLUIImage> def); |
311 | // Global instance used as default for member instance below. | 313 | // Global instance used as default for member instance below. |
312 | static LLPointer<LLUIImage> sImage; | 314 | static LLPointer<LLUIImage> sImage; |
313 | // Instances that by default point to the statics but can be overidden in XML. | 315 | // Instances that by default point to the statics but can be overidden in XML. |
@@ -341,10 +343,10 @@ private: | |||
341 | ed->mPrevText = mText; | 343 | ed->mPrevText = mText; |
342 | } | 344 | } |
343 | 345 | ||
344 | LLString getText() { return mText; } | 346 | std::string getText() { return mText; } |
345 | 347 | ||
346 | private: | 348 | private: |
347 | LLString mText; | 349 | std::string mText; |
348 | S32 mCursorPos; | 350 | S32 mCursorPos; |
349 | S32 mScrollHPos; | 351 | S32 mScrollHPos; |
350 | BOOL mIsSelecting; | 352 | BOOL mIsSelecting; |
@@ -362,10 +364,10 @@ private: | |||
362 | class LLSearchEditor : public LLUICtrl | 364 | class LLSearchEditor : public LLUICtrl |
363 | { | 365 | { |
364 | public: | 366 | public: |
365 | LLSearchEditor(const LLString& name, | 367 | LLSearchEditor(const std::string& name, |
366 | const LLRect& rect, | 368 | const LLRect& rect, |
367 | S32 max_length_bytes, | 369 | S32 max_length_bytes, |
368 | void (*search_callback)(const LLString& search_string, void* user_data), | 370 | void (*search_callback)(const std::string& search_string, void* user_data), |
369 | void* userdata); | 371 | void* userdata); |
370 | 372 | ||
371 | virtual ~LLSearchEditor() {} | 373 | virtual ~LLSearchEditor() {} |
@@ -376,13 +378,13 @@ public: | |||
376 | 378 | ||
377 | void setText(const LLStringExplicit &new_text) { mSearchEdit->setText(new_text); } | 379 | void setText(const LLStringExplicit &new_text) { mSearchEdit->setText(new_text); } |
378 | 380 | ||
379 | void setSearchCallback(void (*search_callback)(const LLString& search_string, void* user_data), void* data) { mSearchCallback = search_callback; mCallbackUserData = data; } | 381 | void setSearchCallback(void (*search_callback)(const std::string& search_string, void* user_data), void* data) { mSearchCallback = search_callback; mCallbackUserData = data; } |
380 | 382 | ||
381 | // LLUICtrl interface | 383 | // LLUICtrl interface |
382 | virtual void setValue(const LLSD& value ); | 384 | virtual void setValue(const LLSD& value ); |
383 | virtual LLSD getValue() const; | 385 | virtual LLSD getValue() const; |
384 | virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ); | 386 | virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); |
385 | virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); | 387 | virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); |
386 | virtual void clear(); | 388 | virtual void clear(); |
387 | 389 | ||
388 | private: | 390 | private: |
@@ -391,7 +393,7 @@ private: | |||
391 | 393 | ||
392 | LLLineEditor* mSearchEdit; | 394 | LLLineEditor* mSearchEdit; |
393 | class LLButton* mClearSearchButton; | 395 | class LLButton* mClearSearchButton; |
394 | void (*mSearchCallback)(const LLString& search_string, void* user_data); | 396 | void (*mSearchCallback)(const std::string& search_string, void* user_data); |
395 | 397 | ||
396 | }; | 398 | }; |
397 | 399 | ||