PageRenderTime 384ms CodeModel.GetById 201ms app.highlight 6ms RepoModel.GetById 176ms 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
 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
27
28#include "llviewerprecompiledheaders.h" // must be first include
29
30#include "llsyswellitem.h"
31
32#include "llwindow.h"
33#include "v4color.h"
34#include "lluicolortable.h"
35
36//---------------------------------------------------------------------------------
37LLSysWellItem::LLSysWellItem(const Params& p) : LLPanel(p),
38												mTitle(NULL),
39												mCloseBtn(NULL)
40{
41	buildFromFile( "panel_sys_well_item.xml");
42
43	mTitle = getChild<LLTextBox>("title");
44	mCloseBtn = getChild<LLButton>("close_btn");
45
46	mTitle->setValue(p.title);
47	mCloseBtn->setClickedCallback(boost::bind(&LLSysWellItem::onClickCloseBtn,this));
48
49	mID = p.notification_id;
50}
51
52//---------------------------------------------------------------------------------
53LLSysWellItem::~LLSysWellItem()
54{
55}
56
57//---------------------------------------------------------------------------------
58void LLSysWellItem::setTitle( std::string title )
59{
60	mTitle->setValue(title);
61}
62
63//---------------------------------------------------------------------------------
64void LLSysWellItem::onClickCloseBtn()
65{
66	mOnItemClose(this);
67}
68
69//---------------------------------------------------------------------------------
70BOOL LLSysWellItem::handleMouseDown(S32 x, S32 y, MASK mask)
71{
72	BOOL res = LLPanel::handleMouseDown(x, y, mask);
73	if(!mCloseBtn->getRect().pointInRect(x, y))
74		mOnItemClick(this);
75
76	return res;
77}
78
79//---------------------------------------------------------------------------------
80void LLSysWellItem::onMouseEnter(S32 x, S32 y, MASK mask)
81{
82	setTransparentColor(LLUIColorTable::instance().getColor( "SysWellItemSelected" ));
83}
84
85//---------------------------------------------------------------------------------
86void LLSysWellItem::onMouseLeave(S32 x, S32 y, MASK mask)
87{
88	setTransparentColor(LLUIColorTable::instance().getColor( "SysWellItemUnselected" ));
89}
90
91//---------------------------------------------------------------------------------
92
93