/indra/newview/llviewchildren.h

https://bitbucket.org/lindenlab/viewer-beta/ · C++ Header · 65 lines · 20 code · 13 blank · 32 comment · 0 complexity · 63faeac23217a9d0f0565a1c8bbc4ada MD5 · raw file

  1. /**
  2. * @file llviewchildren.h
  3. * @brief LLViewChildren class header file
  4. *
  5. * $LicenseInfo:firstyear=2006&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_LLVIEWCHILDREN_H
  27. #define LL_LLVIEWCHILDREN_H
  28. class LLPanel;
  29. class LLViewChildren
  30. // makes it easy to manipulate children of a view by id safely
  31. // encapsulates common operations into simple, one line calls
  32. {
  33. public:
  34. LLViewChildren(LLPanel& parent);
  35. // all views
  36. void show(const std::string& id, bool visible = true);
  37. void hide(const std::string& id) { show(id, false); }
  38. void enable(const std::string& id, bool enabled = true);
  39. void disable(const std::string& id) { enable(id, false); };
  40. //
  41. // LLTextBox
  42. void setText(const std::string& id,
  43. const std::string& text, bool visible = true);
  44. // LLIconCtrl
  45. enum Badge { BADGE_OK, BADGE_NOTE, BADGE_WARN, BADGE_ERROR };
  46. void setBadge(const std::string& id, Badge b, bool visible = true);
  47. // LLButton
  48. void setAction(const std::string& id, void(*function)(void*), void* value);
  49. private:
  50. LLPanel& mParent;
  51. };
  52. #endif