VSplit Cursor not Scaling in DPI Aware App

6 posts, 0 answers
  1. Robert
    Robert avatar
    14 posts
    Member since:
    Dec 2015

    Posted 13 Sep Link to this post

    Hello, 

    The VSplit cursor does not seem to be scaling in DPI aware applications. It's not too bad up to 150% scale. But 200% scale or higher the cursor is almost invisible. This also seems to be the case for the SplitContainer control. Is there a solution for that?

    Robert

     

  2. Hristo
    Admin
    Hristo avatar
    1032 posts

    Posted 14 Sep Link to this post

    Hello Robert,

    Thank you for writing.

    RadSplitContainer is using the default Cursors.VSplit and Cursors.HSplit. These cursors indeed do not seem to be scaled correctly. The issue is with Microsoft and not related to the split container or any of our controls. You can reproduce it in a standard dpi-aware form with the following: 
    this.Cursor = Cursors.VSplit;

    Due to the nature of the reported issue, I cannot suggest a suitable workaround.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Robert
    Robert avatar
    14 posts
    Member since:
    Dec 2015

    Posted 15 Sep Link to this post

    Would there be a way to switch cursors? I was thinking maybe if scale is greater 150% the VSplit cursor could be switched for the SizeWE cursor which does seem to scale correctly at higher resolutions.
  4. Hristo
    Admin
    Hristo avatar
    1032 posts

    Posted 18 Sep Link to this post

    Hello Robert,

    Thank you for writing.

    In RadSplitContainer, you can accomplish this task by creating a custom control and overriding its Cursor property as well as the MouseMove and MouseDown methods: 
    public class MyRadSplitContainer : RadSplitContainer
    {
        private bool isResizing;
     
        public override string ThemeClassName
        {
            get
            {
                return typeof(RadSplitContainer).FullName;
            }
        }
     
        protected override void OnMouseDown(MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left && this.ContentRectangle.Contains(e.Location))
            {
                SplitterElement splitter = GetSplitterElementAtPoint(e.Location);
                if (splitter != null && !splitter.Fixed)
                {
                    this.isResizing = true;
                }
     
                base.OnMouseDown(e);
            }
        }
     
        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);
     
            this.isResizing = false;
        }
     
        public override Cursor Cursor
        {
            get
            {
                Cursor cursor = base.Cursor;
                if (this.isResizing && cursor == Cursors.SizeWE)
                {
                    cursor = Cursors.VSplit;
                }
                else if (this.isResizing && cursor == Cursors.SizeNS)
                {
                    cursor = Cursors.HSplit;
                }
     
                return cursor;
            }
            set
            {
                if (value == Cursors.VSplit)
                {
                    value = Cursors.SizeWE;
                }
                else if (value == Cursors.HSplit)
                {
                    value = Cursors.SizeNS;
                }
     
                base.Cursor = value;
            }
        }
    }

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Robert
    Robert avatar
    14 posts
    Member since:
    Dec 2015

    Posted 18 Sep in reply to Hristo Link to this post

    That works quite nicely. Thank you. Also works for RadDock with code change to this.isResizing2.

    Robert

  6. Hristo
    Admin
    Hristo avatar
    1032 posts

    Posted 19 Sep Link to this post

    Hello Robert,

    Thank you for the update.

    I am glad that the suggested approach is working well in your actual project.

    Please let me know if you have other questions.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top