PageRenderTime 60ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llui/llcontainerview.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 94 lines | 54 code | 14 blank | 26 comment | 0 complexity | 04b089224a17ce3db4a3be885d752a2d MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llcontainerview.h
  3. * @brief Container for all statistics info.
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLCONTAINERVIEW_H
  27. #define LL_LLCONTAINERVIEW_H
  28. #include "stdtypes.h"
  29. #include "lltextbox.h"
  30. #include "llstatbar.h"
  31. #include "llview.h"
  32. class LLScrollContainer;
  33. struct ContainerViewRegistry : public LLChildRegistry<ContainerViewRegistry>
  34. {};
  35. class LLContainerView : public LLView
  36. {
  37. public:
  38. struct Params : public LLInitParam::Block<Params, LLView::Params>
  39. {
  40. Optional<std::string> label;
  41. Optional<bool> show_label;
  42. Optional<bool> display_children;
  43. Params()
  44. : label("label"),
  45. show_label("show_label", FALSE),
  46. display_children("display_children", TRUE)
  47. {
  48. changeDefault(mouse_opaque, false);
  49. }
  50. };
  51. // my valid children are stored in this registry
  52. typedef ContainerViewRegistry child_registry_t;
  53. protected:
  54. LLContainerView(const Params& p);
  55. friend class LLUICtrlFactory;
  56. public:
  57. ~LLContainerView();
  58. /*virtual*/ BOOL postBuild();
  59. /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0);
  60. /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
  61. /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
  62. /*virtual*/ void draw();
  63. /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
  64. /*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options.
  65. void setLabel(const std::string& label);
  66. void showLabel(BOOL show) { mShowLabel = show; }
  67. void setDisplayChildren(const BOOL displayChildren);
  68. BOOL getDisplayChildren() { return mDisplayChildren; }
  69. void setScrollContainer(LLScrollContainer* scroll) {mScrollContainer = scroll;}
  70. private:
  71. LLScrollContainer* mScrollContainer;
  72. void arrange(S32 width, S32 height, BOOL called_from_parent = TRUE);
  73. BOOL mShowLabel;
  74. protected:
  75. BOOL mDisplayChildren;
  76. std::string mLabel;
  77. public:
  78. BOOL mCollapsible;
  79. };
  80. #endif // LL_CONTAINERVIEW_