void RightTabs::FramePaint(Draw& w, const Rect& rr) { Rect r = rr; r.right -= cx; DrawFrame(w, r, FieldFrameColor()); DrawFrame(w, r.Deflated(1), SColorPaper); if(cursor >= 0) { Tab& t = tab[cursor]; w.DrawRect(r.right - 1, t.y + 1, 1, t.GetHeight() + 1, SColorFace); } }
void IconDes::RectTool0(Point p, dword flags, bool empty) { Size isz = GetImageSize(); IconDraw iw(isz); iw.DrawRect(isz, GrayColor(0)); Rect r = Rect(startpoint, p + 1).Normalized(); if(empty) iw.DrawRect(r.Deflated(pen, pen), GrayColor(128)); DrawFatFrame(iw, r, GrayColor(255), pen); ApplyDraw(iw, flags); }
void HeaderCtrl::Paint(Draw& w) { RefreshDistribution(); Size sz = GetSize(); w.DrawRect(sz, SColorFace()); bool ds = !IsShowEnabled(); double rs = Denominator(); double rr = 0; int x = -sb; light = -1; bool first = true; int dx = Null; for(int i = 0; i < col.GetCount(); i++) { if(col[i].visible) { Rect r; if(mode == SCROLL) { int cx = (int)col[i].ratio; r = RectC(x, 0, cx, sz.cy); x += cx; } else { rr += rs ? col[i].ratio : 1; int xx = int(rr * sz.cx / (rs ? rs : col.GetCount())); r = RectC(x, 0, i == col.GetCount() - 1 ? sz.cx - x : xx - x, sz.cy); x = xx; } bool mousein = HasMouseIn(r.Deflated(1, 0)) && col[i].WhenAction && pushi < 0 && !isdrag; if(mousein) light = i; col[i].Paint(first, w, r.left, r.top, r.Width(), r.Height(), ds, push && i == pushi, mousein); if(isdrag && ti == i) dx = r.left; } if(x >= sz.cx) break; } Column h; h.header = this; h.Paint(first, w, x, 0, 999, sz.cy, false, false, false); if(isdrag) { w.DrawImage(dragx + dragd, 0, dragtab); DrawVertDrop(w, IsNull(dx) ? sz.cx - 2 : dx - (dx > 0), 0, sz.cy); } }
int DockWindow::GetPointAlign(const Point p, Rect r, bool center, bool allow_lr, bool allow_tb) { Size border = r.GetSize(); border.cx = allow_lr ? border.cx/4 : 0; border.cy = allow_tb ? border.cy/4 : 0; if (center && r.Deflated(border).Contains(p)) return DOCK_NONE; int q = GetQuad(p, r); int al = DOCK_NONE; if (q == 0 || q == 1) al = DOCK_TOP; else if (q == 2 || q == 3) al = DOCK_RIGHT; else if (q == 4 || q == 5) al = DOCK_BOTTOM; else if (q == 6 || q == 7) al = DOCK_LEFT; if (!allow_lr && (al == DOCK_LEFT || al == DOCK_RIGHT)) al = (q == 7 || q == 2) ? DOCK_TOP : DOCK_BOTTOM; else if (!allow_tb && (al == DOCK_TOP || al == DOCK_BOTTOM)) al = (q == 0 || q == 5) ? DOCK_LEFT : DOCK_RIGHT; return al; }
virtual void FramePaint(Draw& w, const Rect& r) { DrawFrame(w, r, FieldFrameColor()); DrawFrame(w, r.Deflated(1), SColorPaper); }