PageRenderTime 20ms CodeModel.GetById 12ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/newview/lllistview.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 67 lines | 30 code | 8 blank | 29 comment | 0 complexity | df53b2e8aa551d8c6537b8ca7cccfb9a MD5 | raw file
 1/** 
 2 * @file lllistview.cpp
 3 * @brief UI widget containing a scrollable, possibly hierarchical list of 
 4 * folders (LLListViewFolder) and items (LLListViewItem).
 5 *
 6 * $LicenseInfo:firstyear=2009&license=viewerlgpl$
 7 * Second Life Viewer Source Code
 8 * Copyright (C) 2010, Linden Research, Inc.
 9 * 
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation;
13 * version 2.1 of the License only.
14 * 
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 * Lesser General Public License for more details.
19 * 
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23 * 
24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
25 * $/LicenseInfo$
26 */
27#include "llviewerprecompiledheaders.h"
28
29#include "lllistview.h"
30
31#include "lltextbox.h"
32#include "lluictrlfactory.h"	// LLDefaultChildRegistry
33
34// linker optimizes this out on Windows until there is a real reference
35// to this file
36static LLDefaultChildRegistry::Register<LLListView> r("list_view");
37
38LLListView::Params::Params()
39:	bg_color("bg_color"),
40	fg_selected_color("fg_selected_color"),
41	bg_selected_color("bg_selected_color")
42{}
43
44LLListView::LLListView(const Params& p)
45:	LLUICtrl(p),
46	mLabel(NULL),
47	mBgColor(p.bg_color()),
48	mFgSelectedColor(p.fg_selected_color()),
49	mBgSelectedColor(p.bg_selected_color())
50{
51	LLRect label_rect(0, 20, 300, 0);
52	LLTextBox::Params text_box_params;
53	text_box_params.rect(label_rect);
54	text_box_params.initial_value("This is a list-view");
55	mLabel = LLUICtrlFactory::create<LLTextBox>(text_box_params);
56	addChild(mLabel);
57}
58
59LLListView::~LLListView()
60{}
61
62
63// placeholder for setting a property
64void LLListView::setString(const std::string& s)
65{
66	mLabel->setValue( LLSD(s) );
67}