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


C++ BRect::SetLeftTop方法代码示例

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


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

示例1: getSelBounds

void MainView::getSelBounds(BRect& bounds)
{
	BPoint upper_left, lower_right;
	
	upper_left.x = upper_left.y = 999999;
	lower_right.x = lower_right.y = 0;
	
	for(int i = 0; i < selected_fields.CountItems(); i++) {
		BView *field = (BView *)selected_fields.ItemAt(i);
		BRect frame = field->Frame();
		BPoint tl = frame.LeftTop();
		BPoint br = frame.RightBottom();
		
		if(tl.x < upper_left.x) {
			upper_left.x = tl.x;
		}
		if(br.x > lower_right.x) {
			lower_right.x = br.x;
		}
		if(tl.y < upper_left.y) {
			upper_left.y = tl.y;
		}
		if(br.y > lower_right.y) {
			lower_right.y = br.y;
		}
	}
	
	bounds.SetLeftTop(upper_left);
	bounds.SetRightBottom(lower_right);
}
开发者ID:brennanos,项目名称:XFile-Haiku,代码行数:30,代码来源:MainView.cpp

示例2: UpdateNeedle

void AnalogView::UpdateNeedle(short cpuTime)
{
	BRect	updateRect;
	BRect	rt;

	if(cpuTime != oldCPUTime)
	{
		rt.SetRightBottom(param.meterCenter);
		rt.SetLeftTop(angle[oldCPUTime].arry);
		if(rt.left > rt.right)
		{
			double tmp = rt.left;
			rt.left = rt.right;
			rt.right = tmp;
		}

		DrawBitmap(panel, rt, rt);

		const rgb_color kNeedleColor = {0,0,0,0};
		//const rgb_color kNeedleColor = {0,255,0,0};
		this->SetHighColor(kNeedleColor);

		StrokeLine(param.meterCenter, angle[cpuTime].arry);
	}
	Sync();
	oldCPUTime = cpuTime;
}
开发者ID:diger,项目名称:AnalogPulse,代码行数:27,代码来源:AnalogView.cpp

示例3: BMessage

_MediaBar_::_MediaBar_(
	BRect		frame,
	MediaView	*owner)
		: BView(frame, B_EMPTY_STRING, B_FOLLOW_BOTTOM | B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW)
{
	fOwner = owner;

	BRect buttonRect;
	buttonRect.SetLeftTop(BPoint(kMediaBarInset, kMediaBarInset + 1.0));
	buttonRect.SetRightBottom(buttonRect.LeftTop() + kPlayButtonSize);
	
	fPlayPauseButton = new PlayPauseButton(buttonRect,
										   B_EMPTY_STRING,
										   kPlayButtonBitmapBits, 
										   kPressedPlayButtonBitmapBits, 
										   kDisabledPlayButtonBitmapBits,
										   kPlayingPlayButtonBitmapBits, 
										   kPressedPlayingPlayButtonBitmapBits,
										   kPausedPlayButtonBitmapBits, 
										   kPressedPausedPlayButtonBitmapBits,
										   new BMessage(msg_PlayPause), 
										   ' ', 
										   0, 
										   B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
	AddChild(fPlayPauseButton);
	fPlayPauseButton->SetPaused();

	BRect sliderRect = Bounds();
	sliderRect.left = buttonRect.right;
	sliderRect.InsetBy(kMediaBarInset * 4, kMediaBarInset);	

	fMediaSlider = new _MediaSlider_(sliderRect, fOwner);
	AddChild(fMediaSlider);

	SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
}
开发者ID:HaikuArchives,项目名称:Resourcer,代码行数:36,代码来源:MediaView.cpp


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