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


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

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


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

示例1: Draw

void BarView :: Draw( BRect r )
{
	r = Bounds() ;
	BeginLineArray( 4 ) ;

	AddLine( r.LeftTop() ,
	         ( fOrientation == B_VERTICAL ? r.LeftBottom() : r.RightTop() ) ,
	         Colours::Grey40 ) ;
	AddLine( r.RightBottom() ,
	         ( fOrientation == B_VERTICAL ? r.RightTop() : r.LeftBottom() ) ,
	         Colours::Grey40 ) ;

	if( fOrientation == B_VERTICAL )
		r.InsetBy(1,0) ;
	else
		r.InsetBy(0,1) ;
	
	AddLine( r.LeftTop() ,
	         ( fOrientation == B_VERTICAL ? r.LeftBottom() : r.RightTop() ) ,
	         Colours::White ) ;
	AddLine( r.RightBottom() ,
	         ( fOrientation == B_VERTICAL ? r.RightTop() : r.LeftBottom() ) ,
	         Colours::Grey25 ) ;
	
	EndLineArray() ;
}
开发者ID:HaikuArchives,项目名称:TraX,代码行数:26,代码来源:BarView.cpp

示例2: if

void
BScrollView::Draw(BRect updateRect)
{
	if (fBorder == B_PLAIN_BORDER) {
		SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_2_TINT));
		StrokeRect(Bounds());
		return;
	} else if (fBorder != B_FANCY_BORDER)
		return;

	BRect bounds = Bounds();
	SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_2_TINT));
	StrokeRect(bounds.InsetByCopy(1, 1));

	if (fHighlighted) {
		SetHighColor(ui_color(B_NAVIGATION_BASE_COLOR));
		StrokeRect(bounds);
	} else {
		SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_1_TINT));
		StrokeLine(bounds.LeftBottom(), bounds.LeftTop());
		bounds.left++;
		StrokeLine(bounds.LeftTop(), bounds.RightTop());
	
		SetHighColor(ui_color(B_SHINE_COLOR));
		StrokeLine(bounds.LeftBottom(), bounds.RightBottom());
		bounds.top++;
		bounds.bottom--;
		StrokeLine(bounds.RightBottom(), bounds.RightTop());
	}
}
开发者ID:Ithamar,项目名称:cosmoe,代码行数:30,代码来源:ScrollView.cpp

示例3: Draw

void HDlogView::Draw(BRect update)
{
	BView::Draw(update);

	if (fLines.size() > 0)
	{
		vector<BRect>::iterator ri;
		
		BeginLineArray(fLines.size() * 2);
		for (ri = fLines.begin(); ri != fLines.end(); ri++)
		{
			BRect r = *ri;
			if (r.Width() > r.Height())
			{
				AddLine(r.LeftTop(), r.RightTop(), tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_1_TINT));
				AddLine(r.LeftBottom(), r.RightBottom(), kWhite);
			}
			else
			{
				AddLine(r.LeftTop(), r.LeftBottom(), tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_1_TINT));
				AddLine(r.RightTop(), r.RightBottom(), kWhite);
			}
		}
		EndLineArray();
	}
} /* HDlogView::Draw */
开发者ID:jscipione,项目名称:Paladin,代码行数:26,代码来源:HDialogViews.cpp

示例4: Draw

/*------------------------------------------------------------------------------*\
	( )
		-	
\*------------------------------------------------------------------------------*/
void BmCaption::Draw( BRect updateRect) {
	BRect r = Bounds();
	if (mHighlight) {
		if (BeamOnDano)
			SetLowColor( keyboard_navigation_color());
		else {
			rgb_color highlightCol = {255, 217, 121, 255};
			SetLowColor( highlightCol);
		}
	}
	else
		SetLowColor( ui_color( B_PANEL_BACKGROUND_COLOR));
#ifndef __HAIKU__
	FillRect( r.InsetByCopy(1.0, 1.0), B_SOLID_LOW);
#else
	FillRect( BRect(r.top + 1, r.left + 1, r.right, r.bottom - 1), B_SOLID_LOW);
#endif
	SetHighColor( ui_color( B_SHINE_COLOR));
	StrokeLine( BPoint(0.0,1.0), BPoint(r.right,1.0));
	StrokeLine( BPoint(0.0,1.0), r.LeftBottom());
	SetHighColor( BmWeakenColor( B_SHADOW_COLOR, BeShadowMod));
	if (BeamOnDano)
		StrokeLine( r.RightTop(), r.RightBottom());
#ifndef __HAIKU__
	else
		// looks better on R5, as it blends with scrollbar:
		StrokeLine( r.RightTop(), r.RightBottom(), B_SOLID_LOW);
#endif
	StrokeLine( r.LeftTop(), r.RightTop());
	StrokeLine( r.LeftBottom(), r.RightBottom());

	SetHighColor( ui_color( B_PANEL_TEXT_COLOR));
	font_height fInfo;
	BFont captionFont;
	GetFont(&captionFont);
	captionFont.GetHeight( &fInfo);
	float offset = (1.0f+r.Height()-(fInfo.ascent+fInfo.descent))/2.0f;
	float freeWidth = r.Width();
	if (mHighlight && mHighlightLabel.Length()) {
		freeWidth -= StringWidth(mHighlightLabel.String())+2;
		BPoint pos( 2.0, fInfo.ascent+offset);
		DrawString( mHighlightLabel.String(), pos);
	}
	const char* text = mText.String();
	float width;
	while(1) {
		width = StringWidth(text);
		if (width+4.0 < freeWidth)
			break;
		text++;
		while((*text & 0xc0) == 0x80)
			text++;		// skip UTF8 subsequence chars
		if (!*text)
			break;
	}
	BPoint pos( r.Width()-width-2.0f, fInfo.ascent+offset);
	DrawString( text, pos);
}
开发者ID:HaikuArchives,项目名称:Beam,代码行数:62,代码来源:BmCaption.cpp

