Пример #1
0
        public override void DrawCheckBox(Canvas canvas, GuiCheckbox checkbox)
        {
            var x       = checkbox.GlobalX;
            var y       = checkbox.GlobalY;
            var w       = checkbox.W;
            var h       = checkbox.H;
            var checkW  = checkbox.CheckboxSize.W;
            var checkH  = checkbox.CheckboxSize.H;
            var padding = checkbox.Padding;

            Color fillColor = !checkbox.Checked ? ControlFill : ControlActiveFill;

            canvas.DrawRect(x, y, w, h, Color.Cyan);

            if (!checkbox.Active)
            {
                DrawFrame(
                    canvas,
                    x + padding, y + padding,
                    checkW, checkH,
                    ControlBorder,
                    fillColor);
            }
            else
            {
                DrawFrame(
                    canvas,
                    x + padding, y + padding,
                    checkW, checkH,
                    ControlBorder,
                    fillColor);
            }

            canvas.DrawText(x + padding + checkW + padding, y + h / 2 - 4, checkbox.Label, Color.White, 0.25f);
        }
Пример #2
0
        public GuiCheckbox AddCheckbox()
        {
            var checkbox = new GuiCheckbox(Gui, this);

            AddWidget(checkbox);

            return(checkbox);
        }
Пример #3
0
 public abstract void DrawCheckBox(Canvas canvas, GuiCheckbox checkbox);