protected override void DoPaint(HCStyle aStyle, RECT aDrawRect, int aDataDrawTop, int aDataDrawBottom,
                                        int aDataScreenTop, int aDataScreenBottom, HCCanvas aCanvas, PaintInfo aPaintInfo)
        {
            base.DoPaint(aStyle, aDrawRect, aDataDrawTop, aDataDrawBottom, aDataScreenTop, aDataScreenBottom,
                         aCanvas, aPaintInfo);

            if ((FMouseIn) && (!aPaintInfo.Print))
            {
                aCanvas.Brush.Color = HC.clBtnFace;
                aCanvas.FillRect(aDrawRect);
            }

            RECT vBoxRect = GetBoxRect();

            HC.OffsetRect(ref vBoxRect, aDrawRect.Left, aDrawRect.Top);

            if (this.IsSelectComplate && (!aPaintInfo.Print))
            {
                aCanvas.Brush.Color = aStyle.SelColor;
                aCanvas.FillRect(aDrawRect);
            }

            aCanvas.Brush.Style = HCBrushStyle.bsClear;

            aStyle.TextStyles[TextStyleNo].ApplyStyle(aCanvas, aPaintInfo.ScaleY / aPaintInfo.Zoom);
            aCanvas.TextOut(aDrawRect.Left + FMargin + CheckBoxSize + FMargin, aDrawRect.Top + (Height - aCanvas.TextHeight("H")) / 2, FText);

            if (FChecked)  // 勾选
            {
                User.DrawFrameControl(aCanvas.Handle, ref vBoxRect, Kernel.DFC_MENU, Kernel.DFCS_CHECKED | Kernel.DFCS_MENUCHECK);
            }

            aCanvas.Pen.Style = HCPenStyle.psSolid;
            if (FMouseIn && (!aPaintInfo.Print))  // 鼠标在其中,且非打印
            {
                aCanvas.Pen.Color = Color.Blue;
                aCanvas.Rectangle(vBoxRect.Left, vBoxRect.Top, vBoxRect.Right, vBoxRect.Bottom);
                HC.InflateRect(ref vBoxRect, 1, 1);
                aCanvas.Pen.Color = HC.clBtnFace;
                aCanvas.Rectangle(vBoxRect.Left, vBoxRect.Top, vBoxRect.Right, vBoxRect.Bottom);
            }
            else  // 鼠标不在其中或打印
            {
                aCanvas.Pen.Color = Color.Black;
                aCanvas.Rectangle(vBoxRect.Left, vBoxRect.Top, vBoxRect.Right, vBoxRect.Bottom);
            }
        }
        protected override void DoPaint(HCStyle AStyle, RECT ADrawRect, int ADataDrawTop, int ADataDrawBottom,
                                        int ADataScreenTop, int ADataScreenBottom, HCCanvas ACanvas, PaintInfo APaintInfo)
        {
            base.DoPaint(AStyle, ADrawRect, ADataDrawTop, ADataDrawBottom, ADataScreenTop, ADataScreenBottom,
                         ACanvas, APaintInfo);

            if ((FMouseIn) && (!APaintInfo.Print))
            {
                ACanvas.Brush.Color = HC.clBtnFace;
                ACanvas.FillRect(ADrawRect);
            }

            RECT vBoxRect = GetBoxRect();

            HC.OffsetRect(ref vBoxRect, ADrawRect.Left, ADrawRect.Top);

            if (this.IsSelectComplate && (!APaintInfo.Print))
            {
                ACanvas.Brush.Color = AStyle.SelColor;
                ACanvas.FillRect(ADrawRect);
            }

            AStyle.TextStyles[TextStyleNo].ApplyStyle(ACanvas, APaintInfo.ScaleY / APaintInfo.Zoom);
            ACanvas.TextOut(ADrawRect.Left + FMargin + CheckBoxSize + FMargin, ADrawRect.Top + (Height - ACanvas.TextHeight("H")) / 2, FText);

            if (FChecked)  // 勾选
            {
                User.DrawFrameControl(ACanvas.Handle, ref vBoxRect, Kernel.DFC_MENU, Kernel.DFCS_CHECKED | Kernel.DFCS_MENUCHECK);
            }

            if (FMouseIn && (!APaintInfo.Print))  // 鼠标在其中,且非打印
            {
                ACanvas.Pen.Color = Color.Blue;
                ACanvas.Rectangle(vBoxRect.Left, vBoxRect.Top, vBoxRect.Right, vBoxRect.Bottom);
                HC.InflateRect(ref vBoxRect, 1, 1);
                ACanvas.Pen.Color = HC.clBtnFace;
                ACanvas.Rectangle(vBoxRect.Left, vBoxRect.Top, vBoxRect.Right, vBoxRect.Bottom);
            }
            else  // 鼠标不在其中或打印
            {
                ACanvas.Pen.Color = Color.Black;
                ACanvas.Rectangle(vBoxRect.Left, vBoxRect.Top, vBoxRect.Right, vBoxRect.Bottom);
            }
        }