示例5: BoundsForMode

void
DialogPane::ResizeParentWindow(int32 from, int32 to)
{
	if (!Window())
		return;

	BRect oldBounds = BoundsForMode(from);
	BRect newBounds = BoundsForMode(to);

	BPoint by = oldBounds.RightBottom() - newBounds.RightBottom();
	if (by != BPoint(0, 0))
		Window()->ResizeBy(by.x, by.y);
}
开发者ID:HaikuArchives,项目名称:LibWalter,代码行数:13,代码来源:DialogPane.cpp

示例6:

void
_MediaSlider_::UpdateThumb(
	bool	force)
{
	fBitmap->Lock();

	BRect bounds = fOffscreenView->Bounds();

	bounds.left += 2.0;
	bounds.right -= kThumbWidth + 3.0;

	BRect thumbRect = fThumbRect;
	thumbRect.OffsetTo(bounds.left + (bounds.right * ((float)fCurTime / (float)fTotalTime)), thumbRect.top);

	if ((!force) && (thumbRect == fThumbRect)) {
		fBitmap->Unlock();
		return;
	}

	fOffscreenView->SetLowColor(kSliderBackgroundColor);
	fOffscreenView->FillRect(fThumbRect, B_SOLID_LOW);

	BRect drawRect = fThumbRect | thumbRect;
	fThumbRect = thumbRect;

	fOffscreenView->SetHighColor(kBlack);
	fOffscreenView->StrokeRect(thumbRect, B_SOLID_HIGH);
	thumbRect.InsetBy(1.0, 1.0);

	fOffscreenView->BeginLineArray(4);
	fOffscreenView->AddLine(thumbRect.RightTop(), thumbRect.RightBottom(), kThumbDarkColor);
	fOffscreenView->AddLine(thumbRect.RightBottom(), thumbRect.LeftBottom(), kThumbDarkColor);
	fOffscreenView->AddLine(thumbRect.LeftBottom(), thumbRect.LeftTop(), kThumbLightColor);
	fOffscreenView->AddLine(thumbRect.LeftTop(), thumbRect.RightTop(), kThumbLightColor);
	fOffscreenView->EndLineArray();	
	thumbRect.InsetBy(1.0, 1.0);

	fOffscreenView->SetHighColor(kThumbBackgroundColor);
	fOffscreenView->FillRect(thumbRect, B_SOLID_HIGH);

	fOffscreenView->Sync();
	fBitmap->Unlock();

	BPoint	drawLoc(0.0, (Bounds().Height() - kSliderHeight) / 2);
	BRect	dstRect = drawRect;
	dstRect.OffsetBy(drawLoc);
	DrawBitmap(fBitmap, drawRect, dstRect);
}
开发者ID:HaikuArchives,项目名称:VirtualBeLive,代码行数:48,代码来源:MediaSlider.cpp

示例7: Bounds

void
_MediaBar_::Draw(
	BRect	updateRect)
{
	BRect		bounds = Bounds();
	rgb_color	viewColor = ViewColor();
	rgb_color	light = {255, 255, 255, 255};
	rgb_color	dark = tint_color(viewColor, B_DARKEN_3_TINT);

	BeginLineArray(4);
	AddLine(bounds.RightTop(), bounds.RightBottom(), dark);
	AddLine(bounds.RightBottom(), bounds.LeftBottom(), dark);
	AddLine(bounds.LeftBottom(), bounds.LeftTop(), light);
	AddLine(bounds.LeftTop(), bounds.RightTop(), light);
	EndLineArray();
}
开发者ID:HaikuArchives,项目名称:Resourcer,代码行数:16,代码来源:MediaView.cpp

