Beispiel #1
0
void PopUpInfo::Paint(Draw& w)
{
    Size sz = GetSize();
    if(!IsTransparent())
        w.DrawRect(0, 0, sz.cx, sz.cy, color);
    PaintLabel(w, 0, 0, sz.cx, sz.cy, !IsShowEnabled(), false, false, VisibleAccessKeys());
}
Beispiel #2
0
NAMESPACE_UPP

void StaticText::Paint(Draw& w)
{
	Size sz = GetSize();
	if(!IsTransparent())
		w.DrawRect(0, 0, sz.cx, sz.cy, SColorFace);
	PaintLabel(this, w, 0, 0, sz.cx, sz.cy, !IsShowEnabled(), false, false, VisibleAccessKeys());
}
Beispiel #3
0
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();
}
Beispiel #4
0
void MenuItemBase::DrawMenuText(Draw& w, int x, int y, const String& s, Font f, bool enabled,
                                bool hl, Color color, Color hlcolor)
{
	UPP::DrawMenuText(w, x, y, s, f, enabled, hl, VisibleAccessKeys() ? accesskey : 0,
	                  color, hlcolor, InOpaqueBar());
}