diff options
author | Jacek Antonelli | 2008-08-15 23:45:27 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:27 -0500 |
commit | a8a62201ba762e98dff92cf49033e577fc34d8d4 (patch) | |
tree | 11f8513c5cdc222f2fac0c93eb724c089803c200 /linden/indra/newview/llnamelistctrl.cpp | |
parent | Second Life viewer sources 1.18.6.4-RC (diff) | |
download | meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.zip meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.gz meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.bz2 meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.xz |
Second Life viewer sources 1.19.0.0
Diffstat (limited to 'linden/indra/newview/llnamelistctrl.cpp')
-rw-r--r-- | linden/indra/newview/llnamelistctrl.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/linden/indra/newview/llnamelistctrl.cpp b/linden/indra/newview/llnamelistctrl.cpp index 57a9f93..e645cc6 100644 --- a/linden/indra/newview/llnamelistctrl.cpp +++ b/linden/indra/newview/llnamelistctrl.cpp | |||
@@ -12,12 +12,12 @@ | |||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | 12 | * ("GPL"), unless you have obtained a separate licensing agreement |
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | 13 | * ("Other License"), formally executed by you and Linden Lab. Terms of |
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | 14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or |
15 | * online at http://secondlife.com/developers/opensource/gplv2 | 15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 |
16 | * | 16 | * |
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlife.com/developers/opensource/flossexception | 20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception |
21 | * | 21 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 22 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 23 | * that you have read and understood your obligations described above, |
@@ -224,7 +224,7 @@ LLScrollListItem* LLNameListCtrl::addElement(const LLSD& value, EAddPosition pos | |||
224 | LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); | 224 | LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); |
225 | ((LLScrollListText*)cell)->setText( fullname ); | 225 | ((LLScrollListText*)cell)->setText( fullname ); |
226 | 226 | ||
227 | updateMaxContentWidth(item); | 227 | calcMaxContentWidth(item); |
228 | 228 | ||
229 | // this column is resizable | 229 | // this column is resizable |
230 | LLScrollListColumn* columnp = getColumn(mNameColumnIndex); | 230 | LLScrollListColumn* columnp = getColumn(mNameColumnIndex); |
@@ -277,7 +277,7 @@ void LLNameListCtrl::refresh(const LLUUID& id, const char* first, | |||
277 | cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); | 277 | cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); |
278 | 278 | ||
279 | ((LLScrollListText*)cell)->setText( fullname ); | 279 | ((LLScrollListText*)cell)->setText( fullname ); |
280 | updateMaxContentWidth(item); | 280 | calcMaxContentWidth(item); |
281 | } | 281 | } |
282 | } | 282 | } |
283 | } | 283 | } |
@@ -332,9 +332,6 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto | |||
332 | BOOL draw_heading = FALSE; | 332 | BOOL draw_heading = FALSE; |
333 | node->getAttributeBOOL("draw_heading", draw_heading); | 333 | node->getAttributeBOOL("draw_heading", draw_heading); |
334 | 334 | ||
335 | BOOL collapse_empty_columns = FALSE; | ||
336 | node->getAttributeBOOL("collapse_empty_columns", collapse_empty_columns); | ||
337 | |||
338 | S32 name_column_index = 0; | 335 | S32 name_column_index = 0; |
339 | node->getAttributeS32("name_column_index", name_column_index); | 336 | node->getAttributeS32("name_column_index", name_column_index); |
340 | 337 | ||
@@ -355,7 +352,6 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto | |||
355 | node->getAttributeS32("heading_height", heading_height); | 352 | node->getAttributeS32("heading_height", heading_height); |
356 | name_list->setHeadingHeight(heading_height); | 353 | name_list->setHeadingHeight(heading_height); |
357 | } | 354 | } |
358 | name_list->setCollapseEmptyColumns(collapse_empty_columns); | ||
359 | 355 | ||
360 | BOOL allow_calling_card_drop = FALSE; | 356 | BOOL allow_calling_card_drop = FALSE; |
361 | if (node->getAttributeBOOL("allow_calling_card_drop", allow_calling_card_drop)) | 357 | if (node->getAttributeBOOL("allow_calling_card_drop", allow_calling_card_drop)) |
@@ -369,6 +365,7 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto | |||
369 | 365 | ||
370 | LLSD columns; | 366 | LLSD columns; |
371 | S32 index = 0; | 367 | S32 index = 0; |
368 | S32 total_static = 0; | ||
372 | LLXMLNodePtr child; | 369 | LLXMLNodePtr child; |
373 | for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) | 370 | for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) |
374 | { | 371 | { |
@@ -380,6 +377,13 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto | |||
380 | LLString columnname(labelname); | 377 | LLString columnname(labelname); |
381 | child->getAttributeString("name", columnname); | 378 | child->getAttributeString("name", columnname); |
382 | 379 | ||
380 | BOOL columndynamicwidth = FALSE; | ||
381 | child->getAttributeBOOL("dynamicwidth", columndynamicwidth); | ||
382 | |||
383 | LLString sortname(columnname); | ||
384 | child->getAttributeString("sort", sortname); | ||
385 | |||
386 | S32 columnwidth = -1; | ||
383 | if (child->hasAttribute("relwidth")) | 387 | if (child->hasAttribute("relwidth")) |
384 | { | 388 | { |
385 | F32 columnrelwidth = 0.f; | 389 | F32 columnrelwidth = 0.f; |
@@ -388,7 +392,6 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto | |||
388 | } | 392 | } |
389 | else | 393 | else |
390 | { | 394 | { |
391 | S32 columnwidth = -1; | ||
392 | child->getAttributeS32("width", columnwidth); | 395 | child->getAttributeS32("width", columnwidth); |
393 | columns[index]["width"] = columnwidth; | 396 | columns[index]["width"] = columnwidth; |
394 | } | 397 | } |
@@ -396,14 +399,21 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto | |||
396 | LLFontGL::HAlign h_align = LLFontGL::LEFT; | 399 | LLFontGL::HAlign h_align = LLFontGL::LEFT; |
397 | h_align = LLView::selectFontHAlign(child); | 400 | h_align = LLView::selectFontHAlign(child); |
398 | 401 | ||
402 | if(!columndynamicwidth) total_static += llmax(0, columnwidth); | ||
403 | |||
399 | columns[index]["name"] = columnname; | 404 | columns[index]["name"] = columnname; |
400 | columns[index]["label"] = labelname; | 405 | columns[index]["label"] = labelname; |
401 | columns[index]["halign"] = (S32)h_align; | 406 | columns[index]["halign"] = (S32)h_align; |
407 | columns[index]["dynamicwidth"] = columndynamicwidth; | ||
408 | columns[index]["sort"] = sortname; | ||
409 | |||
402 | index++; | 410 | index++; |
403 | } | 411 | } |
404 | } | 412 | } |
413 | name_list->setTotalStaticColumnWidth(total_static); | ||
405 | name_list->setColumnHeadings(columns); | 414 | name_list->setColumnHeadings(columns); |
406 | 415 | ||
416 | |||
407 | for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) | 417 | for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) |
408 | { | 418 | { |
409 | if (child->hasName("row")) | 419 | if (child->hasName("row")) |
@@ -453,7 +463,7 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto | |||
453 | while(token_iter != tokens.end()) | 463 | while(token_iter != tokens.end()) |
454 | { | 464 | { |
455 | const char* line = token_iter->c_str(); | 465 | const char* line = token_iter->c_str(); |
456 | name_list->addSimpleItem(line); | 466 | name_list->addCommentText(line); |
457 | ++token_iter; | 467 | ++token_iter; |
458 | } | 468 | } |
459 | 469 | ||