I may be looking for a complicated solution when an obvious one exists. I need to detect which graphs the user currently has displayed in the workspace. (If possible I would like to know there current state - Hidden/Visible/Minimized/Maximized - without changing it.)
I've been trying a combination of 'doc -e', 'win -o %H' and exist(%H,0) to get a list of non hidden graphs. %H changes to each graph name in turn. However it only correctly uses the original active graph in the exist function. Only this active non-hidden graph returns the desired result, even though 'win -o' should temporarly set the named graph as active. Below is the code I was trying.
nm=0; nn=0; doc -ef P { nn+=1; win -o %H { // Make each window active in turn type "$(nn)) %H - checking state.."; nm=exist(%H,0); // Check if Active (Should always be) & Not Hidden If (nm>=1) {type "$(nn)) %H - NOT hidden!"; }; }; }; del -v n*;
To test use three graphs: 1 - Active (%H) and visible, 2- Visible, 3- Hidden. I only get the result that 1 is not hidden.
Is there a LabTalk and/or OriginC solution?
Note - I got around this issue in my Origin 6.1 where the doc -ef function only worked on non-hidden windows.
Test the following in Origin 6.1 and Origin 7.1 (with the above mentioned 3 graphs)...
A - doc -e P { %H=;}; B - doc -ef P { %H=;};
Results: ========
Origin 6.1 - A types all graph names. - B types only names 1,2