Mike Le Posted June 23, 2016 Report Share Posted June 23, 2016 Hi all, So I'm trying to create a general use UI framework. One of the things this framework can do is load VIs by file path into subpanels or dialogs, then switch the behavior of the launched VIs between subpanel and dialog. If the VI is currently running as a dialog and is closed, then cleanup is easy: I use the "Panel Close" event. But for the subpanel case, I don't know if there's a handy event ready like that. Any suggestions? I want the framework to be as generic as possible. If I can't come up with a good solution I might just require that all subpanel VIs being run like this must be an Actor and simply use a Send Stop Msg. Thanks. Quote Link to comment
drjdpowell Posted June 23, 2016 Report Share Posted June 23, 2016 Can the User even close a VI in a subpanel? What are you wanting an event for? Quote Link to comment
Mike Le Posted June 23, 2016 Author Report Share Posted June 23, 2016 I'm trying to create functionality similar to browser tabs. The main containing VI is a split pane with a tab control in the top pane and a subpanel in the bottom pane. If the user hits a "close" button for a given tab, I want to stop that VI's execution and (if it's currently being displayed) unload it from the subpanel. I wanted the framework to be as flexible as possible, so even programmers unfamiliar with Actor Framework could use it to launch any VI into a tab simply by feeding in a path name or reference. Basically I need a way for the VI to detect if it's "done." When it's been torn out of the Tab Container into a separate dialog, everything's fine. But when it's "x'd out" as a subpanel, then I don't know what option I have other than explicitly defining a reference for it (such as by launching it as an Actor and restricting the framework to only loading Actors). Quote Link to comment
smithd Posted June 24, 2016 Report Share Posted June 24, 2016 Probably not that helpful but just in case you weren't aware of this, someone out there already made a decent looking tab xcontrol: https://decibel.ni.com/content/docs/DOC-21668 Quote Link to comment
drjdpowell Posted June 24, 2016 Report Share Posted June 24, 2016 (edited) I don’t think you can meaningfully get a generic system, beyond a straight “front-panel manager” thing that has no concept of anything beyond front panels. You’ve already mentioned specific concepts like “launch” and “done” and assigned Panel Close to meaning some kind of “cleanup” is required. Any implementation of that, however done, will make your framework non-generic. I looked into the VIBox XControl that smithd linked to, and I could not use it because it has specific assumptions and implementations of “stoping” a VI. My own Front Panels that go in subpanels-that-look-like-tabs are a mix of Messenger-Library actors, on the one hand, and subVIs with no internal loop on the other, so no system that assumes Front Panels be “launched” or “done” can ever be generic enough for me to use. Now you COULD do a framework for "actors with one front panel each (not necessarily AF Actors)”. Edited June 24, 2016 by drjdpowell Quote Link to comment
Mike Le Posted June 24, 2016 Author Report Share Posted June 24, 2016 17 hours ago, smithd said: Probably not that helpful but just in case you weren't aware of this, someone out there already made a decent looking tab xcontrol: https://decibel.ni.com/content/docs/DOC-21668 I swore off XControls because they don't play nicely with classes. I untangled one too many corruption issues from using an XControl with a class... 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.