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


C++ StrokeLine函数代码示例

本文整理汇总了C++中StrokeLine函数的典型用法代码示例。如果您正苦于以下问题:C++ StrokeLine函数的具体用法?C++ StrokeLine怎么用?C++ StrokeLine使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: bounds

void
TExpandoMenuBar::DrawBackground(BRect)
{
	BRect bounds(Bounds());
	rgb_color menuColor = ui_color(B_MENU_BACKGROUND_COLOR);
	rgb_color hilite = tint_color(menuColor, B_DARKEN_1_TINT);
	rgb_color dark = tint_color(menuColor, B_DARKEN_2_TINT);
	rgb_color vlight = tint_color(menuColor, B_LIGHTEN_2_TINT);
	int32 last = CountItems() - 1;
	float start;

	if (last >= 0) 
		start = ItemAt(last)->Frame().right + 1;
	else 
		start = 0;

	
	if (!fVertical) {
		SetHighColor(vlight);
		StrokeLine(BPoint(start, bounds.top+1), bounds.RightTop() + BPoint(0,1));
		StrokeLine(BPoint(start, bounds.top+1), BPoint(start, bounds.bottom));
		SetHighColor(hilite);
		StrokeLine(BPoint(start+1, bounds.bottom), bounds.RightBottom());
	}
}
开发者ID:Ithamar,项目名称:cosmoe,代码行数:25,代码来源:ExpandoMenuBar.cpp

示例2: PushState

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

示例3: b

void PStatus::Draw(BRect updateRect)
{
	BRect b(Bounds());
	
	SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_2_TINT));
	StrokeLine(b.LeftTop(), b.RightTop());
	b.top++;

	font_height fh;
	be_plain_font->GetHeight(&fh);

	SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_1_TINT));
	StrokeLine(b.RightBottom(), b.LeftBottom());
	StrokeLine(b.RightTop(), b.RightBottom());
	
	SetHighColor(kWhite);
	StrokeLine(b.LeftTop(), b.RightTop());
	StrokeLine(b.LeftTop(), b.LeftBottom());

	b.InsetBy(1, 1);
	SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
	SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
	FillRect(b, B_SOLID_LOW);

	SetHighColor(kBlack);
	MovePenTo(3, fBaseline);
	char s[32];
	int line = fText->Offset2Line(fOffset);
	sprintf(s, "%d,%d", line + 1, fText->Offset2Column(fOffset) + 1);
	DrawString(s);
} /* PStatus::Draw */
开发者ID:jscipione,项目名称:Paladin,代码行数:31,代码来源:PStatus.cpp

示例4: HighColor

void TextDiffView::Draw(BRect updateRect)
{
	rgb_color oldHighColor = HighColor();
	float oldPenSize = PenSize();
	
	BRect bounds = Bounds();
	float leftWidth = floor((bounds.Width() + 1 - B_H_SCROLL_BAR_HEIGHT - PANE_SPLITTER_WIDTH) / 2);
	if (updateRect.left <= leftWidth + 1)
	{
		SetPenSize(0);
		SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_2_TINT));
		StrokeLine(BPoint(leftWidth, updateRect.top), BPoint(leftWidth, updateRect.bottom), B_SOLID_HIGH);
		SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_LIGHTEN_1_TINT));
		StrokeLine(BPoint(leftWidth + 1, updateRect.top), BPoint(leftWidth + 1, updateRect.bottom), B_SOLID_HIGH);
	}
	if (updateRect.right >= leftWidth + PANE_SPLITTER_WIDTH - 2)
	{
		SetPenSize(0);
		SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_1_TINT));
		StrokeLine(BPoint(leftWidth + PANE_SPLITTER_WIDTH - 2, updateRect.top), BPoint(leftWidth + PANE_SPLITTER_WIDTH - 2, updateRect.bottom), B_SOLID_HIGH);
		SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_2_TINT));
		StrokeLine(BPoint(leftWidth + PANE_SPLITTER_WIDTH - 1, updateRect.top), BPoint(leftWidth + PANE_SPLITTER_WIDTH - 1, updateRect.bottom), B_SOLID_HIGH);
	}
	
	SetPenSize(oldPenSize);
	SetHighColor(oldHighColor);
}
开发者ID:ModeenF,项目名称:ponpokodiff,代码行数:27,代码来源:TextDiffView.cpp

