01-27-2015 05:07 PM - edited 01-27-2015 05:10 PM
My VI consists of multiple charts and control buttons for them. I want to be able to resize the charts when user resize the window but no the buttons. So I am using multiple splitters: First splitting horizontally, and the splitting each rows into columns.
The first rows behaves exactly as I want. For some reason the last row doesn't. I set the Splitter Sizing basically the same way for them. Any ideas?
Original sizing:
After dragging the window larger:
As you can see the lower left chart won't resize. I noticed if both vertical splitters on this rown are size proportionally, then the chart would resize as expected, but then the row of buttons would not line up with the buttons above anymore.
Side note, I noticed the 2 charts on the same row are not resized the same way. The chart to the right is noticably wider than the one on the left after resizing. Any way to avoid that?
01-27-2015 10:49 PM - edited 01-27-2015 10:51 PM
Why are you using the Splitters? Why not just scale the objects with Pane which will automatically resize according to the window size. Set the Size of the default window screen, select the Object (Chart in your case) and select "Scale Object with Pane". Now if you resize the window the charts will automatically size itself to the proportion.
01-28-2015 10:41 AM
Pardon me if I got it wrong. This is all new.
Don't I need to use splitters to create panes? I thought that's what I am doing, creating a pane for each charts so I can use check the "Scale Object with Pane" box. Prior to this when everything are in a single pane it seems like only 1 single chart can have the "Scale Object with Pane" selected.
01-28-2015 10:58 AM - edited 01-28-2015 11:01 AM
There's an option to scale all objects with pane which will make everything on the front panel grow/shrink as you resize the window. I think it generally has less-than-ideal results though.
I would have thought that your bottom right splitter should be 'stick right' so it sticks with a fixed width to the right hand side of the pane - that will allow the bottom left splitter to move when you resize the pane.
Note though that I use splitters quite a lot in my applications and can sometimes find very strange behaviours when resizing objects - sometimes things like graph labels/scale labels can move around and not return to their original position - particularly if you allow things to shrink. Something to bear in mind.
01-28-2015 11:11 AM
I changed all the right most splitters to stick right and it look like this after making window wider:
The last chart stretches too much instead. I'd love to have all charts to remain the exact same size during resizing. The 2 charts to the right still ended up wider than the left ones.
01-28-2015 01:12 PM
P@Anand wrote:
Why are you using the Splitters? Why not just scale the objects with Pane
I would never recommend using this feature. Unless you know something I don't, this feature has never done what I want consistently. Splitters fix all my resizing issues and help break up the UI into manageable chunks. If you can post your VI, or rather the VI with just the front panel.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
01-28-2015 01:21 PM
@Hooovahh wrote:
P@Anand wrote:
Why are you using the Splitters? Why not just scale the objects with Pane
I would never recommend using this feature. Unless you know something I don't, this feature has never done what I want consistently. Splitters fix all my resizing issues and help break up the UI into manageable chunks. If you can post your VI, or rather the VI with just the front panel.
I spent my first few years of LV programming denying people the ability to resize panes for this exact reason. That function almost never does what I want it to do. It wasn't until I started using splitters heavily that I was able to make a front panel that would actually resize correctly.
01-28-2015 02:22 PM
I think I did insert my VI front panel in my original post.
I think I finally understand what you are talking about. So I tried putting all my charts in a group and they choose "Resize with pane". So now all charts would resize uniformly. The only downside is the rest of the controls start spreading out, so lots of extra spacing everywhere.
01-28-2015 02:25 PM
@jbphili wrote:
I think I did insert my VI front panel in my original post.
You didn't. You took a picture of your front panel, it would be easier to help you if you shared the code (VI).
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
01-28-2015 02:56 PM
OK. Here it is. This is still the version with splitters.