本文整理汇总了C++中Draw::End方法的典型用法代码示例。如果您正苦于以下问题:C++ Draw::End方法的具体用法?C++ Draw::End怎么用?C++ Draw::End使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Draw
的用法示例。
在下文中一共展示了Draw::End方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Paint
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();
}
示例2: Paint
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();
}
示例3: Print
void Print(Draw& w, const RichText& text, const Rect& page, const Vector<int>& pg)
{
LLOG("Print");
int lpage = text.GetHeight(page).page;
PrintPageDraw pw(w);
Size sz = w.GetPageMMs();
Size pgsz = page.Size();
int x = (6000 * sz.cx / 254 - pgsz.cx) / 2;
int y = (6000 * sz.cy / 254 - pgsz.cy) / 2;
for(int pi = 0; pi < pg.GetCount(); pi++) {
int i = pg[pi];
w.StartPage();
w.Offset(x, y);
pw.SetPage(i);
PaintInfo paintinfo;
paintinfo.top = PageY(i, 0);
paintinfo.bottom = PageY(i + 1, 0);
paintinfo.indexentry = Null;
if(text.IsPrintNoLinks())
paintinfo.hyperlink = Null;
text.Paint(pw, page, paintinfo);
w.End();
String footer = text.GetFooter();
if(!IsNull(footer) && lpage) {
String n = Format(footer, i + 1, lpage + 1);
Size nsz = GetTextSize(n, Arial(90).Italic());
pw.Page(i).DrawText(
x + pgsz.cx - nsz.cx, y + pgsz.cy + 100,
n, Arial(90).Italic());
}
w.EndPage();
}
}
示例4: Paint
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();
}
示例5: IsNull
void HeaderCtrl::Column::Paint(bool& first, Draw& w,
int x, int y, int cx, int cy, bool disabled, bool push, bool hl)
{
const HeaderCtrl::Style *style = header ? header->style : &HeaderCtrl::StyleDefault();;
if(first) {
if(cx >= -style->gridadjustment) {
cx -= style->gridadjustment;
if(cx < 0)
cx = 0;
first = false;
}
}
else
x -= style->gridadjustment;
bool p = push && style->pressoffset;
int q = CTRL_NORMAL;
if(hl)
q = CTRL_HOT;
if(push)
q = CTRL_PRESSED;
if(disabled)
q = CTRL_DISABLED;
ChPaint(w, x, y, cx, cy, IsNull(paper) ? style->look[q] : paper.operator Value());
x += margin;
cx -= 2 * margin;
w.Clip(x + 2, y, cx - 4, cy);
PaintLabel(w, x + 2, y + 1, cx - 4, cy - 4, disabled, p);
w.End();
}
示例6: DrawCtrl
void Ctrl::DrawCtrl(Draw& w, int x, int y)
{
GuiLock __;
w.Offset(x, y);
SystemDraw *ws = dynamic_cast<SystemDraw *>(&w);
if(ws)
UpdateArea(*ws, GetRect().GetSize());
w.End();
}
示例7: Paint
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();
}
示例8: DrawFocus
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();
}
示例9: Paint
void RichText::Paint(Draw& w, int x, int y, int cx, const PaintInfo& pinit) const
{
Mutex::Lock __(mutex);
SimplePageDraw pw(w);
PaintInfo pi(pinit);
pi.top = PageY(0, 0);
pi.bottom = PageY(0, INT_MAX);
pi.usecache = true;
pi.sizetracking = false;
pi.highlight = Null;
w.Offset(x, y);
Paint(pw, Size(cx / pi.zoom, INT_MAX), pi);
w.End();
}
示例10: StdFont
void StdDisplayClass::Paint0(Draw& w, const Rect& r, const Value& q,
Color ink, Color paper, dword s) const {
LLOG("StdDisplay::Paint0: " << q << " ink:" << ink << " paper:" << paper);
WString txt;
Font font = StdFont();
int a = align;
int x = r.left;
int width = r.GetWidth();
if(IsType<AttrText>(q)) {
const AttrText& t = ValueTo<AttrText>(q);
txt = t.text;
font = t.font;
if(!IsNull(t.paper))
paper = t.paper;
if(!IsNull(t.ink))
ink = t.ink;
if(!IsNull(t.normalink) && !(s & (CURSOR|SELECT|READONLY)))
ink = t.normalink;
if(!IsNull(t.normalpaper) && !(s & (CURSOR|SELECT|READONLY)))
paper = t.normalpaper;
if(!IsNull(t.align))
a = t.align;
if(!IsNull(t.img)) {
Size isz = t.img.GetSize();
w.DrawImage(x, r.top + max((r.Height() - isz.cy) / 2, 0), t.img);
x += isz.cx + t.imgspc;
}
}
else
txt = IsString(q) ? q : StdConvert().Format(q);
Size tsz = GetTLTextSize(txt, font);
if(a == ALIGN_RIGHT)
x = r.right - tsz.cx;
if(a == ALIGN_CENTER)
x += (width - tsz.cx) / 2;
int tcy = GetTLTextHeight(txt, font);
int tt = r.top + max((r.Height() - tcy) / 2, 0);
if(tsz.cx > width) {
Size isz = DrawImg::threedots().GetSize();
int wd = width - isz.cx;
w.Clip(r.left, r.top, wd, r.GetHeight());
DrawTLText(w, x, tt, width, txt, font, ink);
w.End();
w.DrawImage(r.left + wd, tt + font.Info().GetAscent() - isz.cy, DrawImg::threedots(), ink);
}
else
DrawTLText(w, x, tt, width, txt, font, ink);
}
示例11: Paint
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);
}
示例12: DrawCtrlWithParent
void Ctrl::DrawCtrlWithParent(Draw& w, int x, int y)
{
GuiLock __;
if(parent) {
Rect r = GetRect();
Ctrl *top = parent->GetTopRect(r, inframe);
w.Clip(x, y, r.Width(), r.Height());
w.Offset(x - r.left, y - r.top);
SystemDraw *ws = dynamic_cast<SystemDraw *>(&w);
if(ws)
top->UpdateArea(*ws, r);
w.End();
w.End();
}
else
DrawCtrl(w, x, y);
}
示例13: GetSize
void DockCont::Handle::Paint(Draw& w)
{
if (IsShown() && dc) {
const DockableCtrl::Style &s = dc->GetStyle();
Rect r = GetSize();
const Rect &m = s.handle_margins;
Point p;
if (s.handle_vert)
p = Point(r.left-1 + m.left, r.bottom - m.bottom);
else
p = Point(r.left + m.left, r.top + m.top);
ChPaint(w, r, s.handle[focus]);
Image img = dc->GetIcon();
if (!img.IsEmpty()) {
if (s.handle_vert) {
int isz = r.GetWidth();
p.y -= isz;
isz -= (m.left + m.right);
ChPaint(w, max(p.x+m.left, r.left), p.y, isz, isz, img);
p.y -= 2;
}
else {
int isz = r.GetHeight();
isz -= (m.top + m.bottom);
ChPaint(w, p.x, max(p.y, r.top), isz, isz, img);
p.x += isz + 2;
}
}
if (!s.title_font.IsNull()) {
Ctrl *c = GetLastChild();
while (c && !c->IsShown() && c->GetParent())
c = c->GetNext();
if (s.handle_vert)
r.top = c ? c->GetRect().bottom + m.top : m.top;
else
r.right = c ? c->GetRect().left + m.right : m.right;
w.Clip(r);
WString text = IsNull(dc->GetGroup()) ? dc->GetTitle() : (WString)Format("%s (%s)", dc->GetTitle(), dc->GetGroup());
w.DrawText(p.x, p.y, s.handle_vert ? 900 : 0, text, s.title_font, s.title_ink[focus]);
w.End();
}
}
}
示例14: Paint
void ScrollBar::Paint(Draw& w) {
w.DrawRect(GetSize(), SColorPaper());
int cc;
Size sz = style->through ? GetSize() : Slider(cc).GetSize();
light = GetMousePart();
int p = push;
if(!HasCapture())
p = -1;
const Value *hl[] = { style->hlower, style->hupper, style->hthumb };
const Value *vl[] = { style->vupper, style->vlower, style->vthumb };
const Value **l = IsHorz() ? hl : vl;
if(prev.IsShowEnabled()) {
for(int i = 0; i < 3; i++) {
Rect pr = GetPartRect(i);
if(i != 2) {
w.Clip(pr);
pr = style->through ? GetSize() : Slider();
}
if(i != 2 || thumbsize >= style->thumbmin)
ChPaint(w, pr, l[i][p == i ? CTRL_PRESSED : light == i ? CTRL_HOT : CTRL_NORMAL]);
if(i != 2)
w.End();
}
}
else
if(style->through)
ChPaint(w, sz, l[0][CTRL_DISABLED]);
else
if(IsHorz()) {
ChPaint(w, cc, 0, sz.cx / 2, sz.cy, l[0][CTRL_DISABLED]);
ChPaint(w, cc + sz.cx / 2, 0, sz.cx - sz.cx / 2, sz.cy, l[1][CTRL_DISABLED]);
}
else {
ChPaint(w, 0, cc, sz.cx, sz.cy / 2, l[0][CTRL_DISABLED]);
ChPaint(w, 0, cc + sz.cy / 2, sz.cx, sz.cy - sz.cy / 2, l[1][CTRL_DISABLED]);
// w.DrawRect(0, cc, sz.cx, sz.cy / 2, Red()); _DBG_
// w.DrawRect(0, cc + sz.cy / 2, sz.cx, sz.cy - sz.cy / 2, Green()); _DBG_
}
}
示例15: PaintFixed
//.........这里部分代码省略.........
if(!leftImg.IsEmpty())
{
Size isz = leftImg.GetSize();
w.DrawImage(tx, y + (cy - isz.cy) / 2, leftImg);
tx += isz.cx + 3;
}
if(!rightImg.IsEmpty())
{
Size isz = rightImg.GetSize();
w.DrawImage(x + cx - isz.cx - 3, y + (cy - isz.cy) / 2, rightImg);
}
if(!centerImg.IsEmpty())
{
Size isz = centerImg.GetSize();
w.DrawImage(x + (cx - isz.cx) / 2, y + (cy - isz.cy) / 2, centerImg);
}
}
if(moved)
DrawBorder(w, x, y, cx, cy, BlackBorder);
Color col = style & GD::READONLY ? Gray : Black;
if(sortmode > 0)
{
Size isz = GridImg::SortAsc().GetSize();
int yf = y + (cy - isz.cy) / 2;
int xf = tx + 2;
tx = xf + isz.cx + 1;
if(sortcol > 0 && sortcnt > 1)
{
String tcol = AsString(sortcol);
Size tsz = GetTextSize(tcol, fnt);
w.DrawText(tx, y + (cy - tsz.cy) / 2, tcol, fnt);
tx += tsz.cx;
}
bool asc = sortmode == 1;
if(reverse_sort_icon)
asc = !asc;
w.DrawImage(xf, yf, asc ? GridImg::SortAsc() : GridImg::SortDsc(), col);
tx += 3;
}
if(indicator)
{
w.Clip(x, y, cx, cy);
Image img;
if((style & GD::CURSOR) && (style & GD::SELECT))
{
img = GridImg::FocSel();
}
else if(style & GD::CURSOR)
{
img = GridImg::Focused();
}
else if(style & GD::SELECT)
{
img = GridImg::Selected();
}
if(!img.IsEmpty())
{
Size isz = img.GetSize();
int xp = IsNull(val)
? x + (cx - isz.cx) / 2
: tx;
w.DrawImage(xp, y + (cy - isz.cy) / 2, img, col);
if(!IsNull(val))
tx += isz.cx + 3;
}
w.End();
}
if(cx > lm + rm && cy > tm + bm)
{
int nx = x + lm;
int ny = y + tm;
int ncx = cx - lm - rm;
int ncy = cy - tm - bm;
w.Clip(nx, ny, ncx, ncy);
int al = style & GD::ALIGN ? style & GD::ALIGN : align;
Color fg = style & GD::READONLY ? SColorDisabled() : SColorText();
DrawText(w, tx, nx, ny, ncx, ncy, al, GetStdConvertedValue(val), fnt, fg, SColorPaper, 0, 0, 0, style & GD::WRAP);
w.End();
}
}