public static void DrawCtlBorder(BaseScreen screen, ExtRect rect, CtlBorders borders) { if (screen != null && CtlDecor != null) { int L = rect.Left; int T = rect.Top; int R = rect.Right; int B = rect.Bottom; if (borders.Contains(CtlBorders.cbTop)) { screen.DrawFilled(rect, BaseScreen.FILL_HORZ, 2, 0, 31, 2, L, T - 1, CtlDecor); } if (borders.Contains(CtlBorders.cbBottom)) { screen.DrawFilled(rect, BaseScreen.FILL_HORZ, 2, 0, 31, 2, L, B - 1, CtlDecor); } if (borders.Contains(CtlBorders.cbLeft)) { screen.DrawFilled(rect, BaseScreen.FILL_VERT, 0, 2, 2, 31, L - 1, T, CtlDecor); } if (borders.Contains(CtlBorders.cbRight)) { screen.DrawFilled(rect, BaseScreen.FILL_VERT, 0, 2, 2, 31, R - 1, T, CtlDecor); } } }
protected override void DoPaintEvent(BaseScreen screen) { ExtRect crt = ClientRect; int L = crt.Left; int T = crt.Top; int R = crt.Right; int B = crt.Bottom; int h = 8; if (Font != null) { h += Font.Height; } int mw = 0; ExtRect tsr; int num = PagesCount; for (int idx = 0; idx < num; idx++) { TabSheet page = GetPage(idx); int tw = screen.GetTextWidth(page.Caption) + 16; tsr = ExtRect.Create(L + mw, T + 0, L + mw + tw - 1, T + h - 1); mw += tw; CtlBorders brd; if (idx == TabIndex) { brd = new CtlBorders(CtlBorders.cbLeft, CtlBorders.cbTop, CtlBorders.cbRight); } else { brd = new CtlBorders(CtlBorders.cbLeft, CtlBorders.cbTop, CtlBorders.cbRight, CtlBorders.cbBottom); } CtlCommon.DrawCtlBorder(screen, tsr, brd); screen.DrawText(tsr.Left + 8, tsr.Top + 4, page.Caption, 0); } tsr = ExtRect.Create(L + mw, T + h - 2, R, B); screen.DrawFilled(tsr, BaseScreen.FILL_HORZ, 2, 0, 31, 2, mw, T + h - 2, CtlCommon.CtlDecor); tsr = ExtRect.Create(L, T + h, R, B); CtlCommon.DrawCtlBorder(screen, tsr, new CtlBorders(CtlBorders.cbLeft, CtlBorders.cbRight, CtlBorders.cbBottom)); }