void DrawRect(RenderContext *ctx, Rect2Di rect, Color c) { // "Normalize" the rectangle, so that we don't draw empty corners. Rect2Di r = Normalize(rect); DrawSolidRect(ctx, Rect2Di(r.x, r.y, r.width, 1), c); DrawSolidRect(ctx, Rect2Di(r.x, r.y, 1, r.height), c); DrawSolidRect(ctx, Rect2Di(r.x, r.y + r.height - 1, r.width, 1), c); DrawSolidRect(ctx, Rect2Di(r.x + r.width - 1, r.y, 1, r.height), c); }
void CTreemap::RenderRectangle(CDC *pdc, const CRect& rc, const double *surface, DWORD color) { double brightness = m_options.brightness; if ((color & COLORFLAG_MASK) != 0) { DWORD flags = (color & COLORFLAG_MASK); color= CColorSpace::MakeBrightColor(color, PALETTE_BRIGHTNESS); if ((flags & COLORFLAG_DARKER) != 0) { brightness*= 0.66; } else { brightness*= 1.2; if (brightness > 1.0) brightness= 1.0; } } if (IsCushionShading()) { DrawCushion(pdc, rc, surface, color, brightness); } else { DrawSolidRect(pdc, rc, color, brightness); } }
void GuiList::Draw() { if (!IsVisible()) { return; } // This rectangle bounds the height of the list and the widest item. // This is not necessarily the size of the list box, which may be bigger or smaller! Rect r = GetRect(this); // Draw bg - TODO just the parts not covered by child items AmjuGL::Disable(AmjuGL::AMJU_TEXTURE_2D); PushColour(); AmjuGL::SetColour(1, 1, 1, 1); DrawSolidRect(r); PopColour(); AmjuGL::Enable(AmjuGL::AMJU_TEXTURE_2D); GuiComposite::Draw(); // Border AmjuGL::Disable(AmjuGL::AMJU_TEXTURE_2D); PushColour(); AmjuGL::SetColour(0, 0, 0, 1); DrawRect(r); PopColour(); AmjuGL::Enable(AmjuGL::AMJU_TEXTURE_2D); }
void GuiKeyboard::Draw() { PushColour(); static const float G = 0.5f; AmjuGL::SetColour(Colour(G, G, G, 1)); AmjuGL::Disable(AmjuGL::AMJU_TEXTURE_2D); Rect r = GetRect(this); DrawSolidRect(r); AmjuGL::Enable(AmjuGL::AMJU_TEXTURE_2D); PopColour(); GuiWindow::Draw(); }
void wxStdRenderer::DrawBackground(wxDC& dc, const wxColour& col, const wxRect& rect, int WXUNUSED(flags), wxWindow *window) { wxColour colBg; if (col.Ok()) { colBg = col; } else if (window) { colBg = m_scheme->GetBackground(window); } else { colBg = wxSCHEME_COLOUR(m_scheme, CONTROL); } DrawSolidRect(dc, colBg, rect); }
void wxStdRenderer::DrawScrollCorner(wxDC& dc, const wxRect& rect) { DrawSolidRect(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), rect); }