示例5: GetFont

void
KeyControl::DrawKey(BRect r, const char* c)
{
	BFont font;
	GetFont(&font);

	SetHighColor(240,240,240);

	StrokeLine(BPoint(r.left, r.top), BPoint(r.right-1, r.top));
	StrokeLine(BPoint(r.left, r.top+1), BPoint(r.left, r.bottom));
	SetHighColor(128,128,128);

	StrokeLine(BPoint(r.left+1, r.bottom), BPoint(r.right, r.bottom));
	StrokeLine(BPoint(r.right, r.bottom-1), BPoint(r.right, r.top));
	SetHighColor(192,192,192);

	r.InsetBy(1,1);
	
	FillRect(r);
	SetHighColor(0,0,0);
	SetLowColor(192,192,192);

	DrawString(c,
		BPoint((r.left+r.right)/2.0f-font.StringWidth(c)/2.0f +1.0f,
		r.top+font.Size()));

	SetLowColor(255,255,255);
}
开发者ID:Barrett17,项目名称:Faber,代码行数:28,代码来源:Keymap.cpp

示例6: Bounds

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

示例7: Bounds

void CCrossHairView::Draw(BRect updateRect)
{
	BRect bounds = Bounds();

	SetHighColor(CColor::Transparent);

	FillRect(bounds);

	BRect bigCircle, smallCircle;
	
	float width  = bounds.Width();
	float height = bounds.Height();
	
	bigCircle = bounds.InsetByCopy(5, 5);
	smallCircle = bounds.InsetByCopy(10, 10);

	SetHighColor(CColor::White);
	StrokeEllipse(bigCircle.OffsetByCopy(1, 1));
	StrokeEllipse(smallCircle.OffsetByCopy(1, 1));
	
	StrokeLine(BPoint(2, height/2+1), BPoint(width, height/2+1));
	StrokeLine(BPoint(width/2+1, 2), BPoint(width/2+1, height));
	
	SetHighColor(CColor::Black);
	StrokeEllipse(bigCircle);
	StrokeEllipse(smallCircle);
	
	StrokeLine(BPoint(1, height/2), BPoint(width-1, height/2));
	StrokeLine(BPoint(width/2, 1), BPoint(width/2, height-1));
	
	Sync();
}
开发者ID:HaikuArchives,项目名称:TaskManager,代码行数:32,代码来源:SelectTeamWindow.cpp

示例8: b

// Draw
void
BoolValueView::Draw(BRect updateRect)
{
	BRect b(Bounds());
	// focus indication
	if (IsFocus()) {
		SetHighColor(ui_color(B_KEYBOARD_NAVIGATION_COLOR));
		StrokeRect(b);
		b.InsetBy(1.0, 1.0);
	}
	// background
	FillRect(b, B_SOLID_LOW);

	// checkmark box
	rgb_color crossOutline = kBlack;
	rgb_color crossColor = ui_color(B_KEYBOARD_NAVIGATION_COLOR);

	if (!fEnabled) {
		crossOutline = tint_color(crossOutline, B_LIGHTEN_2_TINT);
		crossColor = tint_color(crossColor, B_LIGHTEN_2_TINT);
	}

	SetHighColor(crossOutline);
	b = fCheckBoxRect;
	StrokeRect(b);

	// checkmark
	if (fProperty && fProperty->Value()) {
		SetHighColor(crossColor);
		b.InsetBy(3.0, 3.0);
		SetPenSize(2.0);
		StrokeLine(b.LeftTop(), b.RightBottom());
		StrokeLine(b.LeftBottom(), b.RightTop());
	}
}
开发者ID:mmanley,项目名称:Antares,代码行数:36,代码来源:BoolValueView.cpp

