protected override void DoPaintEvent(BaseScreen screen)
        {
            ExtRect crt = ClientRect;

            CtlCommon.DrawCtlBorder(screen, crt);
            crt.Inflate(-1, -1);
            DrawGauge(screen, crt, Pos, Max, Colors.Black, Colors.Gray, Colors.Gold);
        }
        protected override void DoPaintEvent(BaseScreen screen)
        {
            ExtRect crt = ClientRect;

            screen.DrawRectangle(crt, Colors.Black, Colors.Black);
            CtlCommon.DrawCtlBorder(screen, crt);
            screen.SetTextColor(Colors.Gold, true);
            int h = screen.GetTextHeight("W");

            int num = fText.Count;

            for (int i = 0; i < num; i++)
            {
                screen.DrawText(crt.Left + 8, crt.Top + 8 + i * h, fText[i], 0);
            }
        }
        protected override void DoPaintEvent(BaseScreen screen)
        {
            ExtRect crt = ClientRect;

            if ((ControlStyle.Contains(ControlStyles.сsOpaque)))
            {
                screen.FillRect(crt, Colors.Black);
            }
            CtlCommon.DrawCtlBorder(screen, crt);

            screen.SetTextColor(Colors.Gold, true);

            int th = Font.Height;
            int mg = (Height - th) / 2;
            int x  = crt.Left + mg;
            int y  = crt.Top + mg;

            screen.DrawText(x, y, fText, 0);

            int tw;

            if (fCaretPos == 0)
            {
                tw = 0;
            }
            else
            {
                tw = screen.GetTextWidth(fText.Substring(0, fCaretPos)) + 1;
            }

            int cw;

            if (fCaretPos >= fText.Length)
            {
                cw = 8;
            }
            else
            {
                cw = screen.GetTextWidth("" + fText[fCaretPos]);
            }
            x += tw;
            y  = y + th + 1;
            screen.DrawLine(x, y, x + cw, y, Colors.Gold);

            //screen.drawText(x + tw, y + 3, "_", 0); // cursor
        }
        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));
        }
        protected override void DoPaintEvent(BaseScreen screen)
        {
            try {
                if (Font == null)
                {
                    return;
                }

                ExtRect rt = ClientRect;
                if ((ControlStyle.Contains(ControlStyles.сsOpaque)))
                {
                    screen.FillRect(rt, Colors.Black);
                }
                CtlCommon.DrawCtlBorder(screen, rt);

                screen.SetTextColor(Colors.Gold, true);

                int lb = fTopIndex;
                int hb = fLines.Count - 1;
                if (hb - lb >= fVisibleLines)
                {
                    hb = lb + (fVisibleLines - 1);
                }

                rt = base.IntRect;
                ExtRect r2 = new ExtRect();
                r2.Left  = rt.Left + Margin;
                r2.Right = rt.Right - Margin;
                int top = rt.Top + Margin;

                for (int i = lb; i <= hb; i++)
                {
                    r2.Top    = top + (i - fTopIndex) * fLineHeight;
                    r2.Bottom = r2.Top + fLineHeight - Margin;
                    DoPaintLine(screen, i, r2);
                }
            } catch (Exception ex) {
                Logger.Write("TextBox.DoPaintTo(): " + ex.Message);
            }
        }
Beispiel #6
0
        protected override void DoPaintEvent(BaseScreen screen)
        {
            ExtRect rt = ClientRect;

            if (ControlStyle.Contains(ControlStyles.сsOpaque))
            {
                screen.FillRect(rt, Colors.Black);
            }
            CtlCommon.DrawCtlBorder(screen, rt);

            rt = IntRect;
            ExtRect r2 = new ExtRect();

            r2.Left   = rt.Left + Margin;
            r2.Top    = rt.Top + Margin;
            r2.Right  = rt.Right - Margin;
            r2.Bottom = rt.Bottom - Margin;
            int top = rt.Top - fLineHeight;
            int bot = rt.Bottom;

            rt.Left  = r2.Left;
            rt.Right = r2.Right;

            screen.SetTextColor(TextColor, true);

            int num = fLines.Count;

            for (int i = 0; i < num; i++)
            {
                int yOffset = fY + i * fLineHeight;
                if (yOffset >= top && yOffset < bot)
                {
                    rt.Top    = r2.Top + yOffset;
                    rt.Bottom = r2.Bottom + yOffset;
                    DoPaintLine(screen, i, rt);
                }
            }
        }
        protected override void DoPaintEvent(BaseScreen screen)
        {
            ExtRect crt = ClientRect;

            if ((ControlStyle.Contains(ControlStyles.сsOpaque)))
            {
                screen.FillRect(crt, Colors.Black);
            }
            screen.SetTextColor(Colors.Gold, true);
            CtlCommon.DrawCtlBorder(screen, crt);

            switch (fMode)
            {
            case MODE_LIST:
            case MODE_ICONS:
            {
                for (int col = 0; col < fColumns; col++)
                {
                    int lb = fTopIndex + col * fColumnSize;
                    int hb = lb + (fVisibleItems - 1);
                    if (hb >= fItems.Count)
                    {
                        hb = fItems.Count - 1;
                    }
                    int defColor = screen.GetTextColor(true);

                    for (int i = lb; i <= hb; i++)
                    {
                        LBItem item = fItems.GetItem(i);
                        DoPaintItem(screen, item, i, GetItemRect(i, -1));
                    }
                    screen.SetTextColor(defColor, true);
                }
            }
            break;

            case MODE_REPORT:
            {
                int lb = fTopIndex;
                int hb = lb + (fVisibleItems - 1);
                if (hb >= fItems.Count)
                {
                    hb = fItems.Count - 1;
                }

                for (int i = lb; i <= hb; i++)
                {
                    LBItem item = fItems.GetItem(i);

                    int defColor = screen.GetTextColor(true);
                    DoPaintItem(screen, item, i, GetItemRect(i, -1));
                    screen.SetTextColor(defColor, true);

                    int num2 = item.SubItems.Count;
                    for (int j = 0; j < num2; j++)
                    {
                        defColor = screen.GetTextColor(true);
                        DoPaintSubItem(screen, item, i, j, GetItemRect(i, j));
                        screen.SetTextColor(defColor, true);
                    }
                }
            }
            break;
            }
        }