Facility Control

 View Only
  • 1.  Get screen resolution on dashboard pc

    Posted 08-16-2020 16:03

    Hello Ross support, an short question:

    Is it possible to get current screen resolution on dashboard client pc? Like ogscript.getCurrentUser(), but screen resolution. I have in the head some idea, to prepare variable-sized panels, and display the one that correlating with the current user screen size.

    Many thanks, Alex.



  • 2.  RE: Get screen resolution on dashboard pc

    Posted 08-16-2020 21:28

    Ok, i believe there is no native method do that with OGscript, but can be achieved using native java:

    ogscript.debug(java.awt.Toolkit.getDefaultToolkit().getScreenSize());

    Thanks, Alex.


    #DashBoard


  • 3.  RE: Get screen resolution on dashboard pc

    Posted 08-17-2020 13:37

    You can also get the size of your panel with:

    ogscript.getSize("_top")

    This does not give you the resolution of the screen, and it can change based on whether the user has DB open in full screen mode or in a window.   But it does give you how many pixels your working with when you display your panel.


    #DashBoard


  • 4.  RE: Get screen resolution on dashboard pc

    Posted 08-17-2020 13:57

    Hello Ben,
    Its even better than the resolution, but next question is how i can get the canvas size changes notification (size onchange listener), which will trigger the relevant scripts?


    #DashBoard


  • 5.  RE: Get screen resolution on dashboard pc

    Posted 08-17-2020 14:02

    If you add an ogscript tag, you can have it trigger when a target resizes.

     

     

    And then run whatever script you want.


    #DashBoard


  • 6.  RE: Get screen resolution on dashboard pc

    Posted 08-17-2020 14:07

    Yes, i forgot the ogscript handlers. Wow, i have to say i really like ross dashboard!
    Thanks Ben.


    #DashBoard