本文整理汇总了C++中Draw::Begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Draw::Begin方法的具体用法?C++ Draw::Begin怎么用?C++ Draw::Begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Draw
的用法示例。
在下文中一共展示了Draw::Begin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Paint
void LabelBox::Paint(Draw& w)
{
Size sz = GetSize();
if(!IsTransparent())
w.DrawRect(sz, SColorFace);
Size lsz = GetLabelSize();
int d = lsz.cy >> 1;
bool hline = sz.cy < 2 * Draw::GetStdFontCy();
bool vline = sz.cx < 2 * Draw::GetStdFontCy();
int ty = hline ? (sz.cy - lsz.cy) / 2 : 0;
Size ts = PaintLabel(w, d + 2, ty, sz.cx, lsz.cy, !IsShowEnabled(), false, false, VisibleAccessKeys());
w.Begin();
w.ExcludeClip(d, ty, ts.cx + 4, ts.cy);
if(GUI_GlobalStyle() >= GUISTYLE_XP || !IsNull(color)) {
if(hline) {
d = sz.cy / 2;
w.DrawRect(0, d - 1, sz.cx, 1, SColorLight);
w.DrawRect(0, d, sz.cx, 1, SColorShadow);
w.DrawRect(0, d + 1, sz.cx, 1, SColorLight);
}
else
if(vline) {
d = sz.cx / 2;
w.DrawRect(d - 1, 0, 1, sz.cy, SColorLight);
w.DrawRect(d, 0, 1, sz.cy, SColorShadow);
w.DrawRect(d + 1, 0, 1, sz.cy, SColorLight);
}
else {
Color c = Nvl(color, LabelBoxColor);
w.DrawRect(0, d + 2, 1, sz.cy - d - 4, c);
w.DrawRect(sz.cx - 1, d + 2, 1, sz.cy - d - 4, c);
w.DrawRect(2, sz.cy - 1, sz.cx - 4, 1, c);
w.DrawRect(2, d, sz.cx - 4, 1, c);
w.DrawRect(1, d + 1, 2, 1, c);
w.DrawRect(1, d + 2, 1, 1, c);
w.DrawRect(sz.cx - 3, d + 1, 2, 1, c);
w.DrawRect(sz.cx - 2, d + 2, 1, 1, c);
w.DrawRect(1, sz.cy - 2, 2, 1, c);
w.DrawRect(1, sz.cy - 3, 1, 1, c);
w.DrawRect(sz.cx - 3, sz.cy - 2, 2, 1, c);
w.DrawRect(sz.cx - 2, sz.cy - 3, 1, 1, c);
}
}
else {
if(hline) {
d = sz.cy / 2;
w.DrawRect(0, d, sz.cx, 1, SColorShadow);
w.DrawRect(0, d + 1, sz.cx, 1, SColorLight);
}
else
if(vline) {
d = sz.cx / 2;
w.DrawRect(d, 0, 1, sz.cy, SColorShadow);
w.DrawRect(d - 1, 1, 0, sz.cy, SColorLight);
}
else {
w.DrawRect(1, d, sz.cx - 2, 1, SColorShadow);
w.DrawRect(1, d + 1, sz.cx - 2, 1, SColorLight);
w.DrawRect(0, d, 1, sz.cy - d - 1, SColorShadow);
w.DrawRect(1, d + 1, 1, sz.cy - d - 2, SColorLight);
w.DrawRect(sz.cx - 2, d, 1, sz.cy - d, SColorShadow);
w.DrawRect(sz.cx - 1, d, 1, sz.cy - d, SColorLight);
w.DrawRect(1, sz.cy - 2, sz.cx - 2, 1, SColorShadow);
w.DrawRect(1, sz.cy - 1, sz.cx - 2, 1, SColorLight);
}
}
w.End();
}