示例9: Draw

	virtual void Draw(BRect updateRect)
	{
		BRegion region;
		region.Include(BRect(20, 20, 40, 40));
		region.Include(BRect(30, 30, 80, 80));
		ConstrainClippingRegion(&region);

		SetHighColor(55, 255, 128, 255);
		FillRect(BRect(0, 0, 100, 100));

		PushState();
			SetOrigin(15, 15);
	
			ConstrainClippingRegion(&region);
	
			SetHighColor(155, 255, 128, 255);
			FillRect(BRect(0, 0, 100, 100));
	
//			ConstrainClippingRegion(NULL);
	
			SetHighColor(0, 0, 0, 255);
			StrokeLine(BPoint(2, 2), BPoint(80, 80));
			SetHighColor(255, 0, 0, 255);
			StrokeLine(BPoint(2, 2), BPoint(4, 2));
		PopState();

		SetHighColor(0, 0, 0, 255);
		StrokeLine(BPoint(4, 2), BPoint(82, 80));
	}
开发者ID:mmanley,项目名称:Antares,代码行数:29,代码来源:main.cpp

示例10: SetHighColor

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

示例11: Bounds

void SeqSplitterView::Draw(BRect clip)
{
	inherited::Draw(clip);
	if (mDrawingFlags&NO_DRAWING_FLAG) return;
	
	BRect		b = Bounds();
	if (mDirection == B_VERTICAL) {
		SetHighColor( 175, 175, 175 );
		StrokeLine( BPoint(1, clip.top), BPoint(1, clip.bottom) );
		SetHighColor( 0, 0, 0 );
		StrokeLine( BPoint(0, clip.top), BPoint(0, clip.bottom) );
		StrokeLine( BPoint(b.right, clip.top), BPoint(b.right, clip.bottom) );
		if (mDrawingFlags&CAP_ENDS_FLAG && clip.top <= b.top)
			StrokeLine(BPoint(0, b.top), BPoint(b.right, b.top));
		if (mDrawingFlags&CAP_ENDS_FLAG && clip.bottom >= b.bottom)
			StrokeLine(BPoint(0, b.bottom), BPoint(b.right, b.bottom));
	} else {
		SetHighColor( 175, 175, 175 );
		StrokeLine( BPoint(clip.left, 1), BPoint(clip.right, 1) );
		SetHighColor( 0, 0, 0 );
		StrokeLine( BPoint(clip.left, 0), BPoint(clip.right, 0) );
		StrokeLine( BPoint(clip.left, b.bottom), BPoint(clip.right, b.bottom) );
		if (mDrawingFlags&CAP_ENDS_FLAG && clip.left <= b.left)
			StrokeLine(BPoint(b.left, 0), BPoint(b.left,  b.bottom));
		if (mDrawingFlags&CAP_ENDS_FLAG && clip.right >= b.right)
			StrokeLine(BPoint(b.right, 0), BPoint(b.right, b.bottom));
	}
}
开发者ID:tgkokk,项目名称:Sequitur,代码行数:28,代码来源:SeqSplitterView.cpp

示例12: HighColor

void TVideoCaptureToolbar::Draw(BRect updateRect)
{
	// Setup environment
	rgb_color saveColor = HighColor();

	// Fill background
	SetHighColor(kBlueGrey);
	FillRect(Bounds());

	// Frame it
	BPoint endPt;
	SetHighColor(kWhite);
	MovePenTo(Bounds().left, Bounds().top+1);
	endPt.Set( Bounds().right, Bounds().top+1 );
	StrokeLine(endPt);

	SetHighColor(kMediumGrey);
	MovePenTo(Bounds().left, Bounds().bottom-1);
	endPt.Set( Bounds().right, Bounds().bottom-1 );
	StrokeLine(endPt);

	SetHighColor(kBlack);
	MovePenTo(Bounds().left, Bounds().top);
	endPt.Set( Bounds().right, Bounds().top );
	StrokeLine(endPt);
	MovePenTo(Bounds().left, Bounds().bottom);
	endPt.Set( Bounds().right, Bounds().bottom );
	StrokeLine(endPt);

	// Restore Environment
	SetHighColor(saveColor);
}
开发者ID:Barrett17,项目名称:UltraDV,代码行数:32,代码来源:TVideoCaptureToolbar.cpp

示例13: ViewColor

