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


C++ LLView::getRect方法代码示例

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


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

示例1: draw

void AIHTTPView::draw()
{
  for_each(mServiceBars.begin(), mServiceBars.end(), KillView());
  mServiceBars.clear();
	  
  if (mGLHTTPHeaderBar)
  {
	removeChild(mGLHTTPHeaderBar);
	mGLHTTPHeaderBar->die();
  }

  CreateServiceBar functor(this);
  AIPerService::copy_forEach(functor);

  sTime_40ms = get_clock_count() * AICurlPrivate::curlthread::HTTPTimeout::sClockWidth_40ms;

  mGLHTTPHeaderBar = new AIGLHTTPHeaderBar("gl httpheader bar", this);
  addChild(mGLHTTPHeaderBar);

  reshape(mWidth, getRect().getHeight(), TRUE);

  for (child_list_const_iter_t child_iter = getChildList()->begin(); child_iter != getChildList()->end(); ++child_iter)
  {
	LLView* viewp = *child_iter;
	if (viewp->getRect().mBottom < 0)
	{
	  viewp->setVisible(FALSE);
	}
  }

  LLContainerView::draw();
}
开发者ID:ArxNet,项目名称:SingularityViewer,代码行数:32,代码来源:aihttpview.cpp

示例2: fitWithTopInfoBar

void LLChicletBar::fitWithTopInfoBar()
{
	LLPanelTopInfoBar& top_info_bar = LLPanelTopInfoBar::instance();

	LLRect rect = getRect();
	S32 width = rect.getWidth();

	if (top_info_bar.getVisible())
	{
		S32 delta = top_info_bar.calcScreenRect().mRight - calcScreenRect().mLeft;
		if (delta < 0 && rect.mLeft < llabs(delta))
			delta = -rect.mLeft;
		rect.setLeftTopAndSize(rect.mLeft + delta, rect.mTop, rect.getWidth(), rect.getHeight());
		width = rect.getWidth() - delta;
	}
	else
	{
		LLView* parent = getParent();
		if (parent)
		{
			LLRect parent_rect = parent->getRect();
			rect.setLeftTopAndSize(0, rect.mTop, rect.getWidth(), rect.getHeight());
			width = parent_rect.getWidth();
		}
	}

	setRect(rect);
	LLPanel::reshape(width, rect.getHeight(), false);
}
开发者ID:Belxjander,项目名称:Kirito,代码行数:29,代码来源:llchicletbar.cpp

示例3: childGetRect

bool LLPanel::childGetRect(const std::string& id, LLRect& rect) const
{
	LLView* child = findChild<LLView>(id);
	if (child)
	{
		rect = child->getRect();
		return true;
	}
	return false;
}
开发者ID:otwstephanie,项目名称:hpa2oar,代码行数:10,代码来源:llpanel.cpp

示例4: log

void LLChicletBar::log(LLView* panel, const std::string& descr)
{
	if (NULL == panel) return;
	LLView* layout = panel->getParent();
	LL_DEBUGS("Chiclet Bar Rects") << descr << ": "
		<< "panel: " << panel->getName()
		<< ", rect: " << panel->getRect()
		<< " layout: " << layout->getName()
		<< ", rect: " << layout->getRect()
		<< LL_ENDL;
}
开发者ID:Belxjander,项目名称:Kirito,代码行数:11,代码来源:llchicletbar.cpp

示例5: handleMouseDown

BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask)
{
	if (mDisplayBar)
	{
		if (mDisplayHistory)
		{
			mDisplayBar = FALSE;
			mDisplayHistory = FALSE;
		}
		else
		{
			mDisplayHistory = TRUE;
		}
	}
	else
	{
		mDisplayBar = TRUE;
	}

	LLView* parent = getParent();
	parent->reshape(parent->getRect().getWidth(), parent->getRect().getHeight(), FALSE);

	// save view mode
	if (mSetting.length() > 0)
	{
		S32 mode = 0;
		if (mDisplayBar)
		{
			mode |= STAT_BAR_FLAG;
		}
		if (mDisplayHistory)
		{
			mode |= STAT_HISTORY_FLAG;
		}

		LLUI::sConfigGroup->setS32(mSetting, mode);
	}
	
	
	return TRUE;
}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:41,代码来源:llstatbar.cpp

