pganssle/Magnetometer-Controller — Issue #2: Pop-out windows
Author: pganssle
Created: 2012-01-25 01:35:12+00:00
State: open
Labels: Features, Medium Priority, UI

It is useful to figure out how to pop-out and pop-in windows. I have not yet implemented this.

I have made a preliminary test in the callback PopoutTab, located in the file MC10.c. This uses the right-click button to duplicate the entire PPConfig panel and delete the old one. This works well enough, but there are the following issues:

####Issues:
1. This has only been implemented with PPConfig and *not* with the other tabs
2. I'm not entirely sure if the callback data sends you enough information to determine which tab has been right-clicked on.
3. I have not implemented any way to re-integrate the popped-out tab.
4. I don't think that callbacks are being copied over
5. It should probably be stored in one of the global variables which ones are popped out and which are popped in, and that information should be saved in the SessionSavingLib.
6. We should probably work out the behavior for when no tabs are left.
7. It's been a while - there may be more issues, please use this space to add them as you find them.

####Possible solutions:
*I believe that #1 and #2 are basically non-issues, just missing features. I suggest taking the code from PopoutTab and generalizing it as much as possible, then adding in some switch(event) controls, so that depending on what is sent to the switch, a different tab pops out. If you can't get that information from a right-click, maybe adding a small button to each tab is possible.
* #3 also seems like a bit of a non-issue. You just need to do the same thing you are doing in PopoutTab, but instead of setting the parent to be 0, you want to create the panel in the tab. Try for code re-usability. We're likely going to want to put something in General or SessionSessionSavingLib which is like pop_out_panel(panel, parent), so that we can use the same code in either direction.
* Another possible solution with regards to #3 is that we should look into simply hiding the tab (rather than deleting it), and changing the references to pc.PPConfig or its analogues to the popped out version. Then, when you want to pop it back in, discard the popped-out panel and re-show the tab. This may be best if it's easy to hide a tab.
*#4 might present a problem with respect to generalizability. Unless we can somehow iterate through all children and children-of-children and simply use GetCtrlCallback() and InstallCtrlCallback(), we may have to generate some function which installs the relevant callbacks on a given panel, which would be a lot of hard-coding of references to things that could change.
* No notes on #5, that's pretty self-explanatory, though it is worth noting to recall that many global variables should be thread-locked during write operations for safety.