Example #1
0
void DrawDragRect(Ctrl& q, const DrawDragRectInfo& f)
{
	SystemDraw w;
	w.Init(Ctrl::GetDesktopSize());
	w.Clip(f.clip);
	/* TODO
	static int dashes[3][3] = {
		{ 32, 32, 0 },
		{ 1, 1, 1 },
		{ 5, 1, 2 },
	};
	*/
	DrawDragFrame(w, f.rect1, f.n, f.animation);
	DrawDragFrame(w, f.rect2, f.n, f.animation);
	w.End();
}
Example #2
0
void Ctrl::DoPaint()
{
	LLOG("@ DoPaint");
	if(!PaintLock) {
		bool scroll = false;
		if(desktop)
			desktop->SyncScroll();
		for(int i = 0; i < topctrl.GetCount(); i++)
			topctrl[i]->SyncScroll();
		if((invalid.GetCount() || scroll) && desktop) {
			RemoveCursor();
			RemoveCaret();
			for(int phase = 0; phase < 2; phase++) {
				LLOG("DoPaint invalid phase " << phase);
				LDUMPC(invalid);
				SystemDraw draw;
				draw.Set(screen);
				draw.Init(screen_size);
				for(int i = 0; i < invalid.GetCount(); i++) {
					draw.Clip(invalid[i]);
					AddUpdate(invalid[i]);
				}
				for(int i = topctrl.GetCount() - 1; i >= 0; i--) {
					Rect r = topctrl[i]->GetRect();
					Rect ri = GetClipBound(invalid, r);
					if(!IsNull(ri)) {
						draw.Clipoff(r);
						topctrl[i]->UpdateArea(draw, ri - r.TopLeft());
						draw.End();
						Subtract(invalid, r);
						draw.ExcludeClip(r);
					}
				}
				Rect ri = GetClipBound(invalid, framebuffer.GetSize());
				if(!IsNull(ri))
					desktop->UpdateArea(draw, ri);
			}
		}
	}
	DoUpdate();
}