Rev 3 Update:
I also looked into adding layers to the document that can be used to show or hide groups of dimensions to make it easier to read, but I don't have a license for any of the Adobe applications that would be able to do this.
Rev 2 Update:
==========================
I don't often need to think about the dirty details of object dimensioning and positioning on the front panel of a VI, but when I do, the task can really derail my productivity. I decided to put together a set of diagrams that explain all the dimensioning properties of windows, panels, panes, splitters, objects, etc. Note that some of these properties can only be accessed when VI Scripting is enabled. You normally shouldn't need to use all of them, but if you do, it's nice to know what they mean.
I'd love to hear feedback on making this document better. I intend to keep revising it and posting the updates for general public use until something like this makes its way into the LabVIEW Help file.
Nice work, thanks.
Thank you for taking the effort to put this together, I hadn't appreciated just how convoluted all the coordinate planes were. Have you marked on here anywhere the coordinate space (ie, that increasing vertical values run downwards?). I know it can be inferred from the way you've dimensioned everything, but it can't hurt to add a 'compass style' Euclidean origin reference, what do you think?
Great work!
No, I neglected to do that. Given that you can get negative values for the dimensions referenced to Pane:Origin, I absolutely should put a coordinate plane in there. I'll add it to the next revision.
Excellent document! For a long time I come looking for such a document explaining these properties!
Nice work!
Well Documented. Thanks for taking efforts for preparing this useful document.
Good Work
gook ideas
Awesome work!!
Very clear dimensions..
Great work
Very nice document!
Good document, thank you!
David,
I love this...
You mentioned you don't have a license for the Adobe... I may try to do this in a VI where dimentions can be turned on/off live on the screen while the VI is running... hmm... time for sime test VI's...
This could be very handy!
Thanks David ! The article is really useful..
Keep it up
Thanks, David - this is quite nice and obviously took a lot of effort. This still makes me want to pull my hair out though. I have what I believe is a simple problem but can't seem to get it right. I am designing a UI for a resolution other than that on my development computer. And to top things off, I have to ship the code without having ever seen it on the screen that it will be running on. And to make matters worse, the client keeps changing the resolution on me. What I want to do is 1) ensure that the main UI fits the window and 2) make sure that the controls are properly positioned on the screen when it runs (most of the controls are contained within a tab, so I really only have to position one object in the panel (pane??)). What is killing me on proper positioning is that I don't seem to understand the origin. Can you explain exactly what this is? I can't seem to figure out exactly where my origin is - is the center of the screen? This doesn't seem to be the case. How exactly do you figure this out?
Matt
The origin of a pane is the pane pixel coordinate of the top-left corner. This can be just about anything. When you use scrollbars, you are changing this origin. When you move controls on a pane, you move them with respect to the 0,0 point on the pane. This point may or may not be visible. Usually, when I resize panels, I set to origin to 0,0 so that moving and resizing other items is more predictable. I published some resizing code to handle font size changes from XP to Win7 here.
In general, due to historical reasons, coordinates on a computer screen have the 0,0 as top left, with X increasing to the right, and Y increasing down. This is definitely inverted from what we all learned in algebra, but made sense in the context of the raster scanned CRT screens of the early computers. Sort of like using hyperbolic coordinates to separate the equations of motion of Rydberg atom electrons in an electric field .
1) To ensure that the main UI fits the window, all you have to do is set the VI's "Window Run-Time Position" to Maximized. You can set this in the VI Properties dialog box.
2) The panel is the part of the VI front panel that hosts one or more panes, which in turn host all the controls, indicators, decorations etc. For a VI with no splitters, like all new VIs, there is only one pane. You can add more panes by adding splitters.
Each pane has an origin. If you have the front panel grid turned on, it shows up as the intersection of the cross-hair that is slightly darker than the rest of the grid. When you open a new VI, or create new panes by adding splitters, the origin for the panes is at the top left corner of the panes visible portion. When you move the scrollbars, it essentially moves the origin around. All controls in a pane are positioned relative to the origin of the pane.
Your description suggests that your UI has a single pane VI as the main window. To guarantee the positioning of the tab containing your controls, set the origin of the pane to (0, 0). This will give you a good starting point. Then you can get the size of the pane, and the size of the tab control. From these two, you can calculate the position of the tab that will align it where you want, top-left, top-middle, middle-middle, etc.
^^^ What these guys said.
Thanks, all. I think that is the missing piece for me that was not apparent. I was not getting the relation between the origin and the scroll bars. I will give this a go.
David, you have put a ton of work into this, so I don't mean to pile on, but maybe you (or someone else?) can put up a practical example that shows this in action? Maybe I will put something together if I can find the time.
Cheers, Matt
Wow, thanks for the clarification! this makes things much clearer.
Thanks David, nice to see this so thoroughly documented.