// /// Paints the system box. // void TTinyCaption::PaintSysBox(TDC& dc, TRect& boxRect, bool /*pressed*/) { // Dont paint over the left & top borders // boxRect.left++; boxRect.top++; // Fill the box with 3d face // dc.TextRect(boxRect, TColor::Sys3dFace); // Draw the ventilator (sysmenu) box, with shadow // TPoint begPt = boxRect.TopLeft().OffsetBy(2, (boxRect.Height()-3)/2); TRect ventRect(begPt, TSize(boxRect.Width()-5, 3)); // Draw shadow down and right 1 // dc.TextRect(ventRect.left+1, ventRect.top+1, ventRect.right+1, ventRect.bottom+1, TColor::Sys3dShadow); // Draw ventilator rectangle // TBrush btnTextBr(TColor::SysBtnText); dc.FrameRect(ventRect, btnTextBr); // Draw white interior of ventilator // dc.TextRect(ventRect.left+1, ventRect.top+1, ventRect.right-1, ventRect.top+2, TColor::Sys3dHilight); dc.TextRect(boxRect.right, boxRect.top, boxRect.right+1, boxRect.bottom, TColor::SysBtnText); }
// /// Paints a blank button. // void TTinyCaption::PaintButton(TDC& dc, TRect& r, bool pressed) { TBrush winFrameBr(TColor::SysWindowFrame); // dc.OWLFastWindowFrame(winFrameBr, r, 1, 1); dc.FrameRect(r, winFrameBr); r.Inflate(-1,-1); dc.TextRect(r, TColor::Sys3dFace); if (r.Width() > 4 && r.Height() > 4) { if (pressed) { dc.TextRect(r.left, r.top, r.right, r.top+1, TColor::Sys3dShadow); dc.TextRect(r.left, r.top+1, r.left+1, r.bottom, TColor::Sys3dShadow); } else { dc.TextRect(r.left, r.top, r.right-1, r.top+1, TColor::Sys3dHilight); dc.TextRect(r.left, r.top+1, r.left+1, r.bottom-1, TColor::Sys3dHilight); dc.TextRect(r.right-1, r.top+1, r.right, r.bottom, TColor::Sys3dShadow); dc.TextRect(r.left+1, r.bottom-1, r.right-1, r.bottom, TColor::Sys3dShadow); } } }
void TFlatPainter::Paint(TDC& dc, TRect& rect) { TWindow* wnd = TYPESAFE_DOWNCAST(this, TWindow); if(!wnd) return; if(IsSet(fpMouseIn) && wnd->IsWindowEnabled()){ // We draw the "tracked" situation #ifdef TEST TBrush brush (TColor::LtRed); #else TBrush brush (TColor::Sys3dFace); #endif dc.FrameRect(rect, brush); rect.Inflate(-1, -1); dc.FrameRect(rect, brush); rect.Inflate(-1, -1); dc.FrameRect(rect, brush); rect.Inflate(1, 1); TUIBorder::DrawEdge(dc, rect, TUIBorder::SunkenOuter, TUIBorder::Rect); } else{ // We draw the "untracked" situation #ifdef TEST TBrush brush(TColor::LtBlue); TBrush brush2(TColor::LtGreen); #else TBrush brush(TColor::Sys3dFace); TBrush brush2(TColor::SysWindow); #endif dc.FrameRect(rect,brush); rect.Inflate(-1, -1); dc.FrameRect(rect,brush); rect.Inflate(-1, -1); dc.FrameRect(rect, brush2); } }