Panel size

I’m trying to figure out how to make control panels have a sensible size for cross-platform display.

I programmatically create a control panel that looks okay on my macbook pro with retina display.

On a windows laptop, the panel is drawn too large to fit on the screen (see screenshots for comparison). Igor Pro 7.05 on both machines.

What I’ve figured out so far:

From help topic Control Panel Resolution on Windows:

"In Igor, most measurements of length are in terms of points. A point is roughly 1/72 of an inch. 72 points make up 1 "logical inch". Because of hardware difference and system software adjustments, the actual size of a logical inch varies from screen to screen and system to system."

"On Macintosh, a point is always interpreted to be one pixel except on Retina displays where it is two.
On Windows, the correspondence between a point and a pixel can be controlled by the user using system settings. Since Igor stores window positions in units of points, if the user changes the number of pixels per point, the size of Igor windows in pixels will change."

In my case the panel is sized in points.

PanelResolution("") returns 72 on both PC and Mac.

Changing SetIgorOption PanelResolution to 0, 1 and 72 and then recreating the panel has no effect on either platform.

Both machines are set up in a fairly standard way so that the font size for igor menus and whatever looks about the same on both. I tend to use a slightly larger-than-default font size on panels for comfortable viewing on my mac, but, importantly, even the default 12 point font is drawn much larger on the pc than the mac (the text inside the listbox is default size). I’ve taken a look at the Resize Controls Panel package, but for that to work I’d have to create a panel that on the mac has font size smaller than the default to get to a sensible smallest-scale starting point for resize controls. That doesn’t seem to be the answer, and I don't really want a resizable panel anyway.

On the PC, if I quit Igor and change system settings so that everything is uncomfortable small, I can get the panel to be drawn within the screen. But that’s not a workable solution.

When I add controls in Windows the default font size is larger then the font used for the Igor menus. On the Mac it’s smaller than the menus. That seems weird to me. Regardless of cross-platform issues for window sizes in points vs pixels or whatever, I would expect to be able to fit the same number of controls on the screen when I create them with default sizes (the screens are roughly the same physical size, and Igor is telling me that the screen resolution is the same, and, whatever the system settings are, the system menus are drawn about the same size).

Am I missing something here? Since PanelResolution("") is the same on both machines, how can I anticipate how a size in points will be drawn? Or the size that a font will be rendered?
You may benefit from a Code Snippet I uploaded here:


Panel Size Menus

http://www.igorexchange.com/node/7966

This procedure adds a Size submenu to the Panel menu so you can make an existing panel bigger or smaller.
It makes the controls bigger or smaller, too.
It unfortunately does this by killing and recreating the window, so don't be surprised when the window goes away.


Though it doesn't directly answer you question, you may learn a bit about how PanelResolution works.


--Jim Prouty
Software Engineer, WaveMetrics, Inc.
The package Screen Sizer allows you to generate, position, and size panels using percentage of screen size.

http://www.igorexchange.com/project/ScreenSizer

The one caveat is, when the Igor Pro experiment is moved macOS <-> Windows, the panel should be closed and re-opened manually to implement the change in OS.

The package also does not fix the font size issues.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
Thank you, these were both very useful suggestions. I understand better now how SetIgorOption PanelResolution works.

The help for IgorInfo(0) had me confused:

SCREEN1 A description of the characteristics of screen 1, the main screen on the system.
The format of the SCREEN1 description is:
SCREEN1:DEPTH=bitsPerPixel,RECT=left,top,right,bottom ;
left, top, right, and bottom are all in pixels.

Looks like these are in points, not pixels.

Mac with retina display gives RECT=0,0,1280,800;
PC with 1920x1080 display (native), 150% scaling for text and apps (the recommended setting) gives RECT=0,0,960,540;

So that gives me a way to anticipate window size (and font size) as a proportion of screen size.

Seems like one way to go is to keep panel size as small as possible in the code, then use PanelResolution to increase size for screens that have the space. My only problem with this approach is that (on the mac, but not the PC) text within popup menus seems to scale differently to the rest of the text in the window (i.e the selected item is magnified more than the title). Is this a bug?

resize.jpg (583.51 KB)
Tony-

Could you please send a simple example of the errant popup menu controls along with a description of the conditions that show the problem? This may be a bug...

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Tony did, indeed, do as I asked. After looking into the problem, this was my answer:
------------------------
OK, yes, I see your point. After spending a couple hours looking into the problem, I have to conclude that it probably won't ever work correctly on a Macintosh. The
SetIgorOption panelResolution setting was really intended to provide a fix for problems with the multitudinous resolutions and poor high-resolution display handling on Windows, so trying to use it on a Macintosh probably will give, let's say, mixed results.

Macintosh has the notion that a popup menu button should come in certain discrete sizes and trying to scale a control like that problematic. I have corrected the text size, but the button itself isn't right.

With the change I just made, though, selecting Fusion style does look pretty good. If your goal is to be able to see if a panel will look right on Window while developing on Macintosh, that might do the trick. The setting is in Misc->Miscellaneous Settings, Miscellaneous category. See the Use Fusion Style checkbox.
------------------------
I should add that Jim Prouty tells me that Fusion has other problems...

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com