John Lokanis Posted May 31, 2013 Report Share Posted May 31, 2013 I have been trying to get the VI within a sub panel to re-size dynamically (while the users is actively performing a re-size). I have programmed the VI in the sub panel to do real time re-sizing but I cannot get the sub panel to re-size actively when the user re-sizes the front panel that owns the sub panel. Even if you set the 'Scale all objects on the front panel as the window re-sizes' VI property, the re-size does not happen until the user stops the re-size action. It will not do it dynamically. My solution was to create a vertical and horizontal splitter, then place my sub panel to the right and below the splitters. I could then get it to resize the sub panel as the user performs the resize action. The problem I am left with is I cannot completly hide the splitters. No matter what type of splitter I choose or what color I set it to or how narrow I try to make it, I still end up with a border on the top and left of the front panel a few pixels wide. My LabVIEW-fu and Google-fu has failed me on this one. Has anyone else solved this? thanks for any ideas! -John Quote Link to comment
Jordan Kuehn Posted May 31, 2013 Report Share Posted May 31, 2013 A classic splitter with the same color as the background produces no border for me? Even when it is stretched out pretty wide. Quote Link to comment
John Lokanis Posted May 31, 2013 Author Report Share Posted May 31, 2013 The problem is when trying to make the splitter zero pixels and place it at the extreme edge of the screen. You still get a gap of a few pixels. I have been able to eliminate one of the splitters but I am still stuck with having one. Here is what it looks like: Quote Link to comment
Jordan Kuehn Posted May 31, 2013 Report Share Posted May 31, 2013 The problem is when trying to make the splitter zero pixels and place it at the extreme edge of the screen. You still get a gap of a few pixels.I have been able to eliminate one of the splitters but I am still stuck with having one. Here is what it looks like: visible splitter.png Ah, yes that makes sense. I don't think you can make any splitter zero pixels, though I'd love to be proven wrong. Quote Link to comment
Mike Le Posted May 31, 2013 Report Share Posted May 31, 2013 (edited) I threw this together; it's not a perfect solution, but maybe it'll give you some ideas. Resizing Subpanel.vi Edited May 31, 2013 by Mike Le 1 Quote Link to comment
mje Posted May 31, 2013 Report Share Posted May 31, 2013 All I can say is, I feel your pain John. Splitters help make amazing interfaces that automatically scale, but being zero (or even 1 px) wide is not one of their tricks. Quote Link to comment
JackDunaway Posted June 1, 2013 Report Share Posted June 1, 2013 I have been trying to get the VI within a sub panel to re-size dynamically (while the users is actively performing a re-size).I have programmed the VI in the sub panel to do real time re-sizing but I cannot get the sub panel to re-size actively when the user re-sizes the front panel that owns the sub panel. Even if you set the 'Scale all objects on the front panel as the window re-sizes' VI property, the re-size does not happen until the user stops the re-size action. It will not do it dynamically. My solution was to create a vertical and horizontal splitter, then place my sub panel to the right and below the splitters. I could then get it to resize the sub panel as the user performs the resize action. The whole splitter business shouldn't even be necessary -- if I understand your original request, the features you describe are native. (this demo uses LabVIEW2012 12.0.1F1 32-bit) Inspect settings on the two VIs attached (Container.vi and Containee.vi -- save them in the same directory) and check the 25sec screencast below to see if it demonstrates the behavior you're trying to achieve: http://screencast.com/t/84aalWkNw Containee.vi Container.vi 1 Quote Link to comment
John Lokanis Posted June 3, 2013 Author Report Share Posted June 3, 2013 Thanks Jack, your example looks like what I want but I get very different behavior on my machine using your VIs. See my screencast: http://screencast.com/t/Nq9KVfgI Quote Link to comment
hooovahh Posted June 3, 2013 Report Share Posted June 3, 2013 Thanks Jack, your example looks like what I want but I get very different behavior on my machine using your VIs. See my screencast: http://screencast.com/t/ZDg3NzM3Nm Would you mind trying that link again. I only see an image of a map looking at Springfield, IL. Quote Link to comment
John Lokanis Posted June 3, 2013 Author Report Share Posted June 3, 2013 Would you mind trying that link again. I only see an image of a map looking at Springfield, IL. Doh! Try this one: http://screencast.com/t/Nq9KVfgI Quote Link to comment
hooovahh Posted June 3, 2013 Report Share Posted June 3, 2013 Doh! Try this one: http://screencast.com/t/Nq9KVfgI Wow I've never seen that happen before. You ran that VI un edited? I had normal results sorry. One thing I'd be curious about is if you use the invoke node to Fit Control to Pane (on the sub panel, or the tree) does it fix this? To be clear I don't think you should have to do this to have it function properly I'm just wondering if this would fix the issue. Quote Link to comment
John Lokanis Posted June 3, 2013 Author Report Share Posted June 3, 2013 Wow I've never seen that happen before. You ran that VI un edited? I had normal results sorry. One thing I'd be curious about is if you use the invoke node to Fit Control to Pane (on the sub panel, or the tree) does it fix this? To be clear I don't think you should have to do this to have it function properly I'm just wondering if this would fix the issue. Yes. Just D/Led and tried it. Same version of LV too. I did try the Fit Control to Pane in the resize event. works even worse. Best performance I can get is to use one vertical splitter bar and have the sub panel resize to that. The resize event is also passed to the VI in the sub-panel and that is where I have my custom resize code that adjusts my list box column widths. Still a bit laggy if they move the window edge too fast but it does catch up when they stop. Quote Link to comment
Christina Rogers Posted June 3, 2013 Report Share Posted June 3, 2013 There are no zero-pixel width splitters. (Sorry - I know they would be really useful). But Jack is correct that this should work without the top-level splitters. My recommendation is to avoid the VI property "Scale all objects on front panel as the window resizes." It almost never does what you want. Jack's example VIs work for me, but I'm guessing they are behaving differently for you because of this setting. I'm attaching a modified example that does not have that setting. Can you let me know if it works for you? Also, the "Scale Objects While Resizing" setting on the Pane (which Jack has set) is pretty important. It's not set on new VIs and it's in a really weird place (right-clicking on the scrollbar to get the shortcut menu with the Pane Sizing options). Container (1).vi Containee (1).vi 1 Quote Link to comment
John Lokanis Posted June 4, 2013 Author Report Share Posted June 4, 2013 Also, the "Scale Objects While Resizing" setting on the Pane (which Jack has set) is pretty important. It's not set on new VIs and it's in a really weird place (right-clicking on the scrollbar to get the shortcut menu with the Pane Sizing options). Ok, your version works as expected on my machine. But there is no scroll bar on the Container.vi. How do you get it back to adjust the setting? If I create a VI, drop a sub-panel and then select 'fit to pane', the scroll bars seem to be gone for good. I must be missing something... (other than the scroll bars). Finally, why is this "Scale Objects While Resizing" setting not available via VI Server? Quote Link to comment
JackDunaway Posted June 4, 2013 Report Share Posted June 4, 2013 My recommendation is to avoid the VI property "Scale all objects on front panel as the window resizes." It almost never does what you want. For clarity -- and don't let me put words in your mouth! -- but for clarity i think you mean to avoid "Scale all Objects with Pane" (because, it almost never does what you want) -- and you typically *always* want to enable "Scale Objects While Resizing" because hardware is more capable today than it was in the 1900's. :-) This is typically the setting you'll want for Panes: 2 Quote Link to comment
John Lokanis Posted June 4, 2013 Author Report Share Posted June 4, 2013 FWIW, I was able to 'trick' my original VI into giving me my scroll bar back so I cold set this and it now works. Still need an easy way to get those scroll bars back and this still needs to be a VI Server setting! thanks everyone for the help! Quote Link to comment
JackDunaway Posted June 4, 2013 Report Share Posted June 4, 2013 Still need an easy way to get those scroll bars back and this still needs to be a VI Server setting! There are four ways to turns on scroll bars: 1. VI Properties (CTRL+I) >> Window Appearance >> Show vertical/horizontal scroll bar 2. Context Menu of an existing scroll bar: 3. Context Menu of a splitter between two panes: 4. And as a property node of Pane (also shown, a lesser known fact -- you can show, customize, then hide the Labels on both Splitters and Panes to be more descriptive than Pane, Pane 2, Pane 3, Pane 4...) A mistake I oftentimes make is to search for Pane settings under the Panel class -- Class Browser (CTRL+Shift+B) helps remind. Quote Link to comment
hooovahh Posted June 4, 2013 Report Share Posted June 4, 2013 ...and you typically *always* want to enable "Scale Objects While Resizing" because hardware is more capable today than it was in the 1900's. :-) I also set this every time I'm doing any nice UI stuff. Too bad it can't be set programatically. http://forums.ni.com/t5/LabVIEW/Setting-quot-Scale-Objects-While-Resizing-quot-programmatically/td-p/1970005 Quote Link to comment
bmoyer Posted June 4, 2013 Report Share Posted June 4, 2013 Slightly high-jacking this topic, re-sizing items in a tab control in a way that is similar to the resizing of panes is a feature I've been looking for for a while. To give you an example, for many of my GUIs I have a graph in a tab control, and have the raw data table in another tab. If tab controls could resize their contents like a pane, my graph and table could automatically re-size with my window (I would put the tab control in a pane and set it to Fit Control to Pane. For this reason I've put off converting many of my GUIs to being resizable using splitter bars. Any ideas as to how I could implement something that could achieve similar results? Thanks, Bruce Quote Link to comment
hooovahh Posted June 4, 2013 Report Share Posted June 4, 2013 Any ideas as to how I could implement something that could achieve similar results? Thanks, Bruce The only way I've been able to do this is by cheating. I would have a horizontal splitter with only the tabs in the top pane, and the contents of the tabs in the lower pane. Then when you change the value in the top tab control it changes the value in the bottom tab control. Then when the bottom tab control changes value, I also fit the appropriate control to the pane. This gives the illusion of a single tab that fits to the pane but really it is two tabs. This technique falls apart if you try to have more complicated controls then just a single graph, or table in each tab. It is still do-able but I've found my self performing manual resizing of controls if the pane is resized. Attached is a quick demo that uses a graph, a single column listbox and a table. Cheating Tabs.vi Quote Link to comment
JackDunaway Posted June 4, 2013 Report Share Posted June 4, 2013 Slightly high-jacking this topic, re-sizing items in a tab control in a way that is similar to the resizing of panes is a feature I've been looking for for a while. To give you an example, for many of my GUIs I have a graph in a tab control, and have the raw data table in another tab. If tab controls could resize their contents like a pane, my graph and table could automatically re-size with my window (I would put the tab control in a pane and set it to Fit Control to Pane. For this reason I've put off converting many of my GUIs to being resizable using splitter bars.The only way I've been able to do this is by cheating. I would have a horizontal splitter with only the tabs in the top pane, and the contents of the tabs in the lower pane. Highest recommendations for checking out XTab by Saphir, available for download through the LabVIEW Tools Network using VIPM. * It handles resizing of tab contents no prob, since the tab contents are just a VI * You can add/remove pages programmatically * You can re-order and even pop out tabs into new windows (à la Chrome browser) * The toolkit is free Here's a screencast that shows XTab in action: http://www.dailymotion.com/video/xmtmvf_topaze-tab-navigation_tech#.Ua4DsGRgZyE More info on the community: https://decibel.ni.com/content/docs/DOC-21668 Quote Link to comment
bmoyer Posted June 4, 2013 Report Share Posted June 4, 2013 The only way I've been able to do this is by cheating. I would have a horizontal splitter with only the tabs in the top pane, and the contents of the tabs in the lower pane. Then when you change the value in the top tab control it changes the value in the bottom tab control. Then when the bottom tab control changes value, I also fit the appropriate control to the pane. This gives the illusion of a single tab that fits to the pane but really it is two tabs. This technique falls apart if you try to have more complicated controls then just a single graph, or table in each tab. It is still do-able but I've found my self performing manual resizing of controls if the pane is resized. Attached is a quick demo that uses a graph, a single column listbox and a table. Thanks! Your workaround is quite sneaky into fooling the user that the tab panes are actually being displayed. I didn't realize you could get this effect by having multiple controls on top of eachother and using that method. Highest recommendations for checking out XTab by Saphir, available for download through the LabVIEW Tools Network using VIPM. * It handles resizing of tab contents no prob, since the tab contents are just a VI * You can add/remove pages programmatically * You can re-order and even pop out tabs into new windows (à la Chrome browser) * The toolkit is free Here's a screencast that shows XTab in action: http://www.dailymotion.com/video/xmtmvf_topaze-tab-navigation_tech#.Ua4DsGRgZyE More info on the community: https://decibel.ni.com/content/docs/DOC-21668 I've downloaded this toolkit and will give it a whirl. Thanks! (I guess hijacking this thread was a good idea after all!) Bruce Quote Link to comment
John Lokanis Posted June 4, 2013 Author Report Share Posted June 4, 2013 I appove of the thread jacking because it led me to some more interesting tools, but to get back on topic: There are four ways to turns on scroll bars: 1. VI Properties (CTRL+I) >> Window Appearance >> Show vertical/horizontal scroll bar 2. Context Menu of an existing scroll bar: 3. Context Menu of a splitter between two panes: 4. And as a property node of Pane (also shown, a lesser known fact -- you can show, customize, then hide the Labels on both Splitters and Panes to be more descriptive than Pane, Pane 2, Pane 3, Pane 4...) A mistake I oftentimes make is to search for Pane settings under the Panel class -- Class Browser (CTRL+Shift+B) helps remind. I should have thought of #1. Thanks for pointing out the obvious and easy solution. #2 and #3 won't work once you have lost the scroll bars and have no splitters. I ended up doing a variation of #4 before I saw your reply. In the end all is well but I agree that the setting should be the default. It would have no effect on normal VIs until you set a control to scale. So, why not? I bet this is already on the idea exchange somewhere... Now to go off and redo all my code using that cool tab x-control! Quote Link to comment
John Lokanis Posted June 5, 2013 Author Report Share Posted June 5, 2013 After a day of playing with the XTab control, I can say that is looks promising but is too buggy for real world use at this point. I hope the author continues to improve it. In the meantime, I would recommend you look elsewhere for a tab solution. Quote Link to comment
JackDunaway Posted June 5, 2013 Report Share Posted June 5, 2013 After a day of playing with the XTab control, I can say that is looks promising but is too buggy for real world use at this point. I hope the author continues to improve it. In the meantime, I would recommend you look elsewhere for a tab solution. Stay tuned -- perhaps some of these concerns are addressed in unreleased versions and a nudge is all it takes.... Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.