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
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);
	setFocusRoot(p.focus_root);
	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;

	mAcceptsBadge = p.accepts_badge;
}