当前位置: 首页>>代码示例>>C++>>正文


C++ LLTextBox::setHAlign方法代码示例

本文整理汇总了C++中LLTextBox::setHAlign方法的典型用法代码示例。如果您正苦于以下问题:C++ LLTextBox::setHAlign方法的具体用法?C++ LLTextBox::setHAlign怎么用?C++ LLTextBox::setHAlign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLTextBox的用法示例。


在下文中一共展示了LLTextBox::setHAlign方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: icon_id

LLGroupNotifyBox::LLGroupNotifyBox(const char* subject,
							 const char* message,
							 const char* from_name,
							 const LLUUID& group_id,
							 const LLUUID& group_insignia,
							 const char* group_name,
							 const U32& t,
							 const bool& has_inventory,
							 const char* inventory_name,
							 LLOfferInfo* inventory_offer)
:	LLPanel("groupnotify", LLGroupNotifyBox::getGroupNotifyRect(), BORDER_YES),
	mAnimating(TRUE),
	mTimer(),
	mGroupID(group_id),
	mHasInventory(has_inventory),
	mInventoryOffer(inventory_offer)
{
	mIsFocusRoot = TRUE;

	time_t timestamp = (time_t)t;
	if (!timestamp) time(&timestamp);
	std::string timestr;
	timeToFormattedString(timestamp, gSavedSettings.getString("TimestampFormat"), timestr);

	setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
	setBackgroundVisible(TRUE);
	setBackgroundOpaque(TRUE);

	// TODO: add a color for group notices
	setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") );

	LLIconCtrl* icon;
	LLTextEditor* text;

	const S32 VPAD = 2;
	const S32 TOP = mRect.getHeight() - 32; // Get past the top menu bar
	const S32 BOTTOM_PAD = VPAD * 2;
	const S32 BTN_TOP = BOTTOM_PAD + BTN_HEIGHT + VPAD;
	const S32 RIGHT = mRect.getWidth() - HPAD - HPAD;
	const S32 LINE_HEIGHT = 16;

	const S32 LABEL_WIDTH = 64;
	const S32 ICON_WIDTH = 64;

	S32 y = TOP;
	S32 x = HPAD + HPAD;


	// Title
	LLTextBox* line;

	line = new LLTextBox("title",LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),"Group Notice",LLFontGL::sSansSerifHuge);
	line->setHAlign(LLFontGL::RIGHT);
	line->setFontStyle(LLFontGL::DROP_SHADOW_SOFT);
	line->setBorderVisible(FALSE);
	line->setColor(LLColor4::white);
	line->setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") );
	
	addChild(line);

	y -= llfloor(1.5f*LINE_HEIGHT);

	x += HPAD + HPAD + ICON_WIDTH;

	std::stringstream from;
	from << "Sent by " << from_name << ", " << group_name;

	line = new LLTextBox("group",LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),from.str().c_str(),LLFontGL::sSansSerif);
	line->setFontStyle(LLFontGL::DROP_SHADOW_SOFT);
	line->setHAlign(LLFontGL::RIGHT);
	line->setBorderVisible(FALSE);
	line->setColor(LLColor4::white);
	line->setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") );
	addChild(line);
	
	y -= (LINE_HEIGHT + VPAD);

	LLUUID icon_id(gViewerArt.getString("notify_box_icon.tga"));
	// TODO: change this to be the group icon.
	if (!group_insignia.isNull())
	{
		icon_id = group_insignia;
	}

	x = HPAD + HPAD;

	icon = new LLIconCtrl("icon",
						  LLRect(x, y, x+ICON_WIDTH, y-ICON_WIDTH),
						  icon_id);
	icon->setMouseOpaque(FALSE);
	addChild(icon);

	x += HPAD + HPAD + ICON_WIDTH;
	// If we have inventory with this message, leave room for the name.
	S32 box_bottom = BTN_TOP + (mHasInventory ? (LINE_HEIGHT + 2*VPAD) : 0);

	text = new LLViewerTextEditor("box",
		LLRect(x, y, RIGHT, box_bottom),
		DB_GROUP_NOTICE_MSG_STR_LEN,
		"",
//.........这里部分代码省略.........
开发者ID:Boy,项目名称:netbook,代码行数:101,代码来源:llgroupnotify.cpp


注:本文中的LLTextBox::setHAlign方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。