本文整理汇总了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());
}
}
示例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();
}
示例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 */
示例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);
}
示例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);
}
示例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));
}
示例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();
}
示例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());
}
}
示例9: Draw
virtual void Draw(BRect updateRect)
{
BRegion region;
region.Include(BRect(20, 20, 40, 40));
region.Include(BRect(30, 30, 80, 80));
ConstrainClippingRegion(®ion);
SetHighColor(55, 255, 128, 255);
FillRect(BRect(0, 0, 100, 100));
PushState();
SetOrigin(15, 15);
ConstrainClippingRegion(®ion);
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));
}
示例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());
}
}
示例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));
}
}
示例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);
}
示例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));
}
示例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()));
}
示例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));
}