PageRenderTime 31ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/lllistview.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 67 lines | 30 code | 8 blank | 29 comment | 0 complexity | df53b2e8aa551d8c6537b8ca7cccfb9a MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lllistview.cpp
  3. * @brief UI widget containing a scrollable, possibly hierarchical list of
  4. * folders (LLListViewFolder) and items (LLListViewItem).
  5. *
  6. * $LicenseInfo:firstyear=2009&license=viewerlgpl$
  7. * Second Life Viewer Source Code
  8. * Copyright (C) 2010, Linden Research, Inc.
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation;
  13. * version 2.1 of the License only.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  25. * $/LicenseInfo$
  26. */
  27. #include "llviewerprecompiledheaders.h"
  28. #include "lllistview.h"
  29. #include "lltextbox.h"
  30. #include "lluictrlfactory.h" // LLDefaultChildRegistry
  31. // linker optimizes this out on Windows until there is a real reference
  32. // to this file
  33. static LLDefaultChildRegistry::Register<LLListView> r("list_view");
  34. LLListView::Params::Params()
  35. : bg_color("bg_color"),
  36. fg_selected_color("fg_selected_color"),
  37. bg_selected_color("bg_selected_color")
  38. {}
  39. LLListView::LLListView(const Params& p)
  40. : LLUICtrl(p),
  41. mLabel(NULL),
  42. mBgColor(p.bg_color()),
  43. mFgSelectedColor(p.fg_selected_color()),
  44. mBgSelectedColor(p.bg_selected_color())
  45. {
  46. LLRect label_rect(0, 20, 300, 0);
  47. LLTextBox::Params text_box_params;
  48. text_box_params.rect(label_rect);
  49. text_box_params.initial_value("This is a list-view");
  50. mLabel = LLUICtrlFactory::create<LLTextBox>(text_box_params);
  51. addChild(mLabel);
  52. }
  53. LLListView::~LLListView()
  54. {}
  55. // placeholder for setting a property
  56. void LLListView::setString(const std::string& s)
  57. {
  58. mLabel->setValue( LLSD(s) );
  59. }