PageRenderTime 20ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/lltoolview.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 84 lines | 35 code | 16 blank | 33 comment | 0 complexity | 264fb5f8b17e384a8cd8e1761d323442 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lltoolview.h
  3. * @brief UI container for tools.
  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_LLTOOLVIEW_H
  27. #define LL_LLTOOLVIEW_H
  28. // requires stdtypes.h
  29. #include "llpanel.h"
  30. // forward declares
  31. class LLTool;
  32. class LLButton;
  33. class LLToolView;
  34. // Utility class, container for the package of information we need about
  35. // each tool. The package can either point directly to a tool, or indirectly
  36. // to another view of tools.
  37. class LLToolContainer
  38. {
  39. public:
  40. LLToolContainer(LLToolView* parent);
  41. ~LLToolContainer();
  42. public:
  43. LLToolView* mParent; // toolview that owns this container
  44. LLButton* mButton;
  45. LLPanel* mPanel;
  46. LLTool* mTool; // if not NULL, this is a tool ref
  47. };
  48. // A view containing automatically arranged button icons representing
  49. // tools. The icons sit on top of panels containing options for each
  50. // tool.
  51. class LLToolView
  52. : public LLView
  53. {
  54. public:
  55. LLToolView(const std::string& name, const LLRect& rect);
  56. ~LLToolView();
  57. virtual void draw(); // handle juggling tool button highlights, panel visibility
  58. static void onClickToolButton(void* container);
  59. LLView* getCurrentHoverView();
  60. private:
  61. LLRect getButtonRect(S32 button_index); // return rect for button to add, zero-based index
  62. LLToolContainer *findToolContainer(LLTool *tool);
  63. private:
  64. typedef std::vector<LLToolContainer*> contain_list_t;
  65. contain_list_t mContainList;
  66. S32 mButtonCount; // used to compute rectangles
  67. };
  68. #endif