void HeaderCtrl::LeftDrag(Point p, dword keyflags) { if(li < 0 || !moving) return; int n = 0; for(int i = 0; i < col.GetCount(); i++) if(col[i].visible) n++; if(n < 2) return; push = false; ti = li; pushi = -1; Refresh(); Rect r = GetTabRect(li).OffsetedHorz(-sb); Size sz = r.GetSize(); ImageDraw iw(sz.cx, sz.cy); bool first = true; col[li].Paint(first, iw, 0, 0, sz.cx, sz.cy, false, false, false); DrawFrame(iw, sz, SColorText()); dragtab = iw; dragx = p.x; dragd = r.left - p.x; ImageBuffer ib(dragtab); Unmultiply(ib); RGBA *s = ~ib; RGBA *e = s + ib.GetLength(); while(s < e) { s->a >>= 1; s++; } Premultiply(ib); dragtab = ib; isdrag = true; }
void RGBACtrl::Set(RGBA c) { Unmultiply(&c, &c, 1); color = StraightColor(c); ramp <<= color; alpha.SetColor(color); MaskSet(c.a); }
Image IconDes::MakeIconDesCursor(const Image& arrow, const Image& cmask) { RGBA c = CurrentColor(); c.a = 255; Image ucmask = Unmultiply(cmask); ImageBuffer ib(ucmask.GetSize()); const RGBA *m = ~ucmask; RGBA *t = ~ib; RGBA *e = ib.End(); while(t < e) { *t = c; t->a = m->a; m++; t++; } Image cm(ib); Image r = arrow; Over(r, Point(0, 0), Premultiply(cm), r.GetSize()); return r; }