void
AppGroupView::Draw(BRect updateRect)
{
	rgb_color menuColor = ViewColor();
	BRect bounds = Bounds();
	rgb_color hilite = tint_color(menuColor, B_DARKEN_1_TINT);
	rgb_color vlight = tint_color(menuColor, B_LIGHTEN_2_TINT);
	bounds.bottom = bounds.top + kHeaderSize;

	// Draw the header background
	SetHighColor(tint_color(menuColor, 1.22));
	SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
	StrokeLine(bounds.LeftTop(), bounds.LeftBottom());
	uint32 borders = BControlLook::B_TOP_BORDER
		| BControlLook::B_BOTTOM_BORDER | BControlLook::B_RIGHT_BORDER;

	be_control_look->DrawButtonBackground(this, bounds, bounds, menuColor,
		0, borders);

	// Draw the buttons
	fCollapseRect.top = (kHeaderSize - kExpandSize) / 2;
	fCollapseRect.left = kEdgePadding * 2;
	fCollapseRect.right = fCollapseRect.left + 1.5 * kExpandSize;
	fCollapseRect.bottom = fCollapseRect.top + kExpandSize;

	fCloseRect = bounds;
	fCloseRect.top = (kHeaderSize - kExpandSize) / 2;
	fCloseRect.right -= kEdgePadding * 2;
	fCloseRect.left = fCloseRect.right - kCloseSize;
	fCloseRect.bottom = fCloseRect.top + kCloseSize;

	uint32 arrowDirection = fCollapsed
		? BControlLook::B_DOWN_ARROW : BControlLook::B_UP_ARROW;
	be_control_look->DrawArrowShape(this, fCollapseRect, fCollapseRect,
		LowColor(), arrowDirection, 0, B_DARKEN_3_TINT);

	SetPenSize(kPenSize);

	// Draw the dismiss widget
	BRect closeCross = fCloseRect;
	closeCross.InsetBy(kSmallPadding, kSmallPadding);
	rgb_color detailCol = ui_color(B_CONTROL_BORDER_COLOR);
	detailCol = tint_color(detailCol, B_LIGHTEN_2_TINT);

	StrokeRoundRect(fCloseRect, kSmallPadding, kSmallPadding);
	StrokeLine(closeCross.LeftTop(), closeCross.RightBottom());
	StrokeLine(closeCross.RightTop(), closeCross.LeftBottom());

	// Draw the label
	SetHighColor(ui_color(B_PANEL_TEXT_COLOR));
	BString label = fLabel;
	if (fCollapsed)
		label << " (" << fInfo.size() << ")";

	SetFont(be_bold_font);

	DrawString(label.String(), BPoint(fCollapseRect.right + 2 * kEdgePadding,
				fCloseRect.bottom));
}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:59,代码来源:AppGroupView.cpp

示例14: SetHighColor

void MainView::drawCrosshairs(const BPoint& point)
{
	SetHighColor(ViewColor());
	FillRect(Bounds());
	SetHighColor(0,0,0);
	StrokeLine(BPoint(0, point.y), BPoint(Bounds().IntegerWidth(), point.y));
	StrokeLine(BPoint(point.x, 0), BPoint(point.x, Bounds().IntegerHeight()));
}
开发者ID:brennanos,项目名称:XFile-Haiku,代码行数:8,代码来源:MainView.cpp

示例15: StrokeLine

void ScrollViewCorner::Draw(BRect Update)
{
	if(Update.bottom >= B_H_SCROLL_BAR_HEIGHT)
		StrokeLine(BPoint(0.0,B_H_SCROLL_BAR_HEIGHT),BPoint(B_V_SCROLL_BAR_WIDTH,B_H_SCROLL_BAR_HEIGHT));
	if(Update.right >= B_V_SCROLL_BAR_WIDTH)
		StrokeLine(BPoint(B_V_SCROLL_BAR_WIDTH,0.0),
			BPoint(B_V_SCROLL_BAR_WIDTH,B_H_SCROLL_BAR_HEIGHT-1.0));
}
开发者ID:HaikuArchives,项目名称:BeAccessible,代码行数:8,代码来源:ScrollViewCorner.cpp


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