Exemplo n.º 1
0
        internal override void PaintOver(PaintEventArgs e, CheckState state)
        {
            System.Drawing.Graphics g = e.Graphics;
            if (Control.Appearance == Appearance.Button)
            {
                ButtonPopupAdapter adapter = new ButtonPopupAdapter(Control);
                adapter.PaintOver(e, Control.CheckState);
            }
            else
            {
                ColorData  colors = PaintPopupRender(e.Graphics).Calculate();
                LayoutData layout = PaintPopupLayout(e, true).Layout();

                Region original = e.Graphics.Clip;
                PaintButtonBackground(e, Control.ClientRectangle, null);

                PaintImage(e, layout);

                DrawCheckBackground(e, layout.checkBounds, colors.windowText, colors.options.highContrast ? colors.buttonFace : colors.highlight, true, colors);
                DrawPopupBorder(g, layout.checkBounds, colors);
                DrawCheckOnly(e, layout, colors, colors.windowText, colors.highlight);

                if (!AccessibilityImprovements.Level2 || !String.IsNullOrEmpty(Control.Text))
                {
                    e.Graphics.Clip = original;
                    e.Graphics.ExcludeClip(layout.checkArea);
                }

                AdjustFocusRectangle(layout);
                PaintField(e, layout, colors, colors.windowText, true);
            }
        }
Exemplo n.º 2
0
        internal override void PaintOver(PaintEventArgs e, CheckState state) {
            System.Drawing.Graphics g = e.Graphics;
            if (Control.Appearance == Appearance.Button) {
                ButtonPopupAdapter adapter = new ButtonPopupAdapter(Control);
                adapter.PaintOver(e, Control.CheckState);
            }
            else {
                ColorData colors = PaintPopupRender(e.Graphics).Calculate();
                LayoutData layout = PaintPopupLayout(e, true).Layout();

                Region original = e.Graphics.Clip;
                PaintButtonBackground(e, Control.ClientRectangle, null);

                PaintImage(e, layout);
                
                DrawCheckBackground(e, layout.checkBounds, colors.windowText, colors.options.highContrast ? colors.buttonFace : colors.highlight, true, colors);
                DrawPopupBorder(g, layout.checkBounds, colors);
                DrawCheckOnly(e, layout, colors, colors.windowText, colors.highlight, true);

                e.Graphics.Clip = original;
                e.Graphics.ExcludeClip(layout.checkArea);

                PaintField(e, layout, colors, colors.windowText, true);
            }
        }
Exemplo n.º 3
0
        internal override void PaintOver(PaintEventArgs e, CheckState state)
        {
            System.Drawing.Graphics g = e.Graphics;
            if (Control.Appearance == Appearance.Button)
            {
                ButtonPopupAdapter adapter = new ButtonPopupAdapter(Control);
                adapter.PaintOver(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked);
            }
            else
            {
                ColorData  colors = PaintPopupRender(e.Graphics).Calculate();
                LayoutData layout = Layout(e).Layout();

                PaintButtonBackground(e, Control.ClientRectangle, null);

                PaintImage(e, layout);

                Color checkBackgroundColor = (colors.options.highContrast && AccessibilityImprovements.Level1) ? colors.buttonFace : colors.highlight;
                DrawCheckBackground3DLite(e, layout.checkBounds, colors.windowText, checkBackgroundColor, colors, true);
                DrawCheckOnly(e, layout, colors.windowText, colors.highlight, true);

                AdjustFocusRectangle(layout);
                PaintField(e, layout, colors, colors.windowText, true);
            }
        }
Exemplo n.º 4
0
        internal override void PaintOver(PaintEventArgs e, CheckState state)
        {
            if (Control.Appearance == Appearance.Button)
            {
                ButtonPopupAdapter adapter = new ButtonPopupAdapter(Control);
                adapter.PaintOver(e, Control.CheckState);
            }
            else
            {
                ColorData  colors = PaintPopupRender(e).Calculate();
                LayoutData layout = PaintPopupLayout(show3D: true).Layout();

                Control.PaintBackground(e, Control.ClientRectangle);

                PaintImage(e, layout);

                DrawCheckBackground(
                    e,
                    layout.CheckBounds,
                    colors.Options.HighContrast ? colors.ButtonFace : colors.Highlight,
                    disabledColors: true,
                    colors);

                DrawPopupBorder(e, layout.CheckBounds, colors);
                DrawCheckOnly(e, layout, colors, colors.WindowText);

                Region originalClip = null;
                if (!string.IsNullOrEmpty(Control.Text))
                {
                    originalClip = e.GraphicsInternal.Clip;
                    e.GraphicsInternal.ExcludeClip(layout.CheckArea);
                }

                AdjustFocusRectangle(layout);
                PaintField(e, layout, colors, colors.WindowText, drawFocus: true);

                if (originalClip is not null)
                {
                    e.GraphicsInternal.Clip = originalClip;
                }
            }
        }
Exemplo n.º 5
0
        internal override void PaintOver(PaintEventArgs e, CheckState state) {
            System.Drawing.Graphics g = e.Graphics;
            if (Control.Appearance == Appearance.Button) {
                ButtonPopupAdapter adapter = new ButtonPopupAdapter(Control);
                adapter.PaintOver(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked);
            }
            else {
                ColorData colors = PaintPopupRender(e.Graphics).Calculate();
                LayoutData layout = Layout(e).Layout();

                PaintButtonBackground(e, Control.ClientRectangle, null);
                
                PaintImage(e, layout);
                
                DrawCheckBackground3DLite(e, layout.checkBounds, colors.windowText, colors.options.highContrast ? colors.buttonFace : colors.highlight, colors, true);
                DrawCheckOnly(e, layout, colors.windowText, colors.highlight, true);

                PaintField(e, layout, colors, colors.windowText, true);
            }
        }
Exemplo n.º 6
0
        internal override void PaintOver(PaintEventArgs e, CheckState state)
        {
            if (Control.Appearance == Appearance.Button)
            {
                ButtonPopupAdapter adapter = new ButtonPopupAdapter(Control);
                adapter.PaintOver(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked);
            }
            else
            {
                ColorData  colors = PaintPopupRender(e).Calculate();
                LayoutData layout = Layout(e).Layout();

                PaintButtonBackground(e, Control.ClientRectangle, null);

                PaintImage(e, layout);

                Color checkBackgroundColor = colors.Options.HighContrast ? colors.ButtonFace : colors.Highlight;
                DrawCheckBackground3DLite(e, layout.CheckBounds, checkBackgroundColor, colors, true);
                DrawCheckOnly(e, layout, colors.WindowText, colors.Highlight, true);

                AdjustFocusRectangle(layout);
                PaintField(e, layout, colors, colors.WindowText, true);
            }
        }