void DropGrid::Paint(Draw& w) { Size sz = GetSize(); Size isz = clear.GetStdSize(); if(clear_button && !notnull && IsEnabled() && IsSelected()) { clear.Show(); clear.RightPos(3, isz.cx).TopPos((sz.cy - isz.cy) / 2, isz.cy); } else clear.Hide(); GridDisplay &disp = display ? *display : list.GetDisplay(); bool hf = HasFocus(); bool isnull = rowid < 0; Color fg = hf ? SColorHighlightText() : IsEnabled() ? SColorText() : SColorDisabled(); Color bg = !IsEnabled() || !IsEditable() ? EditField::StyleDefault().disabled : notnull && isnull ? Blend(SColorPaper, Color(255, 0, 0), 32) : hf ? SColorHighlight() : SColorPaper(); const int d = 0; if(isnull) w.DrawRect(d, d, sz.cx - d * 2, sz.cy - d * 2, bg); else { Font fnt(StdFont()); Paint0(w, 1, 1, d, d, sz.cx - d * 2, sz.cy - d * 2, Format0(Null, rowid), 0, fg, bg, fnt); } if(hf) DrawFocus(w, d - 0, d - 0, sz.cx - (d - 0) * 2, sz.cy - (d - 0) * 2); }
void MultiButton::SyncInfo() { if((HasMouse() || info.HasMouse()) && display && (GetMouseFlags() & (K_MOUSELEFT|K_MOUSERIGHT|K_MOUSEMIDDLE)) == 0) { Point p = GetMouseViewPos(); NilDraw nw; Rect r = Paint0(nw, true); if(r.Contains(p)) { Value v = convert->Format(value); int cm = DPI(2); r.left -= cm; r.right += cm; info.Set(this, r, value, display, SColorText, SColorPaper, 0, DPI(2)); return; } } info.Cancel(); }
void DropGrid::Paint(Draw &w, int x, int y, int cx, int cy, const Value &val, dword style, Color &fg, Color &bg, Font &fnt, bool found, int fs, int fe) { Paint0(w, lm, rm, x, y, cx, cy, val, style, fg, bg, fnt, found, fs, fe); }
void MultiButton::Paint(Draw& w) { Paint0(w, false); }
void LineEdit::Paint(Draw& w) { Paint0(w); scroller.Set(sb); }
void StdDisplayClass::Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword s) const { LLOG("StdDisplay::Paint: " << q << " ink:" << ink << " paper:" << paper); PaintBackground(w, r, q, ink, paper, s); Paint0(w, r, q, ink, paper, s); }