示例6: onCommitWidth

// static
void LLFloaterEditUI::onCommitWidth(LLUICtrl* ctrl, void* data)
{
	LLView* view = LLView::sEditingUIView;
	if (!view) return;

	LLSpinCtrl* spin = (LLSpinCtrl*)ctrl;
	F32 width = spin->get();
	LLRect r = view->getRect();
	r.mRight = r.mLeft + (S32)width;
	view->reshape(r.getWidth(), r.getHeight());
	view->setRect(r);
}
开发者ID:9skunks,项目名称:imprudence,代码行数:13,代码来源:llfloatereditui.cpp

示例7: postBuild

BOOL LLFloaterJoystick::postBuild()
{		
	F32 range = gSavedSettings.getBOOL("Cursor3D") ? 1024.f : 2.f;
	LLUIString axis = getString("Axis");
	LLUIString joystick = getString("JoystickMonitor");

	// use this child to get relative positioning info; we'll place the
	// joystick monitor on its right, vertically aligned to it.
	LLView* child = getChild<LLView>("FlycamAxisScale1");
	LLRect rect;

	if (child)
	{
		LLRect r = child->getRect();
		rect = LLRect(350, r.mTop, r.mRight + 200, 0);
	}


	LLStatView::Params params;
	params.name("axis values");
	params.rect(rect);
	params.show_label(true);
	params.label(joystick);
	mAxisStatsView = LLUICtrlFactory::create<LLStatView>(params);

	for (U32 i = 0; i < 6; i++)
	{
		axis.setArg("[NUM]", llformat("%d", i));
		std::string stat_name(llformat("Joystick axis %d", i));
		mAxisStats[i] = new LLStat(stat_name,4);
		mAxisStatsBar[i] = mAxisStatsView->addStat(axis, mAxisStats[i]);
		mAxisStatsBar[i]->mMinBar = -range;
		mAxisStatsBar[i]->mMaxBar = range;
		mAxisStatsBar[i]->mLabelSpacing = range * 0.5f;
		mAxisStatsBar[i]->mTickSpacing = range * 0.25f;			
	}

	addChild(mAxisStatsView);
	
	mCheckJoystickEnabled = getChild<LLCheckBoxCtrl>("enable_joystick");
	childSetCommitCallback("enable_joystick",onCommitJoystickEnabled,this);
	mCheckFlycamEnabled = getChild<LLCheckBoxCtrl>("JoystickFlycamEnabled");
	childSetCommitCallback("JoystickFlycamEnabled",onCommitJoystickEnabled,this);

	getChild<LLUICtrl>("Default")->setCommitCallback(boost::bind(&LLFloaterJoystick::onClickDefault, this, _2));
	childSetAction("cancel_btn", onClickCancel, this);
	childSetAction("ok_btn", onClickOK, this);

	refresh();
	return TRUE;
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:51,代码来源:llfloaterjoystick.cpp

示例8: handleToolTip

BOOL LLViewerTextEditor::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen)
{
	for (child_list_const_iter_t child_iter = getChildList()->begin();
			child_iter != getChildList()->end(); ++child_iter)
	{
		LLView *viewp = *child_iter;
		S32 local_x = x - viewp->getRect().mLeft;
		S32 local_y = y - viewp->getRect().mBottom;
		if( viewp->pointInView(local_x, local_y) 
			&& viewp->getVisible() 
			&& viewp->getEnabled()
			&& viewp->handleToolTip(local_x, local_y, msg, sticky_rect_screen ) )
		{
			return TRUE;
		}
	}

	if( mSegments.empty() )
	{
		return TRUE;
	}

	const LLTextSegment* cur_segment = getSegmentAtLocalPos( x, y );
	if( cur_segment )
	{
		BOOL has_tool_tip = FALSE;
		if( cur_segment->getStyle()->getIsEmbeddedItem() )
		{
			LLWString wtip;
			has_tool_tip = getEmbeddedItemToolTipAtPos(cur_segment->getStart(), wtip);
			msg = wstring_to_utf8str(wtip);
		}
		else
		{
			has_tool_tip = cur_segment->getToolTip( msg );
		}
		if( has_tool_tip )
		{
			// Just use a slop area around the cursor
			// Convert rect local to screen coordinates
			S32 SLOP = 8;
			localPointToScreen( 
				x - SLOP, y - SLOP, 
				&(sticky_rect_screen->mLeft), &(sticky_rect_screen->mBottom) );
			sticky_rect_screen->mRight = sticky_rect_screen->mLeft + 2 * SLOP;
			sticky_rect_screen->mTop = sticky_rect_screen->mBottom + 2 * SLOP;
		}
	}
	return TRUE;
}
开发者ID:Ratany,项目名称:SingularityViewer,代码行数:50,代码来源:llviewertexteditor.cpp

