LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

autoscaling user interface to screen resolution ??

Luis,
 
Are you an American Citizen? Do you work for NI?
 
Please let me know.
0 Kudos
Message 11 of 25
(3,246 Views)

Yes, I work for NI. For future reference, whenever you see someone's tag show up in blue instead of black, that means that the person works for NI.

I have dual citizenship (American and Portuguese). Are you asking because the screenshots might contain some sensitive information? If so, I would recommend that you not post them here, and instead submit them to the NI ftp site. Just let me know once they're there.

Luis

0 Kudos
Message 12 of 25
(3,240 Views)
See Clear Day Map Windows.doc.  Thanks!
0 Kudos
Message 13 of 25
(3,233 Views)
Letty,
 
The reason the UI looks cluttered in the smaller resolutions is because the font couldn't be made as small as it needed to be. This is probably because it is not a true-type font. You can test this with one of the controls in the UI editor by iterating through the different point sizes of a font. If the text in the preview box isn't changing with each increment/decrement of the point size, it's a pretty good bet that this is not a true type font. It's probably a bitmapped font instead. These usually have a minimum size, and they can't be rendered any smaller than that size.
 
If you need to scale your UI, you should use a true type font. After you pick one that you like, a good way to apply it to your entire UI is to first set it as the editor's default font (Options>>Preferences, then "Control Text Style" and "Label Text Style"), and then group-select all your controls and use the Edit>>Apply Default Font command.
 
Luis
0 Kudos
Message 14 of 25
(3,208 Views)
Luis,
 
I am totally brand new to LabWindows and this is all inherited code. So let me play around with your suggestion. I will let you know if I am successful. Thanks for your help. I will be back.
 
Thanks, Letty
0 Kudos
Message 15 of 25
(3,183 Views)

It works when I changed to a true type font.

Now, why does the resolution of my current display matter when I save the uir file? Can you please explain that?

0 Kudos
Message 16 of 25
(3,169 Views)

Letty,

While it has been a while since I delved into this, IIRC it is due to the "Resolution Adjustment (%)" setting in the UIR editor.  That scaling is applied when the panel is loaded into the editor, and when displayed when running your app -- and can cause havoc if you edit it with different screen resolution.  You might want to try turning it off in the UIR editor and use SetSystemAttribute() to set the resolution adjustment programmatically.

Ian

 

0 Kudos
Message 17 of 25
(3,147 Views)

Letty,

I'll just add to what Ian wrote by saying that the point of the resolution adjustment setting is to ensure that the panels that you create in the UI editor maintain the same physical size, regardless of the resolution of the display that ends up loading the panel. For example, if your panel takes up 80% of the screen at a 1024x768 resolution, setting this option to 100% ensures that the panel will also take up 80% of the screen at a 1600x1200 resolution. Therefore, enabling that option causes the size of your UI in pixels to be tied to the current resolution, at the time that you save the panel. If the resolution later changes, then so will the UI sizes.

Luis

0 Kudos
Message 18 of 25
(3,138 Views)

Ian,

So do I just call SetSystemAttribute one time before any call to LoadPanel?

0 Kudos
Message 19 of 25
(3,124 Views)

Letty,

I really have not used the feature but based on the help, "yes":

Constant: ATTR_RESOLUTION_ADJUSTMENT
Data Type: int
Description:  This attribute allows you to override the panel settings in the .uir file, in which case you must set this attribute before you call
LoadPanel or LoadPanelEx. See the description of the ATTR_RESOLUTION_ADJUSTMENT panel attribute.
0 = Disabled
100 = 100 percent adjustment
The User Interface Library maintains a separate value for this attribute for each thread in your program.
Default Value: VAL_USE_PANEL_SETTING

Values:
    VAL_USE_PANEL_SETTING

0 Kudos
Message 20 of 25
(3,028 Views)