Popup window - window size (navigation menu)

Hi
I am trying to greate a navigation menu with dropdown functionality. This is done by showing a popup window below the main menu button, containing detailed navigation choices.
-This works perfectly when the target display resolution is identical to the main window resolution (1920x1080)
-However in my project some screens have 4k resolution. The vision client handles this well. The main window and content are scaled when window is maximized.
-But the menu popup does not automatically scale accordingly.

  1. Is it possible to somehow read current scale level of the main window -and apply this to the menu popup?
  2. Should I handle this in another way?

j.

dropdown - correct size dropdown - different size

You are already manipulating the position of the popup window to align it to the main window’s menu bar. You can manipulate its size, too. In Vision, components and windows are subclasses of the corresponding Java Swing objects, so you can examine runtime sizes of everything.

In case you weren’t aware, Ignition has this already built in…
https://docs.inductiveautomation.com/display/DOC81/Navigation+-+Menubar

Thankyou, I kind of forgot
-But even if this is nice, it is not ideal for my purpose:
-I need to have custum buttons with colors and overlayed information
-And anyway: it seems as the buildtin menu does not scale well on a big screen? It is left too small for the operator even if all content is scaled according to “relative” behaviour.
Is it possible to decide the size of the buildtin menu?

Thankyou. It was not obvious to me. After some googling I have found that the window has a method .setSize(width,height)
(for future reference: do you have a link to a suitable source listing all methods and properties available for Vision components and what Java Swing objects they correspond to?)

However I got an interesting behaviour when resizing the “menu” popup window: The new size is persistent during the client session :smiley:
-As I need to multiply the original size with a scale, this only works the first time :wink: I’ll try another approach, but any comments are welcome.

IA publishes javadocs for their SDK:

https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.0/index.html

1 Like

Regarding the “persistent” window size. This was the result of the cache policy -which makes perfectly sense.
Again: I love this forum and all contributors :smiley:

1 Like