示例9: collapseIfPosChanged

void LLExpandableTextBox::collapseIfPosChanged()
{
	if(mExpanded)
	{
		LLView* parentp = getParent();
		LLRect parent_rect = parentp->getRect();
		parentp->localRectToOtherView(parent_rect, &parent_rect, getRootView());

		if(parent_rect.mLeft != mParentRect.mLeft 
			|| parent_rect.mTop != mParentRect.mTop)
		{
			collapseTextBox();
		}
	}
}
开发者ID:OS-Development,项目名称:VW.Zen,代码行数:15,代码来源:llexpandabletextbox.cpp

示例10: onClickFilterChoice

// static
void LLFloaterMessageLog::onClickFilterChoice(void* user_data)
{
	LLMenuGL* menu = new LLMenuGL(LLStringUtil::null);
	menu->addChild(new LLMenuItemCallGL("No filter", onClickFilterMenu, NULL, (void*)""));
	menu->addChild(new LLMenuItemCallGL("Fewer spammy messages", onClickFilterMenu, NULL, (void*)"!StartPingCheck !CompletePingCheck !PacketAck !SimulatorViewerTimeMessage !SimStats !AgentUpdate !AgentAnimation !AvatarAnimation !ViewerEffect !CoarseLocationUpdate !LayerData !CameraConstraint !ObjectUpdateCached !RequestMultipleObjects !ObjectUpdate !ObjectUpdateCompressed !ImprovedTerseObjectUpdate !KillObject !ImagePacket !SendXferPacket !ConfirmXferPacket !TransferPacket"));
	menu->addChild(new LLMenuItemCallGL("Fewer spammy messages (minus sound crap)", onClickFilterMenu, NULL, (void*)"!StartPingCheck !CompletePingCheck !PacketAck !SimulatorViewerTimeMessage !SimStats !AgentUpdate !AgentAnimation !AvatarAnimation !ViewerEffect !CoarseLocationUpdate !LayerData !CameraConstraint !ObjectUpdateCached !RequestMultipleObjects !ObjectUpdate !ObjectUpdateCompressed !ImprovedTerseObjectUpdate !KillObject !ImagePacket !SendXferPacket !ConfirmXferPacket !TransferPacket !SoundTrigger !AttachedSound !PreloadSound"));
	menu->addChild(new LLMenuItemCallGL("Object updates", onClickFilterMenu, NULL, (void*)"ObjectUpdateCached ObjectUpdate ObjectUpdateCompressed ImprovedTerseObjectUpdate KillObject RequestMultipleObjects"));
	menu->addChild(new LLMenuItemCallGL("Abnormal", onClickFilterMenu, NULL, (void*)"Invalid TestMessage AddCircuitCode NeighborList AvatarTextureUpdate SimulatorMapUpdate SimulatorSetMap SubscribeLoad UnsubscribeLoad SimulatorReady SimulatorPresentAtLocation SimulatorLoad SimulatorShutdownRequest RegionPresenceRequestByRegionID RegionPresenceRequestByHandle RegionPresenceResponse UpdateSimulator LogDwellTime FeatureDisabled LogFailedMoneyTransaction UserReportInternal SetSimStatusInDatabase SetSimPresenceInDatabase OpenCircuit CloseCircuit DirFindQueryBackend DirPlacesQueryBackend DirClassifiedQueryBackend DirLandQueryBackend DirPopularQueryBackend GroupNoticeAdd DataHomeLocationRequest DataHomeLocationReply DerezContainer ObjectCategory ObjectExportSelected StateSave ReportAutosaveCrash AgentAlertMessage NearestLandingRegionRequest NearestLandingRegionReply NearestLandingRegionUpdated TeleportLandingStatusChanged ConfirmEnableSimulator KickUserAck SystemKickUser AvatarPropertiesRequestBackend UpdateParcel RemoveParcel MergeParcel LogParcelChanges CheckParcelSales ParcelSales StartAuction ConfirmAuctionStart CompleteAuction CancelAuction CheckParcelAuctions ParcelAuctions ChatPass EdgeDataPacket SimStatus ChildAgentUpdate ChildAgentAlive ChildAgentPositionUpdate ChildAgentDying ChildAgentUnknown AtomicPassObject KillChildAgents ScriptSensorRequest ScriptSensorReply DataServerLogout RequestInventoryAsset InventoryAssetResponse TransferInventory TransferInventoryAck EventLocationRequest EventLocationReply MoneyTransferBackend RoutedMoneyBalanceReply SetStartLocation NetTest SetCPURatio SimCrashed NameValuePair RemoveNameValuePair UpdateAttachment RemoveAttachment EmailMessageRequest EmailMessageReply InternalScriptMail ScriptDataRequest ScriptDataReply InviteGroupResponse TallyVotes LiveHelpGroupRequest LiveHelpGroupReply GroupDataUpdate LogTextMessage CreateTrustedCircuit ParcelRename SystemMessage RpcChannelRequest RpcChannelReply RpcScriptRequestInbound RpcScriptRequestInboundForward RpcScriptReplyInbound ScriptMailRegistration Error"));
	menu->updateParent(LLMenuGL::sMenuContainer);
	menu->setCanTearOff(FALSE);
	LLView* buttonp = sInstance->getChild<LLView>("filter_choice_btn");
	S32 x = buttonp->getRect().mLeft;
	S32 y = buttonp->getRect().mBottom;
	LLMenuGL::showPopup(sInstance, menu, x, y);
}
开发者ID:Apelsin,项目名称:EffervescenceViewer,代码行数:16,代码来源:llfloatermessagelog.cpp

