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()); } }
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(); }
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 */
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); }
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); }
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)); }
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(); }
// 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()); } }
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)); }
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()); } }
void TExpandoMenuBar::DrawBackground(BRect updateRect) { if (fVertical) return; BRect bounds(Bounds()); rgb_color menuColor = ui_color(B_MENU_BACKGROUND_COLOR); rgb_color hilite = tint_color(menuColor, B_DARKEN_1_TINT); rgb_color vlight = tint_color(menuColor, B_LIGHTEN_2_TINT); int32 count = CountItems() - 1; if (count >= 0) bounds.left = ItemAt(count)->Frame().right + 1; else bounds.left = 0; if (be_control_look != NULL) { SetHighColor(tint_color(menuColor, 1.22)); StrokeLine(bounds.LeftTop(), bounds.LeftBottom()); bounds.left++; uint32 borders = BControlLook::B_TOP_BORDER | BControlLook::B_BOTTOM_BORDER | BControlLook::B_RIGHT_BORDER; be_control_look->DrawButtonBackground(this, bounds, bounds, menuColor, 0, borders); } else { SetHighColor(vlight); StrokeLine(bounds.LeftTop(), bounds.RightTop()); StrokeLine(BPoint(bounds.left, bounds.top + 1), bounds.LeftBottom()); SetHighColor(hilite); StrokeLine(BPoint(bounds.left + 1, bounds.bottom), bounds.RightBottom()); } }
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)); } }
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); }
void BIconRule::Draw(BRect updateRect) { int32 count = CountIcons(); if (count == 0) return; rgb_color panelColor = ui_color(B_PANEL_BACKGROUND_COLOR); rgb_color lightColor = tint_color(panelColor, B_DARKEN_1_TINT); rgb_color darkColor = tint_color(lightColor, B_DARKEN_2_TINT); SetHighColor(darkColor); StrokeLine(Bounds().LeftTop(), Bounds().RightTop()); StrokeLine(Bounds().LeftTop(), Bounds().LeftBottom()); SetHighColor(lightColor); StrokeLine(Bounds().LeftBottom(), Bounds().RightBottom()); StrokeLine(Bounds().RightTop(), Bounds().RightBottom()); BRect itemFrame(kEdgeOffset, kBorderOffset, -1, kBorderOffset + 64); for (int32 i = 0; i < count; i++) { BIconItem* item = fIcons.ItemAt(i); float width = StringWidth(item->Label()) + StringWidth(" ") * 2; if (width < 64.0f) width = 64.0f; itemFrame.right = itemFrame.left + width - 1; if (itemFrame.Intersects(updateRect)) { item->SetFrame(itemFrame); item->Draw(); } itemFrame.left = itemFrame.right + kEdgeOffset + 1; } }
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)); }
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())); }
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)); }
//***************************************************** void TimeBarView::Draw(BRect rect) { BRect r = Bounds(); char s[255]; SetLowColor(Prefs.time_back_color); FillRect(r, B_SOLID_LOW); if (Pool.size == 0) return; SetHighColor(64,64,64); StrokeLine(BPoint(r.left, r.top), BPoint(r.right, r.top)); if (Pool.sample_type == NONE) return; int32 w = r.IntegerWidth(); int32 x = (int32)r.left; float b; BFont font; GetFont(&font); font_height fh; font.GetHeight(&fh); float fw = font.StringWidth(" 00:00.000 "); // float t = floor( Pool.l_pointer/Pool.frequency); float t = ( Pool.l_pointer/Pool.frequency); float t_add = (Pool.r_pointer - Pool.l_pointer)/(Pool.frequency*w); float t_marge = t_add * fw; float t_small_marge = t_marge/5.0f; float t_small_bound = t + t_small_marge; float t_bound = t + t_marge; while (w>0){ t += t_add; if (t >= t_bound){ int time = (int)((t-(int)t)*1000); int sec = (int)fmod(t,60); int min = ((int)t)/60; sprintf(s, "%d:%.2d.%.3d", min, sec, time); t_bound += t_marge; b = r.top + 5; SetHighColor(Prefs.time_text_color); DrawString(s, BPoint(x - font.StringWidth(s)/2.0f, r.bottom)); SetHighColor(Prefs.time_marks_color); StrokeLine( BPoint( x, r.top+1 ), BPoint( x, b) ); }else if (t >= t_small_bound){ t_small_bound += t_small_marge; SetHighColor(Prefs.time_small_marks_color); b = r.top + 1; StrokeLine( BPoint( x, r.top+1 ), BPoint( x, b) ); } x ++; w --; } }
//***************************************************** void ToolBarView::Draw(BRect r) { r = Bounds(); SetHighColor(255,255,255); StrokeLine(BPoint(r.left, r.top), BPoint(r.right, r.top)); SetHighColor(64,64,64); StrokeLine(BPoint(r.left, r.bottom), BPoint(r.right, r.bottom)); }
void TestView::Draw(BRect /*updateRect*/) { ArpD(cdb << ADH << "TestView::Draw() " << Name() << endl); BRect frm = Bounds(); StrokeRect(frm); StrokeLine(BPoint(frm.left,frm.top), BPoint(frm.right,frm.bottom)); StrokeLine(BPoint(frm.right,frm.top), BPoint(frm.left,frm.bottom)); }
virtual void Draw(BRect updateRect) { BTextView::Draw(updateRect); BRect rect(fMail.Frame()); StrokeLine(BPoint(rect.left,rect.bottom-2),BPoint(rect.right,rect.bottom-2)); rect = fBugsite.Frame(); StrokeLine(BPoint(rect.left,rect.bottom-2),BPoint(rect.right,rect.bottom-2)); rect = fWebsite.Frame(); StrokeLine(BPoint(rect.left,rect.bottom-2),BPoint(rect.right,rect.bottom-2)); }
void TPanelWindowView::Draw( BRect updateRect ) { BRegion Region; Region.Include(updateRect); ConstrainClippingRegion(&Region); float w, h; w = Bounds().Width(); h = Bounds().Height(); SetHighColor( fColor2 ); FillRect( BRect( 0, 0, h, h ) ); FillRect( BRect( w-h, 0, w, h ) ); FillRect( BRect( h/2, 0, w-(h/2), h/2) ); FillRect( BRect( 0, h/2, w, h ) ); SetHighColor( 196, 196, 176 ); FillRect( BRect( 0, h - 2, w, h ) ); fPanels.Lock(); for ( int i=0; i<fPanels.CountItems(); i++ ) { TInnerPanel *panel = fPanels.ItemAt(i); if ( panel->Frame().Intersects( updateRect ) ) { BRect rect( panel->Frame() ); if ( rect.left < updateRect.left ) rect.left = updateRect.left; if ( rect.right > updateRect.right ) rect.right = updateRect.right; if ( rect.top < updateRect.top ) rect.top = updateRect.top; if ( rect.bottom > updateRect.bottom ) rect.bottom = updateRect.bottom; panel->Draw(rect); } } fPanels.Unlock(); if ( fDrawOuterFrame ) { SetDrawingMode( B_OP_COPY ); SetHighColor( fOuterFrameColor ); BRect bounds = Bounds(); StrokeLine( bounds.LeftTop(), bounds.RightTop() ); StrokeLine( bounds.LeftTop(), bounds.LeftBottom() ); StrokeLine( bounds.RightTop(), bounds.RightBottom() ); } ConstrainClippingRegion(NULL); }
void StatusView::Draw(BRect rect) { SetHighColor(152, 152, 152, 255); StrokeLine(BPoint(0.0, 0.0), BPoint(Bounds().Width(), 0.0)); SetHighColor(255, 255, 255, 255); StrokeLine(BPoint(0.0, 1.0), BPoint(Bounds().Width(), 1.0)); SetHighColor(0, 0, 0, 255); DrawString(_current_message.c_str(), BPoint(2, _height)); }
void ControlView::Draw(BRect updateRect) { BRect rect(Bounds()); SetHighColor(tint_color(ViewColor(), B_LIGHTEN_2_TINT)); StrokeLine(rect.LeftTop(), rect.RightTop()); StrokeLine(rect.LeftTop(), rect.LeftBottom()); SetHighColor(tint_color(ViewColor(), B_DARKEN_2_TINT)); StrokeLine(rect.LeftBottom(), rect.RightBottom()); StrokeLine(rect.RightBottom(), rect.RightTop()); }
void HColorControl::Draw(BRect /*updateRect*/) { BRect r(Bounds()); SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); font_height fh; BFont font; GetFont(&font); font.GetHeight(&fh); BPoint p(3, r.bottom - fh.descent); if (IsFocus()) { SetHighColor(keyboard_navigation_color()); StrokeLine(BPoint(p.x, p.y + 1), BPoint(p.x + StringWidth(fLabel), p.y + 1)); SetHighColor(255, 255, 255); StrokeLine(BPoint(p.x, p.y + 2), BPoint(p.x + StringWidth(fLabel), p.y + 2)); SetHighColor(0, 0, 0); } DrawString(fLabel, p); r.left = r.right - 32; r.bottom -= fh.descent - 2; r.top = r.bottom - 12; FillRect(r, B_SOLID_LOW); r.left += 2; r.top += 2; if (fDown) { SetHighColor(kBlack); StrokeRect(r); r.InsetBy(1, 1); rgb_color c = fColor; c.red >>= 1; c.green >>= 1; c.blue >>= 1; SetHighColor(c); FillRect(r); SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_1_TINT)); r.InsetBy(-1, -1); r.OffsetBy(-1, -1); StrokeLine(r.LeftBottom(), r.LeftTop()); StrokeLine(r.LeftTop(), r.RightTop()); } else {
// Do a little drawing to fit better with BTabView void BottomPrefsView::Draw(BRect rect) { PushState(); BRect bounds = Bounds(); SetHighColor(255, 255, 255, 255); StrokeLine(BPoint(0, 0), BPoint(bounds.right - 1, 0)); StrokeLine(BPoint(0, 0), BPoint(0, bounds.bottom - 1)); SetHighColor(96, 96, 96, 255); StrokeLine(BPoint(bounds.right, 0), BPoint(bounds.right, bounds.bottom)); StrokeLine(BPoint(0, bounds.bottom), BPoint(bounds.right, bounds.bottom)); PopState(); }
void Mover::Draw(BRect rect) { /* BRect r = Bounds(); r.top+=1; r.left+=1; r.right-=1; r.bottom-=1; SetHighColor(192,192,192); FillRect(r); r=Bounds(); SetHighColor(255,255,255); StrokeLine(r.LeftBottom(),r.LeftTop()); StrokeLine(r.LeftTop(),r.RightTop()); SetHighColor(168,168,168); StrokeLine(r.RightTop(),r.RightBottom()); StrokeLine(r.RightBottom(),r.LeftBottom()); SetHighColor(208,208,208); StrokeLine(r.LeftBottom(),r.LeftBottom()); StrokeLine(r.RightTop(),r.RightTop()); */ BRect r = Bounds(); SetHighColor(152,152,152); if (vertical) { StrokeLine(r.LeftTop(),r.LeftBottom()); StrokeLine(r.RightTop()+BPoint(-1,0),r.RightBottom()+BPoint(-1,0)); StrokeLine(r.RightTop(),r.RightBottom()); } else { StrokeLine(r.LeftTop(),r.RightTop()); StrokeLine(r.LeftBottom()+BPoint(0,-1),r.RightBottom()+BPoint(0,-1)); StrokeLine(r.LeftBottom(),r.RightBottom()); } SetHighColor(255,255,255); if (vertical) StrokeLine(r.LeftTop()+BPoint(1,0),r.LeftBottom()+BPoint(1,0)); else StrokeLine(r.LeftTop()+BPoint(0,1),r.RightTop()+BPoint(0,1)); SetHighColor(232,232,232); if (vertical) StrokeLine(r.RightTop()+BPoint(-2,0),r.RightBottom()+BPoint(-2,0)); else StrokeLine(r.LeftBottom()+BPoint(0,-2),r.RightBottom()+BPoint(0,-2)); }
void TestPageView::DrawAfterChildren(BRect updateRect) { // Draw corners marks float width = Bounds().Width(); float height = Bounds().Height(); float minDimension = MIN(width, height); float size = minDimension * 0.05; SetPenSize(3.0); BPoint pt = Bounds().LeftTop(); StrokeLine(pt, BPoint(pt.x + size, pt.y)); StrokeLine(pt, BPoint(pt.x, pt.y + size)); pt = Bounds().RightTop(); StrokeLine(pt, BPoint(pt.x - size, pt.y)); StrokeLine(pt, BPoint(pt.x, pt.y + size)); pt = Bounds().RightBottom(); StrokeLine(pt, BPoint(pt.x - size, pt.y)); StrokeLine(pt, BPoint(pt.x, pt.y - size)); pt = Bounds().LeftBottom(); StrokeLine(pt, BPoint(pt.x + size, pt.y)); StrokeLine(pt, BPoint(pt.x, pt.y - size)); }
/*------------------------------------------------------------------------------*\ ( ) - \*------------------------------------------------------------------------------*/ void BmToolbar::Draw( BRect updateRect) { BRect bounds = Bounds(); SetHighColor( tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_LIGHTEN_1_TINT)); StrokeLine(BPoint(bounds.left, bounds.bottom - 1), BPoint(bounds.left, bounds.top)); StrokeLine(BPoint(bounds.left + 1, bounds.top), BPoint(bounds.right, bounds.top)); SetHighColor( tint_color(HighColor(), B_DARKEN_1_TINT)); StrokeLine(BPoint(bounds.right, bounds.top + 1), BPoint(bounds.right, bounds.bottom - 1)); StrokeLine(BPoint(bounds.left, bounds.bottom), BPoint(bounds.right, bounds.bottom)); }
void LiveTextView::Draw(BRect updateRect) { BTextView::Draw( updateRect ); BRect bounds( Bounds() ); SetHighColor( 184, 184, 184 ); StrokeLine( bounds.RightTop(), bounds.LeftTop() ); StrokeLine( bounds.LeftBottom() ); SetHighColor( 255, 255, 255 ); StrokeLine( bounds.RightBottom() ); StrokeLine( bounds.RightTop() ); bounds.InsetBy( 1.0, 1.0 ); if (IsFocus()) SetHighColor( 0, 0, 229 ); else SetHighColor( 96, 96, 96); StrokeLine( bounds.RightTop(), bounds.LeftTop() ); StrokeLine( bounds.LeftBottom() ); if (IsFocus()) SetHighColor( 0, 0, 229 ); else SetHighColor( 216, 216, 216 ); StrokeLine( bounds.RightBottom() ); StrokeLine( bounds.RightTop() ); }