Jump to content

Modifying pane origins doesn't affect scrolling.

Recommended Posts

I asked this on the NI forums, but no response, so I'm hoping the expertise here might point me in the right direction.

I'm trying to make an application that allows a user to modify the screen size and still be able to control everything. Most of this is done by having a main vi that has subpanels that get filled up with vi's. All of this is built upon actor framework.

I don't want any elements on the front panel of the vi's to change size. The only thing I want is for the position of the vi within the subpanel to change so that it is always centered. I've achieved this by taking the size of a Pane, and setting the origin to the center based on the rectangular area of all the controls. This part works great. I programmatically turn on the scroll bars if the vi won't fit in the subpanel so the user can still get to everything. (The attached CenterControls.vi is what's going on here, with the help of FP_PaneRectangeAroundControls.vi)

The problem comes when a user uses the scrollbar on a subpanel. Since the inserted vi is centered, because of the origin change, I would hope the scroll bar would take that modified origin and change it. Instead it seems like whenever I use the scrollbar it takes the previous origin, instead of the one I set. By that I mean, If I change the width of the front panel, and then scroll vertically, the vi will jump to the center before the width was changed. The same happens if I change the height, and then scroll horizontally. This causes my vi's within subpanels to be thrown to where they previously were centered. You can see that behavior in the gif I attached.



Anybody ever ran into this issue and know a way around it? I would like to be able to center my vi's in the subpanels, and then for scrolling to work based on the new origin.

CenterControls.vi FP_PaneRectangleAroundControls.vi

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.