示例11: handleMouseDown

BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask)
{
	if (mDisplayBar)
	{
		if (mDisplayHistory)
		{
			mDisplayBar = FALSE;
			mDisplayHistory = FALSE;
		}
		else
		{
			mDisplayHistory = TRUE;
		}
	}
	else
	{
		mDisplayBar = TRUE;
	}

	LLView* parent = getParent();
	parent->reshape(parent->getRect().getWidth(), parent->getRect().getHeight(), FALSE);

	return FALSE;
}
开发者ID:OS-Development,项目名称:VW.Kirsten,代码行数:24,代码来源:llstatbar.cpp

示例12: onOverflowButtonClicked

void LLPanelAvatarProfile::onOverflowButtonClicked()
{
    if (!mProfileMenu->toggleVisibility())
        return;

    LLView* btn = getChild<LLView>("overflow_btn");

    if (mProfileMenu->getButtonRect().isEmpty())
    {
        mProfileMenu->setButtonRect(btn);
    }
    mProfileMenu->updateParent(LLMenuGL::sMenuContainer);

    LLRect rect = btn->getRect();
    LLMenuGL::showPopup(this, mProfileMenu, rect.mRight, rect.mTop);
}
开发者ID:jimjesus,项目名称:kittyviewer,代码行数:16,代码来源:llpanelavatar.cpp

示例13: reshape

