aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/lllineeditor.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llui/lllineeditor.h')
-rw-r--r--linden/indra/llui/lllineeditor.h40
1 files changed, 23 insertions, 17 deletions
diff --git a/linden/indra/llui/lllineeditor.h b/linden/indra/llui/lllineeditor.h
index ba3c697..bf0dcb5 100644
--- a/linden/indra/llui/lllineeditor.h
+++ b/linden/indra/llui/lllineeditor.h
@@ -78,19 +78,19 @@ public:
78 S32 border_thickness = 1); 78 S32 border_thickness = 1);
79 79
80 virtual ~LLLineEditor(); 80 virtual ~LLLineEditor();
81 virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_LINE_EDITOR; } 81
82 virtual LLString getWidgetTag() const { return LL_LINE_EDITOR_TAG; };
83 virtual LLXMLNodePtr getXML(bool save_children = true) const; 82 virtual LLXMLNodePtr getXML(bool save_children = true) const;
84 void setColorParameters(LLXMLNodePtr node); 83 void setColorParameters(LLXMLNodePtr node);
85 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); 84 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
85 static void cleanupClass();
86 86
87 // mousehandler overrides 87 // mousehandler overrides
88 /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); 88 /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
89 /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); 89 /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
90 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); 90 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
91 /*virtual*/ BOOL handleDoubleClick(S32 x,S32 y,MASK mask); 91 /*virtual*/ BOOL handleDoubleClick(S32 x,S32 y,MASK mask);
92 /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent ); 92 /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask );
93 /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent); 93 /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char);
94 /*virtual*/ void onMouseCaptureLost(); 94 /*virtual*/ void onMouseCaptureLost();
95 95
96 // LLEditMenuHandler overrides 96 // LLEditMenuHandler overrides
@@ -189,8 +189,8 @@ public:
189 189
190 void setKeystrokeCallback(void (*keystroke_callback)(LLLineEditor* caller, void* user_data)); 190 void setKeystrokeCallback(void (*keystroke_callback)(LLLineEditor* caller, void* user_data));
191 191
192 void setMaxTextLength(S32 max_text_length); 192 void setMaxTextLength(S32 max_text_length);
193 void setBorderWidth(S32 left, S32 right); 193 void setTextPadding(S32 left, S32 right); // Used to specify room for children before or after text.
194 194
195 static BOOL isPartOfWord(llwchar c); 195 static BOOL isPartOfWord(llwchar c);
196 // Prevalidation controls which keystrokes can affect the editor 196 // Prevalidation controls which keystrokes can affect the editor
@@ -212,7 +212,7 @@ public:
212 void updateHistory(); // stores current line in history 212 void updateHistory(); // stores current line in history
213 213
214private: 214private:
215 // private helper classes 215 // private helper methods
216 void removeChar(); 216 void removeChar();
217 void addChar(const llwchar c); 217 void addChar(const llwchar c);
218 void setCursorAtLocalPos(S32 local_mouse_x); 218 void setCursorAtLocalPos(S32 local_mouse_x);
@@ -254,10 +254,10 @@ protected:
254 S32 mCursorPos; // I-beam is just after the mCursorPos-th character. 254 S32 mCursorPos; // I-beam is just after the mCursorPos-th character.
255 S32 mScrollHPos; // Horizontal offset from the start of mText. Used for scrolling. 255 S32 mScrollHPos; // Horizontal offset from the start of mText. Used for scrolling.
256 LLFrameTimer mScrollTimer; 256 LLFrameTimer mScrollTimer;
257 S32 mTextPadLeft; // Used to reserve space before the beginning of the text for children.
258 S32 mTextPadRight; // Used to reserve space after the end of the text for children.
257 S32 mMinHPixels; 259 S32 mMinHPixels;
258 S32 mMaxHPixels; 260 S32 mMaxHPixels;
259 S32 mBorderLeft;
260 S32 mBorderRight;
261 261
262 BOOL mCommitOnFocusLost; 262 BOOL mCommitOnFocusLost;
263 BOOL mRevertOnEsc; 263 BOOL mRevertOnEsc;
@@ -302,6 +302,15 @@ protected:
302 std::vector<S32> mPreeditPositions; 302 std::vector<S32> mPreeditPositions;
303 LLPreeditor::standouts_t mPreeditStandouts; 303 LLPreeditor::standouts_t mPreeditStandouts;
304 304
305private:
306 // Utility on top of LLUI::getUIImage, looks up a named image in a given XML node and returns it if possible
307 // or returns a given default image if anything in the process fails.
308 static LLPointer<LLUIImage> parseImage(LLString name, LLXMLNodePtr from, LLPointer<LLUIImage> def);
309 // Global instance used as default for member instance below.
310 static LLPointer<LLUIImage> sImage;
311 // Instances that by default point to the statics but can be overidden in XML.
312 LLPointer<LLUIImage> mImage;
313
305 // private helper class 314 // private helper class
306 class LLLineEditorRollback 315 class LLLineEditorRollback
307 { 316 {
@@ -359,8 +368,6 @@ public:
359 368
360 /*virtual*/ void draw(); 369 /*virtual*/ void draw();
361 370
362 virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_SEARCH_EDITOR; }
363 virtual LLString getWidgetTag() const { return LL_SEARCH_EDITOR_TAG; }
364 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); 371 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
365 372
366 void setText(const LLStringExplicit &new_text) { mSearchEdit->setText(new_text); } 373 void setText(const LLStringExplicit &new_text) { mSearchEdit->setText(new_text); }
@@ -368,12 +375,11 @@ public:
368 void setSearchCallback(void (*search_callback)(const LLString& search_string, void* user_data), void* data) { mSearchCallback = search_callback; mCallbackUserData = data; } 375 void setSearchCallback(void (*search_callback)(const LLString& search_string, void* user_data), void* data) { mSearchCallback = search_callback; mCallbackUserData = data; }
369 376
370 // LLUICtrl interface 377 // LLUICtrl interface
371 virtual void setValue(const LLSD& value ) { mSearchEdit->setValue(value); } 378 virtual void setValue(const LLSD& value );
372 virtual LLSD getValue() const { return mSearchEdit->getValue(); } 379 virtual LLSD getValue() const;
373 virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ) { return mSearchEdit->setTextArg( key, text); } 380 virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text );
374 virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ) { return mSearchEdit->setLabelArg(key, text); } 381 virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text );
375 virtual void clear() { if (mSearchEdit) mSearchEdit->clear(); } 382 virtual void clear();
376
377 383
378private: 384private:
379 static void onSearchEdit(LLLineEditor* caller, void* user_data ); 385 static void onSearchEdit(LLLineEditor* caller, void* user_data );