PageRenderTime 54ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llsyswellitem.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 93 lines | 42 code | 18 blank | 33 comment | 1 complexity | bb7c28beba82082dda43be379ed33ae5 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llsyswellitem.cpp
  3. * @brief // TODO
  4. *
  5. * $LicenseInfo:firstyear=2000&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. #include "llviewerprecompiledheaders.h" // must be first include
  27. #include "llsyswellitem.h"
  28. #include "llwindow.h"
  29. #include "v4color.h"
  30. #include "lluicolortable.h"
  31. //---------------------------------------------------------------------------------
  32. LLSysWellItem::LLSysWellItem(const Params& p) : LLPanel(p),
  33. mTitle(NULL),
  34. mCloseBtn(NULL)
  35. {
  36. buildFromFile( "panel_sys_well_item.xml");
  37. mTitle = getChild<LLTextBox>("title");
  38. mCloseBtn = getChild<LLButton>("close_btn");
  39. mTitle->setValue(p.title);
  40. mCloseBtn->setClickedCallback(boost::bind(&LLSysWellItem::onClickCloseBtn,this));
  41. mID = p.notification_id;
  42. }
  43. //---------------------------------------------------------------------------------
  44. LLSysWellItem::~LLSysWellItem()
  45. {
  46. }
  47. //---------------------------------------------------------------------------------
  48. void LLSysWellItem::setTitle( std::string title )
  49. {
  50. mTitle->setValue(title);
  51. }
  52. //---------------------------------------------------------------------------------
  53. void LLSysWellItem::onClickCloseBtn()
  54. {
  55. mOnItemClose(this);
  56. }
  57. //---------------------------------------------------------------------------------
  58. BOOL LLSysWellItem::handleMouseDown(S32 x, S32 y, MASK mask)
  59. {
  60. BOOL res = LLPanel::handleMouseDown(x, y, mask);
  61. if(!mCloseBtn->getRect().pointInRect(x, y))
  62. mOnItemClick(this);
  63. return res;
  64. }
  65. //---------------------------------------------------------------------------------
  66. void LLSysWellItem::onMouseEnter(S32 x, S32 y, MASK mask)
  67. {
  68. setTransparentColor(LLUIColorTable::instance().getColor( "SysWellItemSelected" ));
  69. }
  70. //---------------------------------------------------------------------------------
  71. void LLSysWellItem::onMouseLeave(S32 x, S32 y, MASK mask)
  72. {
  73. setTransparentColor(LLUIColorTable::instance().getColor( "SysWellItemUnselected" ));
  74. }
  75. //---------------------------------------------------------------------------------