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/llscrolllistctrl.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/llscrolllistctrl.h')
-rw-r--r-- | linden/indra/llui/llscrolllistctrl.h | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/linden/indra/llui/llscrolllistctrl.h b/linden/indra/llui/llscrolllistctrl.h index 667a89a..6f26c8d 100644 --- a/linden/indra/llui/llscrolllistctrl.h +++ b/linden/indra/llui/llscrolllistctrl.h | |||
@@ -65,7 +65,7 @@ public: | |||
65 | virtual S32 getWidth() const {return mWidth;} | 65 | virtual S32 getWidth() const {return mWidth;} |
66 | virtual S32 getContentWidth() const { return 0; } | 66 | virtual S32 getContentWidth() const { return 0; } |
67 | virtual S32 getHeight() const = 0; | 67 | virtual S32 getHeight() const = 0; |
68 | virtual const LLSD getValue() const { return LLString::null; } | 68 | virtual const LLSD getValue() const { return LLStringUtil::null; } |
69 | virtual void setValue(const LLSD& value) { } | 69 | virtual void setValue(const LLSD& value) { } |
70 | virtual BOOL getVisible() const { return TRUE; } | 70 | virtual BOOL getVisible() const { return TRUE; } |
71 | virtual void setWidth(S32 width) { mWidth = width; } | 71 | virtual void setWidth(S32 width) { mWidth = width; } |
@@ -100,7 +100,7 @@ public: | |||
100 | class LLScrollListText : public LLScrollListCell | 100 | class LLScrollListText : public LLScrollListCell |
101 | { | 101 | { |
102 | public: | 102 | public: |
103 | LLScrollListText( const LLString& text, const LLFontGL* font, S32 width = 0, U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, LLColor4& color = LLColor4::black, BOOL use_color = FALSE, BOOL visible = TRUE); | 103 | LLScrollListText( const std::string& text, const LLFontGL* font, S32 width = 0, U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, LLColor4& color = LLColor4::black, BOOL use_color = FALSE, BOOL visible = TRUE); |
104 | /*virtual*/ ~LLScrollListText(); | 104 | /*virtual*/ ~LLScrollListText(); |
105 | 105 | ||
106 | virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; | 106 | virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; |
@@ -145,7 +145,7 @@ public: | |||
145 | virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; | 145 | virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; |
146 | virtual S32 getWidth() const; | 146 | virtual S32 getWidth() const; |
147 | virtual S32 getHeight() const { return mIcon ? mIcon->getHeight() : 0; } | 147 | virtual S32 getHeight() const { return mIcon ? mIcon->getHeight() : 0; } |
148 | virtual const LLSD getValue() const { return mIcon.isNull() ? LLString::null : mIcon->getName(); } | 148 | virtual const LLSD getValue() const { return mIcon.isNull() ? LLStringUtil::null : mIcon->getName(); } |
149 | virtual void setColor(const LLColor4&); | 149 | virtual void setColor(const LLColor4&); |
150 | virtual BOOL isText()const { return FALSE; } | 150 | virtual BOOL isText()const { return FALSE; } |
151 | virtual void setValue(const LLSD& value); | 151 | virtual void setValue(const LLSD& value); |
@@ -201,7 +201,7 @@ public: | |||
201 | mFontAlignment(LLFontGL::LEFT) | 201 | mFontAlignment(LLFontGL::LEFT) |
202 | { } | 202 | { } |
203 | 203 | ||
204 | LLScrollListColumn(LLString name, LLString label, S32 width, F32 relwidth) : | 204 | LLScrollListColumn(std::string name, std::string label, S32 width, F32 relwidth) : |
205 | mName(name), | 205 | mName(name), |
206 | mSortingColumn(name), | 206 | mSortingColumn(name), |
207 | mSortAscending(TRUE), | 207 | mSortAscending(TRUE), |
@@ -265,15 +265,16 @@ public: | |||
265 | mIndex = -1; | 265 | mIndex = -1; |
266 | mParentCtrl = NULL; | 266 | mParentCtrl = NULL; |
267 | mHeader = NULL; | 267 | mHeader = NULL; |
268 | mFontAlignment = LLFontGL::LEFT; | ||
268 | } | 269 | } |
269 | 270 | ||
270 | // Public data is fine so long as this remains a simple struct-like data class. | 271 | // Public data is fine so long as this remains a simple struct-like data class. |
271 | // If it ever gets any smarter than that, these should all become private | 272 | // If it ever gets any smarter than that, these should all become private |
272 | // with protected or public accessor methods added as needed. -MG | 273 | // with protected or public accessor methods added as needed. -MG |
273 | LLString mName; | 274 | std::string mName; |
274 | LLString mSortingColumn; | 275 | std::string mSortingColumn; |
275 | BOOL mSortAscending; | 276 | BOOL mSortAscending; |
276 | LLString mLabel; | 277 | std::string mLabel; |
277 | S32 mWidth; | 278 | S32 mWidth; |
278 | F32 mRelWidth; | 279 | F32 mRelWidth; |
279 | BOOL mDynamicWidth; | 280 | BOOL mDynamicWidth; |
@@ -287,7 +288,7 @@ public: | |||
287 | class LLColumnHeader : public LLComboBox | 288 | class LLColumnHeader : public LLComboBox |
288 | { | 289 | { |
289 | public: | 290 | public: |
290 | LLColumnHeader(const LLString& label, const LLRect &rect, LLScrollListColumn* column, const LLFontGL *font = NULL); | 291 | LLColumnHeader(const std::string& label, const LLRect &rect, LLScrollListColumn* column, const LLFontGL *font = NULL); |
291 | ~LLColumnHeader(); | 292 | ~LLColumnHeader(); |
292 | 293 | ||
293 | /*virtual*/ void draw(); | 294 | /*virtual*/ void draw(); |
@@ -297,12 +298,12 @@ public: | |||
297 | /*virtual*/ LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding); | 298 | /*virtual*/ LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding); |
298 | /*virtual*/ void userSetShape(const LLRect& new_rect); | 299 | /*virtual*/ void userSetShape(const LLRect& new_rect); |
299 | 300 | ||
300 | void setImage(const LLString &image_name); | 301 | void setImage(const std::string &image_name); |
301 | LLScrollListColumn* getColumn() { return mColumn; } | 302 | LLScrollListColumn* getColumn() { return mColumn; } |
302 | void setHasResizableElement(BOOL resizable); | 303 | void setHasResizableElement(BOOL resizable); |
303 | BOOL canResize(); | 304 | BOOL canResize(); |
304 | void enableResizeBar(BOOL enable); | 305 | void enableResizeBar(BOOL enable); |
305 | LLString getLabel() { return mOrigLabel; } | 306 | std::string getLabel() { return mOrigLabel; } |
306 | 307 | ||
307 | static void onSelectSort(LLUICtrl* ctrl, void* user_data); | 308 | static void onSelectSort(LLUICtrl* ctrl, void* user_data); |
308 | static void onClick(void* user_data); | 309 | static void onClick(void* user_data); |
@@ -312,7 +313,7 @@ public: | |||
312 | private: | 313 | private: |
313 | LLScrollListColumn* mColumn; | 314 | LLScrollListColumn* mColumn; |
314 | LLResizeBar* mResizeBar; | 315 | LLResizeBar* mResizeBar; |
315 | LLString mOrigLabel; | 316 | std::string mOrigLabel; |
316 | LLUIString mAscendingText; | 317 | LLUIString mAscendingText; |
317 | LLUIString mDescendingText; | 318 | LLUIString mDescendingText; |
318 | BOOL mShowSortOptions; | 319 | BOOL mShowSortOptions; |
@@ -343,7 +344,7 @@ public: | |||
343 | 344 | ||
344 | // If width = 0, just use the width of the text. Otherwise override with | 345 | // If width = 0, just use the width of the text. Otherwise override with |
345 | // specified width in pixels. | 346 | // specified width in pixels. |
346 | void addColumn( const LLString& text, const LLFontGL* font, S32 width = 0 , U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, BOOL visible = TRUE) | 347 | void addColumn( const std::string& text, const LLFontGL* font, S32 width = 0 , U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, BOOL visible = TRUE) |
347 | { mColumns.push_back( new LLScrollListText(text, font, width, font_style, font_alignment, LLColor4::black, FALSE, visible) ); } | 348 | { mColumns.push_back( new LLScrollListText(text, font, width, font_style, font_alignment, LLColor4::black, FALSE, visible) ); } |
348 | 349 | ||
349 | void addColumn( LLUIImagePtr icon, S32 width = 0 ) | 350 | void addColumn( LLUIImagePtr icon, S32 width = 0 ) |
@@ -360,7 +361,7 @@ public: | |||
360 | 361 | ||
361 | LLScrollListCell *getColumn(const S32 i) const { if (0 <= i && i < (S32)mColumns.size()) { return mColumns[i]; } return NULL; } | 362 | LLScrollListCell *getColumn(const S32 i) const { if (0 <= i && i < (S32)mColumns.size()) { return mColumns[i]; } return NULL; } |
362 | 363 | ||
363 | LLString getContentsCSV() const; | 364 | std::string getContentsCSV() const; |
364 | 365 | ||
365 | virtual void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding); | 366 | virtual void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding); |
366 | 367 | ||
@@ -380,7 +381,7 @@ private: | |||
380 | class LLScrollListItemComment : public LLScrollListItem | 381 | class LLScrollListItemComment : public LLScrollListItem |
381 | { | 382 | { |
382 | public: | 383 | public: |
383 | LLScrollListItemComment(const LLString& comment_string, const LLColor4& color); | 384 | LLScrollListItemComment(const std::string& comment_string, const LLColor4& color); |
384 | 385 | ||
385 | /*virtual*/ void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding); | 386 | /*virtual*/ void draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding); |
386 | private: | 387 | private: |
@@ -400,7 +401,7 @@ class LLScrollListCtrl : public LLUICtrl, public LLEditMenuHandler, | |||
400 | { | 401 | { |
401 | public: | 402 | public: |
402 | LLScrollListCtrl( | 403 | LLScrollListCtrl( |
403 | const LLString& name, | 404 | const std::string& name, |
404 | const LLRect& rect, | 405 | const LLRect& rect, |
405 | void (*commit_callback)(LLUICtrl*, void*), | 406 | void (*commit_callback)(LLUICtrl*, void*), |
406 | void* callback_userdata, | 407 | void* callback_userdata, |
@@ -419,14 +420,14 @@ public: | |||
419 | 420 | ||
420 | // Sets an array of column descriptors | 421 | // Sets an array of column descriptors |
421 | void setColumnHeadings(LLSD headings); | 422 | void setColumnHeadings(LLSD headings); |
422 | void sortByColumn(U32 column, BOOL ascending); | 423 | void sortByColumnIndex(U32 column, BOOL ascending); |
423 | 424 | ||
424 | // LLCtrlListInterface functions | 425 | // LLCtrlListInterface functions |
425 | virtual S32 getItemCount() const; | 426 | virtual S32 getItemCount() const; |
426 | // Adds a single column descriptor: ["name" : string, "label" : string, "width" : integer, "relwidth" : integer ] | 427 | // Adds a single column descriptor: ["name" : string, "label" : string, "width" : integer, "relwidth" : integer ] |
427 | virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM); | 428 | virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM); |
428 | virtual void clearColumns(); | 429 | virtual void clearColumns(); |
429 | virtual void setColumnLabel(const LLString& column, const LLString& label); | 430 | virtual void setColumnLabel(const std::string& column, const std::string& label); |
430 | 431 | ||
431 | virtual LLScrollListColumn* getColumn(S32 index); | 432 | virtual LLScrollListColumn* getColumn(S32 index); |
432 | virtual S32 getNumColumns() const { return mColumnsIndexed.size(); } | 433 | virtual S32 getNumColumns() const { return mColumnsIndexed.size(); } |
@@ -438,7 +439,7 @@ public: | |||
438 | // Simple add element. Takes a single array of: | 439 | // Simple add element. Takes a single array of: |
439 | // [ "value" => value, "font" => font, "font-style" => style ] | 440 | // [ "value" => value, "font" => font, "font-style" => style ] |
440 | virtual void clearRows(); // clears all elements | 441 | virtual void clearRows(); // clears all elements |
441 | virtual void sortByColumn(LLString name, BOOL ascending); | 442 | virtual void sortByColumn(const std::string& name, BOOL ascending); |
442 | 443 | ||
443 | // These functions take and return an array of arrays of elements, as above | 444 | // These functions take and return an array of arrays of elements, as above |
444 | virtual void setValue(const LLSD& value ); | 445 | virtual void setValue(const LLSD& value ); |
@@ -493,24 +494,24 @@ public: | |||
493 | S32 getItemIndex( LLScrollListItem* item ) const; | 494 | S32 getItemIndex( LLScrollListItem* item ) const; |
494 | S32 getItemIndex( const LLUUID& item_id ) const; | 495 | S32 getItemIndex( const LLUUID& item_id ) const; |
495 | 496 | ||
496 | LLScrollListItem* addCommentText( const LLString& comment_text, EAddPosition pos = ADD_BOTTOM); | 497 | LLScrollListItem* addCommentText( const std::string& comment_text, EAddPosition pos = ADD_BOTTOM); |
497 | LLScrollListItem* addSeparator(EAddPosition pos); | 498 | LLScrollListItem* addSeparator(EAddPosition pos); |
498 | 499 | ||
499 | // "Simple" interface: use this when you're creating a list that contains only unique strings, only | 500 | // "Simple" interface: use this when you're creating a list that contains only unique strings, only |
500 | // one of which can be selected at a time. | 501 | // one of which can be selected at a time. |
501 | virtual LLScrollListItem* addSimpleElement(const LLString& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()); | 502 | virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()); |
502 | 503 | ||
503 | 504 | ||
504 | BOOL selectItemByLabel( const LLString& item, BOOL case_sensitive = TRUE ); // FALSE if item not found | 505 | BOOL selectItemByLabel( const std::string& item, BOOL case_sensitive = TRUE ); // FALSE if item not found |
505 | BOOL selectItemByPrefix(const LLString& target, BOOL case_sensitive = TRUE); | 506 | BOOL selectItemByPrefix(const std::string& target, BOOL case_sensitive = TRUE); |
506 | BOOL selectItemByPrefix(const LLWString& target, BOOL case_sensitive = TRUE); | 507 | BOOL selectItemByPrefix(const LLWString& target, BOOL case_sensitive = TRUE); |
507 | const LLString getSelectedItemLabel(S32 column = 0) const; | 508 | const std::string getSelectedItemLabel(S32 column = 0) const; |
508 | LLSD getSelectedValue(); | 509 | LLSD getSelectedValue(); |
509 | 510 | ||
510 | // DEPRECATED: Use LLSD versions of addCommentText() and getSelectedValue(). | 511 | // DEPRECATED: Use LLSD versions of addCommentText() and getSelectedValue(). |
511 | // "StringUUID" interface: use this when you're creating a list that contains non-unique strings each of which | 512 | // "StringUUID" interface: use this when you're creating a list that contains non-unique strings each of which |
512 | // has an associated, unique UUID, and only one of which can be selected at a time. | 513 | // has an associated, unique UUID, and only one of which can be selected at a time. |
513 | LLScrollListItem* addStringUUIDItem(const LLString& item_text, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE, S32 column_width = 0); | 514 | LLScrollListItem* addStringUUIDItem(const std::string& item_text, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE, S32 column_width = 0); |
514 | LLUUID getStringUUIDSelectedItem() const; | 515 | LLUUID getStringUUIDSelectedItem() const; |
515 | 516 | ||
516 | LLScrollListItem* getFirstSelected() const; | 517 | LLScrollListItem* getFirstSelected() const; |
@@ -568,7 +569,7 @@ public: | |||
568 | /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); | 569 | /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); |
569 | /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char); | 570 | /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char); |
570 | /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); | 571 | /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); |
571 | /*virtual*/ BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); | 572 | /*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); |
572 | /*virtual*/ void setEnabled(BOOL enabled); | 573 | /*virtual*/ void setEnabled(BOOL enabled); |
573 | /*virtual*/ void setFocus( BOOL b ); | 574 | /*virtual*/ void setFocus( BOOL b ); |
574 | /*virtual*/ void onFocusReceived(); | 575 | /*virtual*/ void onFocusReceived(); |
@@ -719,7 +720,7 @@ private: | |||
719 | 720 | ||
720 | BOOL mSorted; | 721 | BOOL mSorted; |
721 | 722 | ||
722 | typedef std::map<LLString, LLScrollListColumn> column_map_t; | 723 | typedef std::map<std::string, LLScrollListColumn> column_map_t; |
723 | column_map_t mColumns; | 724 | column_map_t mColumns; |
724 | 725 | ||
725 | BOOL mDirty; | 726 | BOOL mDirty; |