示例8: DrawItem

void CMessageItem::DrawItem(BView *owner, BRect bounds, bool /*complete*/)
{
	if (IsSelected())
		owner->SetLowColor(gColor[kColorSelection]);
	else
		owner->SetLowColor(gColor[kColorLow]);
	
	owner->FillRect(bounds, B_SOLID_LOW);
	
	owner->SetHighColor(gColor[kColorText]);
	
	font_height fi;

	be_plain_font->GetHeight(&fi);
	owner->SetFont(be_plain_font);
	
	BBitmap bm(BRect(0, 0, 11, 11), B_COLOR_8_BIT);
	switch (fKind)
	{
		case msgInfo:		bm.SetBits(fInfoIcon, 144, 0, B_COLOR_8_BIT); break;
		case msgWarning:	bm.SetBits(fWarningIcon, 144, 0, B_COLOR_8_BIT); break;
		case msgError:		bm.SetBits(fErrorIcon, 144, 0, B_COLOR_8_BIT); break;
	}

	owner->SetDrawingMode(B_OP_OVER);
	owner->DrawBitmap(&bm, BPoint(bounds.left + 1, bounds.top + 1));
	owner->SetDrawingMode(B_OP_COPY);
	
	owner->DrawString(fMsg, BPoint(bounds.left + 15, bounds.bottom - 1 - fi.descent));
	owner->StrokeLine(bounds.LeftBottom(), bounds.RightBottom(), B_MIXED_COLORS);
} // CMessageItem::DrawItem
开发者ID:HaikuArchives,项目名称:Pe,代码行数:31,代码来源:CMessageItem.cpp

示例9:

// SetOrigin
void
DragCornerState::SetOrigin(BPoint origin)
{
	fOldTransform = *fParent;

	fOldTransform.InverseTransform(&origin);

	BRect box = fParent->Box();
	switch (fCorner) {
		case LEFT_TOP_CORNER:
			fOffsetFromCorner = origin - box.LeftTop();
			break;
		case RIGHT_TOP_CORNER:
			fOffsetFromCorner = origin - box.RightTop();
			break;
		case LEFT_BOTTOM_CORNER:
			fOffsetFromCorner = origin - box.LeftBottom();
			break;
		case RIGHT_BOTTOM_CORNER:
			fOffsetFromCorner = origin - box.RightBottom();
			break;
	}

	DragState::SetOrigin(origin);
}
开发者ID:tgkokk,项目名称:Clockwerk,代码行数:26,代码来源:DragStates.cpp

示例10: Draw

void DropView::Draw(BRect update)
{
	BRect bounds = Bounds();
	//draw our bevel
	// top and left edges
	SetHighColor(150,150,150,255); // dark grey
	StrokeLine(bounds.LeftTop(), bounds.RightTop());
	StrokeLine(bounds.LeftTop(), bounds.LeftBottom());
	// bottom and right edges
	SetHighColor(250,250,250,255); // lightest grey
	StrokeLine(bounds.RightBottom(), BPoint(bounds.right, bounds.top - 1.0));
	StrokeLine(bounds.RightBottom(), BPoint(bounds.left - 1.0, bounds.bottom));
	
	// draw our highlight, or don't
	if (drawHighlight)
	{
		SetHighColor(highlightColor);
		StrokeRect(highlightRect);
	}
	
	// draw our icon
	if (hasOccupant)
	{
		SetDrawingMode(B_OP_OVER);
		DrawBitmap(iconBitmap, BPoint(3.0, 3.0));
	}
	else
		DrawBitmap(iconBitmapDark, BPoint(3.0, 3.0));
}
开发者ID:carriercomm,项目名称:BeOS-Projects,代码行数:29,代码来源:DropView.cpp

示例11: lt

void
DrawState::Transform(BRegion* region) const
{
	if (fCombinedScale == 1.0) {
		region->OffsetBy(fCombinedOrigin.x, fCombinedOrigin.y);
	} else {
		// TODO: optimize some more
		BRegion converted;
		int32 count = region->CountRects();
		for (int32 i = 0; i < count; i++) {
			BRect r = region->RectAt(i);
			BPoint lt(r.LeftTop());
			BPoint rb(r.RightBottom());
			// offset to bottom right corner of pixel before transformation
			rb.x++;
			rb.y++;
			// apply transformation
			Transform(&lt.x, &lt.y);
			Transform(&rb.x, &rb.y);
			// reset bottom right to pixel "index"
			rb.x--;
			rb.y--;
			// add rect to converted region
			// NOTE/TODO: the rect would not have to go
			// through the whole intersection test process,
			// it is guaranteed not to overlap with any rect
			// already contained in the region
			converted.Include(BRect(lt, rb));
		}
		*region = converted;
	}
}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:32,代码来源:DrawState.cpp

