Jump to content

A "Fake window" Xcontrol?

Recommended Posts


We're about to try to do an ambitious experiment that if it works will drastically change the look and feel of our software.  I wanted to see if someone has already done this or if it's been tried before by smarter minds than ours and shown to be un-doable.


Our software allows people to create display windows (like graphs and tables) at will that in turn open up in separate windows.  We would love to be able to constrain these windows within our program window, bind them to tabs on the main window, do soft-snapping with other windows, allow them to be docked, bind them inside window panes so that if there are too many of them you can scroll up/down to see them rather than have a mess of windows all over your screen, and all kinds of other spiffy things that you can do in other programming languages.  However, LabVIEW doesn't seem to be up to the task from what I can tell of it's vi property/invoke nodes.


I recently was successful at making something closer to  what we want, however.  I made a fake window toolbar from a picture control, put a subpanel underneath it, and put another control at the bottom right of the subpanel control for resizing.   I then captured mouse clicks and mouse drag events to detect the picture control being clicked on and drug to move the "window" around and similarly for the window resize control.  Attached is an image of the fake window


Doing this I was able to have this "fake" display window contained within a tab on our main application window that was able to be moved around and could even be moved off the screen but accessed via the scroll bars.


Now the question is whether we can scale this up.  We're going to try to create an Xcontrol which has the titlebar, subpanel, resize control and handles mouse events.  I'm not sure this is possible, however.  Whether we can get all the mouse event handling worked out and passed to the proper Xcontrol, and whether this scheme will put too much load on the processor.


So...  Anyone done this before?


Link to comment

Well a few links that I'm sure you've already seen.


Ben's Docking example 




tst array of subpanels


Snap off windows


Messing Around with Splitters (can't seem to find source)


By combining all of these you can get some neat UI functions.  I've tested a few UI techniques and you can get some very nice flowing applications.  I think what you are trying to do is very possible but will take some time ironing out the kinks.  The things I've done with it were not as feature complete as what you are proposing.  One thing to keep in mind is it maybe a good place for some OO code.  You might be able to make new instances of a classes and then override the class with functions for the specific UI element.  This could be an architecture where there are instructions on how to make your own UI elements that can be plugged in and used.

Link to comment

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.