コード例 #1
0
ファイル: RichTextView.cpp プロジェクト: pedia/raidget
void  RichTextView::Paint(Draw& w)
{
	Size sz = GetSize();
	w.DrawRect(sz, background);
	sz.cx -= margin.left + margin.right;
	sz.cy -= margin.top + margin.bottom;
	w.Clipoff(margin.left, margin.top, sz.cx, sz.cy);
	PaintInfo pi;
	if(!hldec)
		pi.hyperlink = Null;
	if(sell < selh) {
		pi.sell = sell;
		pi.selh = selh;
	}
	pi.indexentry = Null;
	pi.highlightpara = highlight;
	pi.zoom = GetZoom();
	int q = sb * pi.zoom;
	scroller.Set(q);
	w.Offset(0, -q);
	SimplePageDraw pw(w);
	pi.top = PageY(0, sb);
	pi.bottom = PageY(0, sb + sz.cy / pi.zoom);
	pi.usecache = true;
	pi.sizetracking = sizetracking;
	pi.shrink_oversized_objects = shrink_oversized_objects;
	Color c = SColorPaper();
	if(Grayscale(c) < 100)
		pi.coloroverride = true;
	text.Paint(pw, GetPage(), pi);
	w.End();
	w.End();
}
コード例 #2
0
ファイル: Static.cpp プロジェクト: AbdelghaniDr/mirror
void Picture::Paint(Draw& w) {
	Size sz = GetSize();
	w.DrawRect(0, 0, sz.cx, sz.cy, background);
	if(!picture) return;
	int dx = 0;
	int dy = 0;
	Size rz = sz;
	if(ratio) {
		Size sr = picture.GetSize();
		if(sr.cy * sz.cx < sz.cy * sr.cx) {
			if(sr.cx) {
				rz.cy = sr.cy * sz.cx / sr.cx;
				dy = (sz.cy - rz.cy) / 2;
			}
		}
		else {
			if(sr.cy) {
				rz.cx = sr.cx * sz.cy / sr.cy;
				dx = (sz.cx - rz.cx) / 2;
			}
		}
	}
	w.Clipoff(dx, dy, rz.cx, rz.cy);
	w.DrawDrawing(0, 0, rz.cx, rz.cy, picture);
	w.End();
}
コード例 #3
0
ファイル: Util.cpp プロジェクト: pedia/raidget
void QTFDisplayCls::Paint(Draw& draw, const Rect& r, const Value& v, Color ink, Color paper, dword style) const
{
	String s;
	s << "[@(" << ink.GetR() << "." << ink.GetG() << "." << ink.GetB() << ") " << v;
	RichText rtext = ParseQTF(s);
	rtext.ApplyZoom(GetRichTextStdScreenZoom());
	draw.DrawRect(r, paper);
	draw.Clipoff(r);
	rtext.Paint(Zoom(1, 1), draw, 0, 0, r.Width());
	draw.End();
}
コード例 #4
0
ファイル: LabelBase.cpp プロジェクト: pedia/raidget
void DrawFocus(Draw& w, int x, int y, int cx, int cy, Color c) {
	w.Clipoff(x, y, cx, cy);
	for(int a = 0; a < cx; a += CtrlImg::focus_h().GetWidth()) {
		w.DrawImage(a, 0, CtrlImg::focus_h(), c);
		w.DrawImage(a, cy - 1, CtrlImg::focus_h(), c);
	}
	for(int a = 0; a < cy; a += CtrlImg::focus_v().GetHeight()) {
		w.DrawImage(0, a, CtrlImg::focus_v(), c);
		w.DrawImage(cx - 1, a, CtrlImg::focus_v(), c);
	}
	w.End();
}
コード例 #5
0
ファイル: main.cpp プロジェクト: kolyden/mirror
 virtual void Paint(Draw& w) {
     w.DrawRect(GetSize(), White());
     DoPainting(w);
     w.Offset(30, 50);
     DoPainting(w);
     w.End();
     w.Offset(20, 100);
     w.Clip(5, 5, 40, 20);
     DoPainting(w);
     w.End();
     w.End();
     w.Clipoff(10, 150, 60, 20);
     DoPainting(w);
     w.End();
 }
コード例 #6
0
ファイル: wince.cpp プロジェクト: dreamsxin/ultimatepp
	virtual void Paint(Draw& w)
	{
		Size sz = GetSize();
		w.DrawRect(sz, LtGray);
		w.DrawRect(sz / 2, LtBlue);
		w.DrawText(10, 10, "Hello", Arial(12));
		w.DrawImage(50, 50, CtrlImg::exclamation());
		w.DrawImage(100, 50, CtrlImg::exclamation(), Blue);
		w.DrawImage(50, 150, CtrlsImg::O1h());
		w.DrawImage(150, 150, CtrlsImg::O1h());
		w.Clipoff(50, 180, 40, 40);
		w.DrawImage(0, 0, 50, 50, CtrlsImg::O1h());
		w.End();
		w.DrawImage(100, 100, ball);
		w.DrawImage(200, 200, 40, 40, ball);
	}