示例12: 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

示例13: buttonRect

void
AppGroupView::_DrawCloseButton(const BRect& updateRect)
{
	PushState();
	BRect closeRect = fCloseRect;

	rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
	float tint = B_DARKEN_2_TINT;

	if (fCloseClicked) {
		BRect buttonRect(closeRect.InsetByCopy(-4, -4));
		be_control_look->DrawButtonFrame(this, buttonRect, updateRect,
			base, base,
			BControlLook::B_ACTIVATED | BControlLook::B_BLEND_FRAME);
		be_control_look->DrawButtonBackground(this, buttonRect, updateRect,
			base, BControlLook::B_ACTIVATED);
		tint *= 1.2;
		closeRect.OffsetBy(1, 1);
	}

	base = tint_color(base, tint);
	SetHighColor(base);
	SetPenSize(2);
	StrokeLine(closeRect.LeftTop(), closeRect.RightBottom());
	StrokeLine(closeRect.LeftBottom(), closeRect.RightTop());
	PopState();
}
开发者ID:garodimb,项目名称:haiku,代码行数:27,代码来源:AppGroupView.cpp

示例14: r

/*****************************************************************************
 * DragSortableListView::Draw
 *****************************************************************************/
void
DragSortableListView::Draw( BRect updateRect )
{
    int32 firstIndex = IndexOf( updateRect.LeftTop() );
    int32 lastIndex = IndexOf( updateRect.RightBottom() );
    if ( firstIndex >= 0 )
    {
        if ( lastIndex < firstIndex )
            lastIndex = CountItems() - 1;
        // update rect contains items
        BRect r( updateRect );
        for ( int32 i = firstIndex; i <= lastIndex; i++)
        {
            r = ItemFrame( i );
            DrawListItem( this, i, r );
        }
        updateRect.top = r.bottom + 1.0;
        if ( updateRect.IsValid() )
        {
            SetLowColor( 255, 255, 255, 255 );
            FillRect( updateRect, B_SOLID_LOW );
        }
    }
    else
    {
        SetLowColor( 255, 255, 255, 255 );
        FillRect( updateRect, B_SOLID_LOW );
    }
    // drop anticipation indication
    if ( fDropRect.IsValid() )
    {
        SetHighColor( 255, 0, 0, 255 );
        StrokeRect( fDropRect );
    }
}
开发者ID:forthyen,项目名称:SDesk,代码行数:38,代码来源:ListViews.cpp

示例15: DrawItem

void NetListItem::DrawItem(BView *owner, BRect itemRect, bool drawEverything = false)
{
	rgb_color bgColor = {255, 255, 255, 255};
	switch(fType)
	{
		case INFO_EVENT:
			bgColor.blue = 220;
		break;
		case DATA_RECEIVED_EVENT:
			bgColor.red = 128;
			bgColor.green = 128;
		break;
		case DATA_SENT_EVENT:
			bgColor.green = 128;
			bgColor.blue = 128;
		break;
		default:
			bgColor = ui_color(B_PANEL_BACKGROUND_COLOR);
		break;
	}

	owner->SetHighColor(bgColor);
	owner->FillRect(itemRect);
			
	rgb_color tintedColor = tint_color(bgColor, B_DARKEN_2_TINT);
	owner->SetHighColor(tintedColor);
	owner->StrokeLine(itemRect.LeftBottom(), itemRect.RightBottom());
	owner->StrokeLine(itemRect.RightTop(), itemRect.RightBottom());
	
	tintedColor = tint_color(bgColor, B_LIGHTEN_2_TINT);
	owner->SetHighColor(tintedColor);
	owner->StrokeLine(itemRect.LeftTop(), itemRect.RightTop());
	owner->StrokeLine(itemRect.LeftTop(), itemRect.LeftBottom());
	
	owner->SetLowColor(bgColor);
	owner->SetHighColor(0, 0, 0, 255);
	
	BPoint stringPos = itemRect.LeftTop();
	stringPos.x += 4;
	stringPos.y += fFontAscent + 2;
	
	for(int lineNum = 0; fStartChar[lineNum] > -1; lineNum++)
	{ 
		owner->DrawString(&fText[fStartChar[lineNum]], fLineLen[lineNum], stringPos);
		stringPos.y += fLineHeight;
	}
}
开发者ID:thinkpractice,项目名称:bme,代码行数:47,代码来源:NetListItem.cpp


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