Example #3
0
        public void PaintToEx(HCCanvas ACanvas)
        {
            RECT vRect = new RECT();

            ACanvas.Brush.Color = TitleBackColor;
            ACanvas.FillRect(HC.Bounds(0, 0, Width, Height));

            if (FOrientation == Orientation.oriHorizontal)  // 水平滚动条
            {
                // 左按钮
                ACanvas.Pen.Color = Color.White;
                vRect.Left        = FLeftBtnRect.Left + ((FLeftBtnRect.Right - FLeftBtnRect.Left) - 4) / 2 + 4;
                vRect.Top         = FLeftBtnRect.Top + ((FLeftBtnRect.Bottom - FLeftBtnRect.Top) - 7) / 2;
                ACanvas.DrawLine(vRect.Left, vRect.Top, vRect.Left, vRect.Top + 7);
                ACanvas.DrawLine(vRect.Left - 1, vRect.Top + 1, vRect.Left - 1, vRect.Top + 6);
                ACanvas.DrawLine(vRect.Left - 2, vRect.Top + 2, vRect.Left - 2, vRect.Top + 5);
                ACanvas.DrawLine(vRect.Left - 3, vRect.Top + 3, vRect.Left - 3, vRect.Top + 4);
                // 右按钮
                vRect.Left = FRightBtnRect.Left + ((FRightBtnRect.Right - FRightBtnRect.Left) - 4) / 2;
                vRect.Top  = FRightBtnRect.Top + ((FRightBtnRect.Bottom - FRightBtnRect.Top) - 7) / 2;
                ACanvas.DrawLine(vRect.Left, vRect.Top, vRect.Left, vRect.Top + 7);
                ACanvas.DrawLine(vRect.Left + 1, vRect.Top + 1, vRect.Left + 1, vRect.Top + 6);
                ACanvas.DrawLine(vRect.Left + 2, vRect.Top + 2, vRect.Left + 2, vRect.Top + 5);
                ACanvas.DrawLine(vRect.Left + 3, vRect.Top + 3, vRect.Left + 3, vRect.Top + 4);
                // 水平滑块
                vRect = FThumRect;
                HC.InflateRect(ref vRect, 0, -1);
                DoDrawThumBefor(ACanvas, vRect);
                ACanvas.Brush.Color = ThumBackColor;
                ACanvas.Pen.Color   = LineColor;
                ACanvas.Rectangle(vRect);
                // 滑块上的修饰
                vRect.Left = vRect.Left + (vRect.Right - vRect.Left) / 2;
                ACanvas.DrawLine(vRect.Left, 5, vRect.Left, Height - 5);
                ACanvas.DrawLine(vRect.Left + 3, 5, vRect.Left + 3, Height - 5);
                ACanvas.DrawLine(vRect.Left - 3, 5, vRect.Left - 3, Height - 5);
            }
            else  // 垂直滚动条
            {
                // 上按钮
                ACanvas.Pen.Color = Color.White;
                vRect.Left        = FLeftBtnRect.Left + ((FLeftBtnRect.Right - FLeftBtnRect.Left) - 7) / 2;
                vRect.Top         = FLeftBtnRect.Top + ((FLeftBtnRect.Bottom - FLeftBtnRect.Top) - 4) / 2 + 4;

                ACanvas.DrawLine(6, 12, 13, 12);
                ACanvas.DrawLine(vRect.Left, vRect.Top, vRect.Left + 7, vRect.Top);
                ACanvas.DrawLine(vRect.Left + 1, vRect.Top - 1, vRect.Left + 6, vRect.Top - 1);
                ACanvas.DrawLine(vRect.Left + 2, vRect.Top - 2, vRect.Left + 5, vRect.Top - 2);
                ACanvas.DrawLine(vRect.Left + 3, vRect.Top - 3, vRect.Left + 4, vRect.Top - 3);
                // 下按钮
                vRect.Left = FRightBtnRect.Left + ((FRightBtnRect.Right - FRightBtnRect.Left) - 7) / 2;
                vRect.Top  = FRightBtnRect.Top + ((FRightBtnRect.Bottom - FRightBtnRect.Top) - 4) / 2;
                ACanvas.DrawLine(vRect.Left, vRect.Top, vRect.Left + 7, vRect.Top);
                ACanvas.DrawLine(vRect.Left + 1, vRect.Top + 1, vRect.Left + 6, vRect.Top + 1);
                ACanvas.DrawLine(vRect.Left + 2, vRect.Top + 2, vRect.Left + 5, vRect.Top + 2);
                ACanvas.DrawLine(vRect.Left + 3, vRect.Top + 3, vRect.Left + 4, vRect.Top + 3);
                // 滑块
                vRect = FThumRect;
                HC.InflateRect(ref vRect, -1, 0);
                DoDrawThumBefor(ACanvas, vRect);
                ACanvas.Brush.Color = ThumBackColor;
                ACanvas.Pen.Color   = LineColor;
                ACanvas.Rectangle(vRect);
                // 滑块上的修饰
                vRect.Top = vRect.Top + (vRect.Bottom - vRect.Top) / 2;
                ACanvas.DrawLine(5, vRect.Top, Width - 5, vRect.Top);
                ACanvas.DrawLine(5, vRect.Top - 3, Width - 5, vRect.Top - 3);
                ACanvas.DrawLine(5, vRect.Top + 3, Width - 5, vRect.Top + 3);
            }
        }