void ProxyView::DrawSadTab(const char *error) { BBitmap *sadTab = RetrieveBitmap(kSadTabBitmap, BRect(0, 0, 255, 255)); if (Window()->Lock()) { MovePenTo(Bounds().Width() / 2 - 127, Bounds().Height() / 2 - 177); DrawBitmap(sadTab); MovePenTo(Bounds().Width() / 2 - 45, Bounds().Height() / 2 + 55); BFont font; GetFont(&font); font.SetSize(18.0); font.SetFace(B_BOLD_FACE); SetFont(&font, B_FONT_SIZE | B_FONT_FACE); SetLowColor(0, 0, 0); SetHighColor(255, 255, 255); DrawString("Aw, Snap!"); MovePenTo(Bounds().Width() / 2 - 90, Bounds().Height() / 2 + 70); font.SetSize(12.0); font.SetFace(B_REGULAR_FACE); SetFont(&font, B_FONT_SIZE | B_FONT_FACE); DrawString(error); Window()->Unlock(); } }
void LoginView::Draw(BRect rect) { BRect r = Bounds(); BRect iconRect(13.0, 5.0, 45.0, 37.0); rgb_color black = { 0, 0, 0, 255 }; rgb_color gray = ui_color(B_PANEL_BACKGROUND_COLOR); SetViewColor(gray); SetLowColor(gray); FillRect(r, B_SOLID_LOW); SetHighColor(black); SetFont(be_bold_font); SetFontSize(11); MovePenTo(55, 15); DrawString("Login Required"); SetFont(be_plain_font); SetFontSize(10); MovePenTo(55, 28); DrawString("The resource you've specified requires"); MovePenTo(55, 40); DrawString("permission to access it."); MovePenTo(13, 61); DrawString("Resource:"); MovePenTo(70, 61); DrawString(resource); SetDrawingMode(B_OP_ALPHA); SetHighColor(0, 0, 0, 180); SetBlendingMode(B_CONSTANT_ALPHA, B_ALPHA_COMPOSITE); DrawBitmap(icon, iconRect); }
void Draw(BRect rect) { BRect r = Bounds(); BRect iconRect(13.0, 5.0, 45.0, 37.0); rgb_color black = { 0, 0, 0, 255 }; rgb_color gray = ui_color(B_PANEL_BACKGROUND_COLOR); SetViewColor(gray); SetLowColor(gray); FillRect(r, B_SOLID_LOW); SetHighColor(black); SetFont(be_bold_font); SetFontSize(11); MovePenTo(55, 15); DrawString("Connect to Internet Host"); SetFont(be_plain_font); SetFontSize(10); MovePenTo(55, 28); DrawString("Specify the name or address of a computer located"); MovePenTo(55, 40); DrawString("outside your network, such as on the Internet."); SetDrawingMode(B_OP_ALPHA); SetHighColor(0, 0, 0, 180); SetBlendingMode(B_CONSTANT_ALPHA, B_ALPHA_COMPOSITE); DrawBitmap(icon, iconRect); }
void ConsoleHeaderView::Draw(BRect rect) { BRect r = Bounds(); BRect iconRect(13.0, 5.0, 45.0, 37.0); rgb_color black = { 0, 0, 0, 255 }; rgb_color gray = ui_color(B_PANEL_BACKGROUND_COLOR); SetViewColor(gray); SetLowColor(gray); FillRect(r, B_SOLID_LOW); SetHighColor(black); SetFont(be_bold_font); SetFontSize(11); MovePenTo(55, 15); DrawString("BeServed Domain Management Console"); SetFont(be_plain_font); SetFontSize(10); MovePenTo(55, 28); DrawString("Version 1.2.6"); MovePenTo(55, 40); DrawString(""); SetDrawingMode(B_OP_ALPHA); SetHighColor(0, 0, 0, 180); SetBlendingMode(B_CONSTANT_ALPHA, B_ALPHA_COMPOSITE); DrawBitmap(icon, iconRect); }
void GroupPropertiesView::Draw(BRect rect) { BRect r = Bounds(); BRect iconRect(13.0, 5.0, 45.0, 37.0); rgb_color black = { 0, 0, 0, 255 }; rgb_color gray = ui_color(B_PANEL_BACKGROUND_COLOR); SetViewColor(gray); SetLowColor(gray); FillRect(r, B_SOLID_LOW); SetHighColor(black); SetFont(be_bold_font); SetFontSize(11); MovePenTo(55, 15); BString string(group); string += " Properties"; DrawString(string.String()); SetFont(be_plain_font); SetFontSize(10); MovePenTo(55, 28); DrawString("Groups are collections of users that will share certain properties,"); MovePenTo(55, 40); DrawString("such as access to files or network resources."); MovePenTo(13, 121); DrawString("Current Members:"); SetDrawingMode(B_OP_ALPHA); SetHighColor(0, 0, 0, 180); SetBlendingMode(B_CONSTANT_ALPHA, B_ALPHA_COMPOSITE); DrawBitmap(icon, iconRect); }
void MyNetHeaderView::Draw(BRect rect) { BRect r = Bounds(); BRect iconRect(13.0, 5.0, 45.0, 37.0); rgb_color black = { 0, 0, 0, 255 }; rgb_color gray = ui_color(B_PANEL_BACKGROUND_COLOR); SetViewColor(gray); SetLowColor(gray); FillRect(r, B_SOLID_LOW); SetHighColor(black); SetFont(be_bold_font); SetFontSize(11); MovePenTo(55, 15); DrawString("My Network Browser"); SetFont(be_plain_font); SetFontSize(10); MovePenTo(55, 28); DrawString("This utility allows you to connect to remote computers and access"); MovePenTo(55, 40); DrawString("resources, such as files and printers, that others have chosen to share."); SetDrawingMode(B_OP_ALPHA); SetHighColor(0, 0, 0, 180); SetBlendingMode(B_CONSTANT_ALPHA, B_ALPHA_COMPOSITE); DrawBitmap(icon, iconRect); }
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 AboutView::Draw(BRect updateRect) { SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetHighColor(ui_color(B_PANEL_BACKGROUND_COLOR)); BRect r, r2; BPoint p1; r = Bounds(); FillRect(r); p1.x = r.left; p1.y = r.top; DrawBitmap(fBurnBitmap, p1); fViewFont->SetSize(18); fViewFont->SetFace(B_BOLD_FACE); SetFont(fViewFont); p1.x = r.left + 252; p1.y = r.top + 67; MovePenTo(p1); SetHighColor(255,120,255); SetDrawingMode(B_OP_ALPHA); DrawString(VERSION); MovePenTo(p1); SetHighColor(0,0,0); SetDrawingMode(B_OP_ALPHA); DrawString(VERSION); fViewFont->SetSize(20); fViewFont->SetFace(B_REGULAR_FACE); SetFont(fViewFont); p1.x = r.left + 10; p1.y = r.top + 110; MovePenTo(p1); SetHighColor(0, 0, 0); SetDrawingMode(B_OP_ALPHA); DrawString(COPYRIGHT1); p1.x = r.left + 10; p1.y = r.top +140; MovePenTo(p1); SetHighColor(0, 0, 0); SetDrawingMode(B_OP_ALPHA); DrawString(COPYRIGHT2); p1.x = r.left + 205; p1.y = r.bottom - 37; DrawBitmap(fBurnProofBitmap, p1); r2.left = p1.x; r2.top = p1.y; r2.right = p1.x + 180; r2.bottom = p1.y + 32; StrokeRect(r2); p1.x = r.left + 5; p1.y = r.bottom - 65; DrawBitmap(fCDRecordBitmap, p1); r2.left = p1.x; r2.top = p1.y; r2.right = p1.x + 180; r2.bottom = p1.y + 60; StrokeRect(r2); StrokeRect(r); }
void CalcDisplay::Paint(const Rect &update) { Rect cBounds = GetBounds(); DrawFrame(cBounds, FRAME_RECESSED); SetFgColor(0,0,0,0); SetBgColor(get_default_color(COL_NORMAL)); char *text = m_Contents; if(!text) text = "0"; font_height fh; GetFontHeight(&fh); float fontheight = fh.ascender + fh.descender; float baseline = cBounds.top + (cBounds.Height() + 1)/2 - fontheight/2 + fh.ascender; float tw = GetStringWidth(text); MovePenTo(cBounds.right - 3.0f - tw, baseline); DrawString(text); float flagpos = cBounds.left + 5.0f; if(m_Mem) { MovePenTo(flagpos, baseline); DrawString("M"); flagpos += GetStringWidth("M "); } if(m_Inv) { MovePenTo(flagpos, baseline); DrawString("INV"); flagpos += GetStringWidth("INV "); } if(m_Hyp) { MovePenTo(flagpos, baseline); DrawString("HYP"); flagpos += GetStringWidth("HYP "); } if(m_Par != 0) { char bfr[10]; sprintf(bfr, "(%d ", m_Par); MovePenTo(flagpos, baseline); DrawString(bfr); flagpos += GetStringWidth(bfr); } }
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 HTGAvatarView::Draw(BRect updateRect) { if(avatarTweet == NULL) return; SetDrawingMode(B_OP_OVER); SetHighColor(000, 000, 000); MovePenTo(5, 17); DrawString("What's Happening, "); SetHighColor(051,102,152); DrawString(avatarTweet->getScreenName().c_str()); SetHighColor(000, 000, 000); DrawString("?"); //Draw avatar if(!avatarTweet->isDownloadingBitmap() && displayAvatar) { SetDrawingMode(B_OP_ALPHA); DrawBitmapAsync(avatarTweet->getBitmap(), _AvatarBounds()); SetDrawingMode(B_OP_OVER); } }
void CounterView::Draw (BRect updateRect) { BRect MovingRect ( m_MovingDotPoint.x, m_MovingDotPoint.y, m_MovingDotPoint.x + m_MovingDotSize, m_MovingDotPoint.y + m_MovingDotSize); char TempString [40]; if (m_BackingBitmap != NULL) { m_BackingBitmap->Lock (); m_BackingView.SetHighColor (60, 60, 255, 8); m_BackingView.FillRect (m_BndRect); m_BackingView.SetHighColor (255, 255, 0, 255); m_BackingView.MovePenTo (m_TextStartPoint); sprintf (TempString, "%d", m_CurrentCount); m_BackingView.DrawString (TempString); m_BackingView.FillRect (MovingRect); m_BackingView.Sync (); m_BackingBitmap->Unlock (); MovePenTo (0, 0); DrawBitmap (m_BackingBitmap); } }
void RenderView::Draw(BRect updateRect) { static int count = 0; BRect frame = Frame(); // Erase previous drawing (this is the lazy and slow way) FillRect(frame, B_SOLID_LOW); frame.InsetBy(50, 50); StrokeEllipse(frame); if (fInHoverArea) FillRect(fHoverRect); else StrokeRect(fHoverRect); MovePenTo(25, 25); rgb_color color = HighColor(); char str[100]; sprintf(str, "Hello from RenderBoy! Count is %d, high color is RGB(%d, %d, %d)", count, color.red, color.green, color.blue); DrawString(str); // Change the color for next Draw call color.red += 3; color.green += 3; color.blue += 3; SetHighColor(color); count++; }
void Paint(const Rect &cUpdateRect) { SetDrawingMode(DM_COPY); m_pcImage->Draw( Point( 0, 0 ), this ); SetDrawingMode(DM_OVER); font_height fh; GetFontHeight(&fh); MovePenTo(GetBounds().Width()/2 - GetStringWidth(MSG_ABOUTWND_TEXTONE)/2, 2 + fh.ascender); DrawString(MSG_ABOUTWND_TEXTONE); MovePenTo(GetBounds().Width()/2 - GetStringWidth(MSG_ABOUTWND_TEXTTWO)/2, GetBounds().Height() - 2 - fh.descender); DrawString(MSG_ABOUTWND_TEXTTWO); }
void Icon::Paint( const Rect &cUpdateRect ) { EraseRect( cUpdateRect ); if( m_bSelected ) { Rect cUpdateFrame = GetBounds(); cUpdateFrame.top += 2; cUpdateFrame.left += 2; /* XXXKV: This is a hack; why is the height from GetBounds() so large? */ cUpdateFrame.right = m_cSize.x - 2; cUpdateFrame.bottom = m_cSize.y - 2; FillRect( cUpdateFrame, m_sHighlightColor ); /* Round edges */ SetDrawingMode( DM_COPY ); SetFgColor( m_sHighlightColor ); DrawLine( os::Point( cUpdateFrame.left + 2, cUpdateFrame.top - 2 ), os::Point( cUpdateFrame.right - 2, cUpdateFrame.top - 2 ) ); DrawLine( os::Point( cUpdateFrame.left, cUpdateFrame.top - 1 ), os::Point( cUpdateFrame.right, cUpdateFrame.top - 1 ) ); DrawLine( os::Point( cUpdateFrame.left - 2, cUpdateFrame.top + 2 ), os::Point( cUpdateFrame.left - 2, cUpdateFrame.bottom - 2 ) ); DrawLine( os::Point( cUpdateFrame.left - 1, cUpdateFrame.top ), os::Point( cUpdateFrame.left - 1, cUpdateFrame.bottom ) ); DrawLine( os::Point( cUpdateFrame.left + 2, cUpdateFrame.bottom + 2 ), os::Point( cUpdateFrame.right - 2, cUpdateFrame.bottom + 2 ) ); DrawLine( os::Point( cUpdateFrame.left, cUpdateFrame.bottom + 1 ), os::Point( cUpdateFrame.right, cUpdateFrame.bottom + 1 ) ); DrawLine( os::Point( cUpdateFrame.right + 2, cUpdateFrame.top + 2 ), os::Point( cUpdateFrame.right + 2, cUpdateFrame.bottom - 2 ) ); DrawLine( os::Point( cUpdateFrame.right + 1, cUpdateFrame.top ), os::Point( cUpdateFrame.right + 1, cUpdateFrame.bottom ) ); SetFgColor( m_sFgColor ); } SetDrawingMode( DM_BLEND ); /* XXXKV: Will only work with BitmapImage; should use RTTI to find type and handle accordingly */ BitmapImage *pcImage = static_cast<BitmapImage*>( m_pcImage ); Bitmap *pcBitmap = pcImage->LockBitmap(); DrawBitmap( pcBitmap, pcImage->GetBounds(), m_cImageFrame ); pcImage->UnlockBitmap(); /* Draw the icon name */ SetDrawingMode( DM_OVER ); MovePenTo( m_cNamePos ); DrawString( m_cName ); }
void Draw(BRect updateRect) { (void) updateRect; if (_bitmap == NULL) return ; _bitmap->SetBits(_buf, _width * _height * 4, 0, B_RGBA32); MovePenTo(BPoint(0,0)); DrawBitmap(_bitmap); }
void VersionControl::Draw(BRect updateRect) { SetDrawingMode(B_OP_OVER); DrawBitmap(fIcon, BPoint(0, 0)); MovePenTo(fIcon->Bounds().Width() + 5, Bounds().Height() - 4); SetHighColor(0, 0, 0); SetLowColor(255, 255, 255); DrawString(fString->String()); BView::Draw(updateRect); }
void AboutView::Draw( BRect aRect ) { BFont font( be_plain_font ); font.SetSize( 18.0 ); SetFont( &font ); SetDrawingMode( B_OP_OVER ); BString title( APP_NAME " " VERSION ); MovePenTo( ( ( ABOUTWINDOW_RECT.right - ABOUTWINDOW_RECT.left) /2 ) - font.StringWidth( title.String() ) /2 , 20 ); SetHighColor( 255, 255, 255 ); DrawString( APP_NAME " " VERSION ); }
void BenderView::Draw(BRect /*updateRect*/) { MovePenTo(BPoint(2, 30)); DrawString("Welcome to "); SetHighColor(0, 0, 255); DrawString("B"); SetHighColor(255, 0, 0); DrawString("e"); SetHighColor(0, 0, 0); DrawString("nder!"); }
void TElementsSorter::Draw(BRect updateRect) { PushState(); // Draw dummy header to the right of our rightmost TSorter TSorterContainer* sorter = static_cast<TSorterContainer*>(fSorterList->ItemAt( fSorterList->CountItems()-1) ); if (sorter) { BRect bounds = Bounds(); bounds.bottom = bounds.top + kSorterHeight; bounds.left = sorter->Frame().right; if (updateRect.Intersects(bounds) ) { // Fill background SetHighColor(kBeGrey); 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); } } PopState(); }
void KouhoIndexView::Draw( BRect rect ) { BBox::Draw( rect ); for ( long i = 1; i < 17 ; i++ ) { MovePenTo( INDEXVIEW_SIDE_MARGIN + 2, lineHeight * i - fontOffset ); if ( hideNumber ) DrawString( "•" ); else DrawChar( '0' + i ); } }
void MsgView::Paint(const os::Rect& r) { FillRect(r, GetBgColor()); float y=20.0f; for(uint i=0;i<lines.size();++i) { MovePenTo(10,y); DrawString(lines[i].c_str()); y+=lineHeight; } }
void PickUserView::Draw(BRect rect) { BRect r = Bounds(); rgb_color black = { 0, 0, 0, 255 }; rgb_color gray = ui_color(B_PANEL_BACKGROUND_COLOR); SetViewColor(gray); SetLowColor(gray); FillRect(r, B_SOLID_LOW); SetHighColor(black); SetFont(be_plain_font); SetFontSize(10); MovePenTo(10, 12); DrawString("Select a user from the list below, then click the OK button."); MovePenTo(10, 24); DrawString("Click the Cancel button to abort the selection."); MovePenTo(13, 43); DrawString("Users:"); }
void BGLView::Draw(BRect updateRect) { if (fRenderer) { _LockDraw(); fRenderer->Draw(updateRect); _UnlockDraw(); return; } // TODO: auto-size and center the string MovePenTo(8, 32); DrawString("No OpenGL renderer available!"); }
void TEnclosuresView::Draw(BRect where) { BView::Draw(where); SetHighColor(0, 0, 0); SetLowColor(ViewColor()); font_height fh; GetFontHeight(&fh); MovePenTo(ENCLOSE_TEXT_H, ENCLOSE_TEXT_V + fh.ascent); DrawString(ENCLOSE_TEXT); }
// Draw void TestView::Draw(BRect updateRect) { int32 count = fMouseSamples.CountItems(); if (count > 0) { BPoint* p = (BPoint*)fMouseSamples.ItemAtFast(0); MovePenTo(*p); } for (int32 i = 0; i < count; i++) { BPoint* p = (BPoint*)fMouseSamples.ItemAtFast(i); StrokeLine(*p); } }
void ProjectStatus::Draw(BRect updateRect) { BRect bounds(Bounds()); rgb_color highColor = HighColor(); SetHighColor(tint_color(ViewColor(), B_DARKEN_2_TINT)); StrokeLine(bounds.LeftTop(), bounds.RightTop()); SetHighColor(ui_color(B_PANEL_TEXT_COLOR)); MovePenTo(3, fBaseline); char s[32]; DrawString(fMsg); }
void StatusView::Draw(BRect updateRect) { font_height fontHeight; GetFontHeight(&fontHeight); float height = fontHeight.ascent + fontHeight.descent; if (be_control_look != NULL) be_control_look->DrawLabel(this, fFreqString.String(), this->ViewColor(), 0, BPoint(0, height)); else { MovePenTo(0, height); DrawString(fFreqString.String()); } }
void TBitmapScanner::Tick() { if( !fWorking ) return; if( !IsPenInPosition() ) return; fBitmap->SetPixel( fX, fY, TColor( GetLightIntensity() ) ); /* if( fY % 2 == 0 ) { if( fX < (fBitmap->GetWidth() - 1) ) fX++; else fY++; } else { if( fX > 0 ) fX--; else fY++; } if( fY < fBitmap->GetHeight() ) MovePenTo( TPlotterPoint( fX * fXArm->GetResolution(), fY * fYArm->GetResolution() ) ); else Stop(); */ if( fX < (fBitmap->GetWidth() - 1) ) fX++; else { fY++; fX = 0; } if( fY < fBitmap->GetHeight() ) MovePenTo( TPlotterPoint( fX * fXArm->GetResolution(), fY * fYArm->GetResolution() ) ); else Stop(); }
void Renamer::Draw(BRect updateRect) { BRect LittleRect = Bounds().InsetByCopy(1.0, 1.0); SetHighColor(170, 170, 190); MovePenTo(LittleRect.RightTop()); StrokeLine(LittleRect.LeftTop()); StrokeLine(LittleRect.LeftBottom()); SetHighColor(220, 220, 225); StrokeLine(LittleRect.RightBottom()); StrokeLine(LittleRect.RightTop()); SetHighColor(60, 80, 150); StrokeRect(Bounds()); }