Esempio n. 1
0
LLPanel::LLPanel(const LLPanel::Params& p)
:	LLUICtrl(p),
	mBgVisible(p.background_visible),
	mBgOpaque(p.background_opaque),
	mBgOpaqueColor(p.bg_opaque_color()),
	mBgAlphaColor(p.bg_alpha_color()),
	mBgOpaqueImageOverlay(p.bg_opaque_image_overlay),
	mBgAlphaImageOverlay(p.bg_alpha_image_overlay),
	mBgOpaqueImage(p.bg_opaque_image()),
	mBgAlphaImage(p.bg_alpha_image()),
	mDefaultBtn(NULL),
	mBorder(NULL),
	mLabel(p.label),
	mHelpTopic(p.help_topic),
	mCommitCallbackRegistrar(false),
	mEnableCallbackRegistrar(false),
	mXMLFilename(p.filename),
	mVisibleSignal(NULL)
	// *NOTE: Be sure to also change LLPanel::initFromParams().  We have too
	// many classes derived from LLPanel to retrofit them all to pass in params.
{
	if (p.has_border)
	{
		addBorder(p.border);
	}
	
	mPanelHandle.bind(this);
}
Esempio n. 2
0
LLFlatListView::LLFlatListView(const LLFlatListView::Params& p)
:	LLScrollContainer(p)
  , mItemComparator(NULL)
  , mItemsPanel(NULL)
  , mItemPad(p.item_pad)
  , mAllowSelection(p.allow_select)
  , mMultipleSelection(p.multi_select)
  , mKeepOneItemSelected(p.keep_one_selected)
  , mCommitOnSelectionChange(false)
  , mPrevNotifyParentRect(LLRect())
  , mNoItemsCommentTextbox(NULL)
  , mIsConsecutiveSelection(false)
  , mKeepSelectionVisibleOnReshape(p.keep_selection_visible_on_reshape)
{
	mBorderThickness = getBorderWidth();

	LLRect scroll_rect = getRect();
	LLRect items_rect;

	setItemsNoScrollWidth(scroll_rect.getWidth());
	items_rect.setLeftTopAndSize(mBorderThickness, scroll_rect.getHeight() - mBorderThickness, mItemsNoScrollWidth, 0);

	LLPanel::Params pp;
	pp.rect(items_rect);
	mItemsPanel = LLUICtrlFactory::create<LLPanel> (pp);
	addChild(mItemsPanel);

	//we don't need to stretch in vertical direction on reshaping by a parent
	//no bottom following!
	mItemsPanel->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_TOP);

	LLViewBorder::Params params;
	params.name("scroll border");
	params.rect(getLastSelectedItemRect());
	params.visible(false);
	params.bevel_style(LLViewBorder::BEVEL_IN);
	mSelectedItemsBorder = LLUICtrlFactory::create<LLViewBorder> (params);
	mItemsPanel->addChild( mSelectedItemsBorder );

	{
		// create textbox for "No Items" comment text
		LLTextBox::Params text_p = p.no_items_text;
		if (!text_p.rect.isProvided())
		{
			LLRect comment_rect = getRect();
			comment_rect.setOriginAndSize(0, 0, comment_rect.getWidth(), comment_rect.getHeight());
			comment_rect.stretch(-getBorderWidth());
			text_p.rect(comment_rect);
		}
		text_p.border_visible(false);

		if (!text_p.follows.isProvided())
		{
			text_p.follows.flags(FOLLOWS_ALL);
		}
		mNoItemsCommentTextbox = LLUICtrlFactory::create<LLTextBox>(text_p, this);
	}
};
Esempio n. 3
0
void LLPanel::initFromParams(const LLPanel::Params& p)
{
    //setting these here since panel constructor not called with params
    //and LLView::initFromParams will use them to set visible and enabled  
	setVisible(p.visible);
	setEnabled(p.enabled);

	setSoundFlags(p.sound_flags);

	 // control_name, tab_stop, focus_lost_callback, initial_value, rect, enabled, visible
	LLUICtrl::initFromParams(p);
	
	// visible callback 
	if (p.visible_callback.isProvided())
	{
		setVisibleCallback(initCommitCallback(p.visible_callback));
	}
	
	for (LLInitParam::ParamIterator<LocalizedString>::const_iterator it = p.strings().begin();
		it != p.strings().end();
		++it)
	{
		mUIStrings[it->name] = it->value;
	}

	setLabel(p.label());
	setHelpTopic(p.help_topic);
	setShape(p.rect);
	parseFollowsFlags(p);

	setToolTip(p.tool_tip());
	setFromXUI(p.from_xui);
	
	mHoverCursor = getCursorFromString(p.hover_cursor);
	
	if (p.has_border)
	{
		addBorder(p.border);
	}
	// let constructors set this value if not provided
	if (p.use_bounding_rect.isProvided())
	{
		setUseBoundingRect(p.use_bounding_rect);
	}
	setDefaultTabGroup(p.default_tab_group);
	setMouseOpaque(p.mouse_opaque);
	
	setBackgroundVisible(p.background_visible);
	setBackgroundOpaque(p.background_opaque);
	setBackgroundColor(p.bg_opaque_color().get());
	setTransparentColor(p.bg_alpha_color().get());
	mBgOpaqueImage = p.bg_opaque_image();
	mBgAlphaImage = p.bg_alpha_image();
	mBgOpaqueImageOverlay = p.bg_opaque_image_overlay;
	mBgAlphaImageOverlay = p.bg_alpha_image_overlay;
}