Esempio n. 1
0
        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);

            RECT vBoxRect = GetBoxRect();

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

            if (aPaintInfo.Print)
            {
                if (FChecked)
                {
                    HC.HCDrawFrameControl(aCanvas, vBoxRect, HCControlState.hcsChecked, HCControlStyle.hcyCheck);
                }
                else
                {
                    HC.HCDrawFrameControl(aCanvas, vBoxRect, HCControlState.hcsCustom, HCControlStyle.hcyCheck);
                }
            }
            else
            {
                if (this.IsSelectComplate)
                {
                    aCanvas.Brush.Color = aStyle.SelColor;
                    aCanvas.FillRect(aDrawRect);
                }
                else
                if (FMouseIn)
                {
                    aCanvas.Brush.Color = HC.clBtnFace;
                    aCanvas.FillRect(aDrawRect);
                }

                if (FChecked)
                {
                    aCanvas.Brush.Style = HCBrushStyle.bsSolid;
                    User.DrawFrameControl(aCanvas.Handle, ref vBoxRect, Kernel.DFC_MENU, Kernel.DFCS_CHECKED | Kernel.DFCS_MENUCHECK);
                }

                HC.HCDrawFrameControl(aCanvas, vBoxRect, HCControlState.hcsCustom, HCControlStyle.hcyCheck);
            }

            aCanvas.Brush.Style = HCBrushStyle.bsClear;
            aStyle.TextStyles[TextStyleNo].ApplyStyle(aCanvas, aPaintInfo.ScaleY / aPaintInfo.Zoom);
            if (FBoxRight)
            {
                aCanvas.TextOut(aDrawRect.Left, aDrawRect.Top + (Height - aCanvas.TextHeight("H")) / 2, FText);
            }
            else
            {
                aCanvas.TextOut(aDrawRect.Left + FPaddingLeft + CheckBoxSize + FPaddingLeft, aDrawRect.Top + (Height - aCanvas.TextHeight("H")) / 2, FText);
            }
        }
Esempio n. 2
0
        protected void DoPaintItems(HCCanvas canvas, RECT drawRect, PaintInfo paintInfo)
        {
            POINT vPoint = new POINT();
            RECT  vItemRect;

            for (int i = 0; i <= FItems.Count - 1; i++)
            {
                vPoint.X = FItems[i].Rect.Left;
                vPoint.Y = FItems[i].Rect.Top;
                vPoint.Offset(drawRect.Left, drawRect.Top);
                vItemRect = HC.Bounds(vPoint.X, vPoint.Y, RadioButtonWidth, RadioButtonWidth);

                if (paintInfo.Print)
                {
                    if (FItems[i].Checked)
                    {
                        if (FRadioStyle == HCRadioStyle.Radio)
                        {
                            HC.HCDrawFrameControl(canvas, vItemRect, HCControlState.hcsChecked, HCControlStyle.hcyRadio);
                        }
                        else
                        {
                            HC.HCDrawFrameControl(canvas, vItemRect, HCControlState.hcsChecked, HCControlStyle.hcyCheck);
                        }
                    }
                    else
                    {
                        if (FRadioStyle == HCRadioStyle.Radio)
                        {
                            HC.HCDrawFrameControl(canvas, vItemRect, HCControlState.hcsCustom, HCControlStyle.hcyRadio);
                        }
                        else
                        {
                            HC.HCDrawFrameControl(canvas, vItemRect, HCControlState.hcsCustom, HCControlStyle.hcyCheck);
                        }
                    }

                    canvas.Brush.Style = HCBrushStyle.bsClear;
                }
                else
                {
                    if (FItems[i].Checked)
                    {
                        if (FRadioStyle == HCRadioStyle.Radio)
                        {
                            User.DrawFrameControl(canvas.Handle, ref vItemRect, Kernel.DFC_BUTTON, Kernel.DFCS_CHECKED | Kernel.DFCS_BUTTONRADIO);
                        }
                        else
                        {
                            User.DrawFrameControl(canvas.Handle, ref vItemRect, Kernel.DFC_BUTTON, Kernel.DFCS_CHECKED | Kernel.DFCS_BUTTONCHECK);
                        }
                    }
                    else
                    {
                        if (FRadioStyle == HCRadioStyle.Radio)
                        {
                            User.DrawFrameControl(canvas.Handle, ref vItemRect, Kernel.DFC_BUTTON, Kernel.DFCS_BUTTONRADIO);
                        }
                        else
                        {
                            User.DrawFrameControl(canvas.Handle, ref vItemRect, Kernel.DFC_BUTTON, Kernel.DFCS_BUTTONCHECK);
                        }
                    }
                }

                canvas.TextOut(vPoint.X + RadioButtonWidth, vPoint.Y, FItems[i].Text);
            }
        }