File browser dialog missing in Import3D

Managing anatomically complex model cells with the CellBuilder. Importing morphometric data with NEURON's Import3D tool or Robert Cannon's CVAPP. Where to find detailed morphometric data.
graphpaper
Posts: 3
Joined: Mon Oct 04, 2021 4:10 pm

Re: File browser dialog missing in Import3D

Post by graphpaper »

I realize I am replying to an 11 year old post, but the above issue appears to have persisted unchanged up to Neuron 8.0 (running on Windows 10). It is still the case that Neuron assumes that (0,0) is the top left of the virtual screen, causing dialog boxes to appear off screen if Windows' virtual screen extends into negative territory. (see https://docs.microsoft.com/en-us/window ... ual-screen for info on how Windows handles virtual screen coordinates). The issue isn't a deal breaker, as setting the top/leftmost monitor to be the primary monitor fixes the issue, but this feels like an issue that should be fairly easy to fix; in fact, I think Hines proposed the correct solution earlier in this thread (find the coordinates of the left side of the virtual screen with pleft_ = GetSystemMetrics(SM_XVIRTUALSCREEN) and find the coordinates of the top of the virtual screen with ptop_ = GetSystemMetrics(SM_YVIRTUALSCREEN). Is there a deeper reason this bug hasn't been fixed?
Thanks, and forgive any breaches of forum etiquette in posting here. This is my first time on the NEURON forum (and my first week working with NEURON).
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: File browser dialog missing in Import3D

Post by hines »

I'm afraid I still don't have access to windows desktop for development (only windows virtualbox guests) so experimenting with GetSystemMetrics is difficult for me in the context of more than one screen. However, I have to admit I never really liked my choice of dialog popup location (middle of the screen) which really is pretty far away from where my mouse is located when using large dual screens.. But using mouse location to determine the popup location would need to be tested with the mouse near the edge of your screen and I can imagine it annoyingly occluding useful information.

It would (should) be simple to provide a dialog popup location property that you can set. Would that be a sufficient workaround?
graphpaper
Posts: 3
Joined: Mon Oct 04, 2021 4:10 pm

Re: File browser dialog missing in Import3D

Post by graphpaper »

Thanks for the quick reply. That sounds like a decent workaround. Another option would be to have the dialog popups appear in the center of the primary display rather than the center of the entire virtual screen (for primary display, SM_CXSCREEN and SM_CYSCREEN are width and height, and top left is (0,0)). Also, as it stands, the issue is only with the dialogs, not with the main GUI windows themselves (plots, managers, runcontrol,...), so perhaps you could just have the dialog locations determined in the same manner as the locations for the new GUI panels are determined (although I guess it is nice to have consistent dialog popup locations).

(Not as critically, this bug also affects the virtual screen area shown in the print & file window manager, which also is working with the incorrect virtual screen coordinates. The workaround for that wouldn't be as easy, but it's also less of a usability problem, so can probably wait).
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: File browser dialog missing in Import3D

Post by hines »

Please go to https://github.com/neuronsimulator/nrn/ ... s/tag/8.0a
and download and install nrn-8.0a-664-g110f75cb7-dialog-pos-x86_64-setup.exe (probably best to uninstall your existing NEURON version first)
And please take a look at the main comment for https://github.com/neuronsimulator/nrn/pull/1487
If you install in the standard place you will need to modify the lines

Code: Select all

*dialog_spec_position: off
*dialog_bottom_position: 400
*dialog_left_position: 400
in c:\nrn\lib\nrn.defaults
I'm curious to know what positions you select that make sense with your screen layout.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: File browser dialog missing in Import3D

Post by hines »

I'm also curious to know what happens when you put small graphs at each of the corners of each of your screens and select
NEURONMainMenu/File/saveSession. Then close each of the graphs and do a NEURONMainMenu/File/loadSession. Note: graph window placement from session files seems to be relative to (0,0) being the top left corner of my dual screen display with increasing height coordinate in a downward direction and the graph window upper left corner is placed at that display coordinate. I suspect that things are not going to work well in your situation since on my display the Print&FileWindowManager shows a reasonable appearing display bounding box.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: File browser dialog missing in Import3D

Post by hines »

I updated the setup.exe. Please get from above:
nrn-8.0a-668-g8677a2cc0-dialog-pos-x86_64-setup.exe
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: File browser dialog missing in Import3D

Post by hines »

The pull request #1487 was merged to the master so is now part of the nightly builds.
graphpaper
Posts: 3
Joined: Mon Oct 04, 2021 4:10 pm

Re: File browser dialog missing in Import3D

Post by graphpaper »

Thanks for the help. I downloaded the updated build, which appears to work fine.
Here are some answers to your questions:

My Setup: My primary monitor is 1366x768 horizontal. Directly above that, with the right edges aligned, is my secondary monitor, 1920x1080 horizontal. That gives a total virtual screen of ~1920x1848, of which the bottom left corner actually doesn't exist on any monitor.

The positions I am using: If I put in a dialog_bottom_position of ~1300 and a dialog_left_position of 500, that displays the dialogs approximately centered in my primary monitor (The dialog position is specified using the bottom left corner of the dialog, so with these coordinates the bottom left corner of the dialog is a bit left of center and just a bit low of center as well to give room for the rest of the box). This approximately matches my calculations of 1080+768/2 = 1464 vertical and 1366/2 = 683 horizontal to make it to the primary monitor center, but for reasons I don't fully understand (perhaps due to the OS reserving part of the monitor area for the taskbar and/or my monitors not being quite aligned on the right), the match is only approximate.

Using Print&File Window manager: I put a plot at each corner of each of my two monitors. The Print& File window manager shows a virtual screen bounding box of the right dimensions, but the origin is incorrect, so that the graphs on my secondary (upper) monitor are represented as lying outside of the virtual screen bounding box (they appear in the correct relative positions, but outside the red box). The graphs on the primary monitor appear in the correct relative positions as well, with the top left graph of the primary monitor appearing near the top left of the virtual screen bounding box.

When I then try to load this saved session, the primary monitor plots load correctly, but the graphs from the secondary monitor load in strange positions. Basically, it looks like the vertical position of all of the graphs that were outside the virtual screen bounding box in the Print&File manager have been adjusted so that their y position is within the box, but the horizontal x position has not been adjusted. This results in two of the graphs being overlayed on the top right graph of the primary monitor and two being placed in the same location just to the left of my primary monitor (in the dead, not displayed section of my virtual screen).

This is all consistent with what I would expect given the incorrect assumption that the upper left of the virtual screen is at (0,0).

I wish I could attach a picture, but I don't think I can in this forum (correct me if I'm wrong).
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: File browser dialog missing in Import3D

Post by hines »

wish I could attach a picture
https://github.com/neuronsimulator/nrn/issues allows that.
I see that I can reproduce this issue on my mac. The laptop portion is the main screen and another larger screen can be arranged in any relation to the laptop screen. I see that when the auxiliary screen lower left corner is at the main screen upper right corner that a graph in the middle of the aux screen the session file claims it is at (2253,402) and on reloading the session file, it appears in the correct place on the PFWM and the physical screens.
I will experiment a bit more.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: File browser dialog missing in Import3D

Post by hines »

On the mac everything (window placement on screens, window icon location on the PFWM screen bounding box) appears consistent with (0,0) being the upper left corner of the screen bounding box. (Though it would be nice to show screen shapes on the PFWM screen bounding box). Getting to that behavior in a windows environment will require experimentation on a dual screen windows machine.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: File browser dialog missing in Import3D

Post by hines »

To my surprise, a virtualbox windows guest can have multiple virtual screens and windows settings for display can arrange them as desired. So I was able to see the negative coordinates when moving a graph to the second display and saving a session file. So it appears at first glance that the only change needed is to draw the correct bounding box on NEURON's Print&FileWindowManager
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: File browser dialog missing in Import3D

Post by hines »

Post Reply