// virtual
void LLPreviewTexture::reshape(S32 width, S32 height, BOOL called_from_parent)
{
	LLPreview::reshape(width, height, called_from_parent);

	LLRect dim_rect;
	LLView *pView = findChildView( "dimensions" );
	
	if( pView )
		dim_rect = pView->getRect();

	S32 horiz_pad = 2 * (LLPANEL_BORDER_WIDTH + PREVIEW_PAD) + PREVIEW_RESIZE_HANDLE_SIZE;

	// add space for dimensions and aspect ratio
	S32 info_height = dim_rect.mTop + CLIENT_RECT_VPAD;

	LLRect client_rect(horiz_pad, getRect().getHeight(), getRect().getWidth() - horiz_pad, 0);
	client_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD);
	client_rect.mBottom += PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height ;

	S32 client_width = client_rect.getWidth();
	S32 client_height = client_rect.getHeight();

	if (mAspectRatio > 0.f)
	{
		if(mAspectRatio > 1.f)
		{
			client_height = llceil((F32)client_width / mAspectRatio);
			if(client_height > client_rect.getHeight())
			{
				client_height = client_rect.getHeight();
				client_width = llceil((F32)client_height * mAspectRatio);
			}
		}
		else//mAspectRatio < 1.f
		{
			client_width = llceil((F32)client_height * mAspectRatio);
			if(client_width > client_rect.getWidth())
			{
				client_width = client_rect.getWidth();
				client_height = llceil((F32)client_width / mAspectRatio);
			}
		}
	}

	mClientRect.setLeftTopAndSize(client_rect.getCenterX() - (client_width / 2), client_rect.getCenterY() +  (client_height / 2), client_width, client_height);

}
开发者ID:Krazy-Bish-Margie,项目名称:Thunderstorm,代码行数:48,代码来源:llpreviewtexture.cpp

示例14: pointInChild

	bool pointInChild(const std::string& name,S32 x,S32 y)
	{
		LLUICtrl* child = findChild<LLUICtrl>(name);
		if(!child)
			return false;
		
		LLView* parent = child->getParent();
		if(parent!=this)
		{
			x-=parent->getRect().mLeft;
			y-=parent->getRect().mBottom;
		}

		S32 local_x = x - child->getRect().mLeft ;
		S32 local_y = y - child->getRect().mBottom ;
		return 	child->pointInView(local_x, local_y);
	}
开发者ID:jimjesus,项目名称:kittyviewer,代码行数:17,代码来源:llchathistory.cpp

示例15: show

// static
void LLFloaterJoystick::show(void*)
{
	if (sInstance)
	{
		sInstance->open();	/*Flawfinder: ignore*/
	}
	else
	{
		LLFloaterJoystick* floater = new LLFloaterJoystick();

		gUICtrlFactory->buildFloater(floater, "floater_joystick.xml");
		F32 range = gSavedSettings.getBOOL("FlycamAbsolute") ? 1024.f : 2.f;
		LLUIString axis = floater->childGetText("Axis");
		LLUIString joystick = floater->childGetText("JoystickMonitor");

		LLView* child = floater->getChildByName("ZoomLabel");
		LLRect rect;

		if (child)
		{
			LLRect r = child->getRect();
			LLRect f = floater->getRect();
			rect = LLRect(150, r.mTop, r.mRight, 0);
		}

		floater->mAxisStats = new LLStatView("axis values", joystick, "", rect);
		floater->mAxisStats->setDisplayChildren(TRUE);

		for (U32 i = 0; i < 6; i++)
		{
			axis.setArg("[NUM]", llformat("%d", i));
			floater->mAxis[i] = new LLStat(4);
			floater->mAxisBar[i] = floater->mAxisStats->addStat(axis, floater->mAxis[i]);
			floater->mAxisBar[i]->mMinBar = -range;
			floater->mAxisBar[i]->mMaxBar = range;
			floater->mAxisBar[i]->mLabelSpacing = range * 0.5f;
			floater->mAxisBar[i]->mTickSpacing = range * 0.25f;			
		}

		

		floater->addChild(floater->mAxisStats);
		floater->open();	/*Flawfinder: ignore*/
	}
}
开发者ID:Boy,项目名称:netbook,代码行数:46,代码来源:llcameraview.cpp


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