short cuts to toggle between procedures
wings
However, it is not an efficient way to locate a procedure when the number of procedure is big (considering 100 procedures)
More often, we just need toggle between two procedures: the current procedure and the previous procedure (like alt-tab in Windows)
Is there a quick way to realize this?
thanks
April 3, 2017 at 07:35 pm - Permalink
On Windows, press Ctrl-E (Send to back) and Shift-Ctrl-E (Bring to front).
On Macintosh, press Cmd-tilde (Send to back) and Shift-Cmd-tilde (Bring to front). Tilde is ~. I'm not sure how you do this on a non-English keyboard.
April 3, 2017 at 10:39 pm - Permalink
this works!
thanks!
April 4, 2017 at 04:14 am - Permalink
Thanks for your help.
I have another question. People in our lab complain about the too small looking of the controls on a panel in Igor6.
Of course, they are using igor 6 under win10 with a high-resolution display.
We know Igor7 works fine on high-resolution displays. But we now need igor6 because we have a great lots of procedures which run fine under igor6 but not so good under igor7(I am trying to find the reason, but before that ,Igor 6 is prefered).
From igor7's helptopic about high-resolution display, I know the too small looking is because controls command uses pixels, instead of points.
Is there an easy way to make the control command draw controls in points under igor 6?
or any other solution can make the controls look normal?
Thanks
April 4, 2017 at 06:44 am - Permalink
-Matthew
April 4, 2017 at 06:40 am - Permalink
Yes.
If number of controls is small, I can make it looks bigger by just dragging each control to a proper size, as you say.
However, there are about twenty panels, each of them having dozens of controls. So...
Besides, deliberatly set each control to fit Igor6 may make it abnormal in igor7 or on a normal-resolution display.
Still thank you:)
April 4, 2017 at 07:10 am - Permalink
The best, of course, is to use Igor 7. But you say your procedures have problems. Are there compile errors? Or simply bugs? If you have not done it already, you should be sure that the top of your procedure windows has
#pragma rtglobals=3
to get the benefit of more stringent error checking.John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
April 4, 2017 at 10:10 am - Permalink
I find this user-defined menu useful to change the size of controls in the the active panel:
Edit: the procedure code I put here doesn't solve the problem of the entire panel being too small, it just made controls inside the panel bigger, potentially causing text truncation inside of controls.
So I've removed the previously posted (and incomplete code) for now and will think about how to solve the problem another way (probably using PanelResolution on Igor 7).
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
April 4, 2017 at 03:05 pm - Permalink
We dont have compile errors.
The problem is that: our procedure runs slowly in igor7, while not the case in Igor6.
Especially the interface response becomes very slow when the number of control panel and other objects gets large. (our data is typically 300~700M and the procedure files is about 80 M)
There is no other difference except running speed.
Thanks
April 4, 2017 at 06:03 pm - Permalink
I'll do test, if it works, it would be great!!
Thanks:)
April 5, 2017 at 04:13 am - Permalink
I dont find the key function "setcontrolfonts". can you show me that function?
thanks
April 5, 2017 at 04:03 pm - Permalink
My code didn't solve your problem, actually, so I've removed it. I think a PanelResolution option might work if it is in effect before the panel is first built.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
April 5, 2017 at 04:27 pm - Permalink
Here's a potential solution (it's not perfect because it works by killing and recreating the window without correcting the window top left position).
Still, it may be helpful:
Requires Igor 7 or later.
#pragma rtGlobals=3 // Use modern global access method and strict wave access.
#pragma ModuleName=PanelSizes
#pragma version=7 // circa Igor 7
#if IgorVersion() >= 7
Menu "Panel", dynamic
"-"
Submenu "Size"
"Make Panel Bigger",/Q, PanelSizes#MakeTopPanelBigger()
"Make Panel Smaller",/Q, PanelSizes#MakeTopPanelSmaller()
"Make Panel Normal Size",/Q, PanelSizes#MakeTopPanelNormal()
"\\M1:(:Panel Resolution = "+num2str(PanelResolution(WinName(0,64)))
"\\M1:(:Screen Resolution = "+num2str(ScreenResolution)
End
"-"
End
#endif
static Function MakeTopPanelBigger()
String panel= WinName(0,64)
if( strlen(panel) )
Variable currentRes= PanelResolution(panel)
Variable newRes= BiggerResolution(currentRes)
String newCode= RewritePanelCodeResolution(panel, newRes)
KillWindow/Z $panel
Execute/Q/Z newCode
DoIgorMenu "Control", "Retrieve Window"
endif
End
static Function MakeTopPanelSmaller()
String panel= WinName(0,64)
if( strlen(panel) )
Variable currentRes= PanelResolution(panel)
Variable newRes= SmallerResolution(currentRes)
String newCode= RewritePanelCodeResolution(panel, newRes)
KillWindow/Z $panel
Execute/Q/Z newCode
endif
End
static Function MakeTopPanelNormal()
String panel= WinName(0,64)
if( strlen(panel) )
Variable newRes= 1 // This is the default setting in effect when Igor starts.
String newCode= RewritePanelCodeResolution(panel, newRes)
KillWindow/Z $panel
Execute/Q/Z newCode
DoIgorMenu "Control", "Retrieve Window"
endif
End
static StrConstant ksResolutions= "72;96;120;144;192;240;288;384;480;"
static Function BiggerResolution(currentRes)
Variable currentRes
Variable nextRes= ActualResolution(currentRes)
String strRes= num2istr(nextRes)
Variable whichOne = WhichListItem(strRes, ksResolutions)
Variable numItems= ItemsInList(ksResolutions)
if( whichOne >= 0 && whichOne < numItems-1)
nextRes = str2num(StringFromList(whichOne+1, ksResolutions))
else
nextRes = str2num(StringFromList(numItems-1, ksResolutions))
endif
return nextRes
End
static Function SmallerResolution(currentRes)
Variable currentRes
Variable nextRes= ActualResolution(currentRes)
String strRes= num2istr(nextRes)
Variable whichOne = WhichListItem(strRes, ksResolutions)
if( whichOne > 0 )
nextRes = str2num(StringFromList(whichOne-1, ksResolutions))
else
nextRes = 72
endif
return nextRes
End
static Function ActualResolution(currentRes)
Variable currentRes
Variable actualRes= currentRes
Variable screenRes= ScreenResolution // On Macintosh this was always 72 before Retina displays. On Windows it is usually 96 (small fonts) or 120 (large fonts).
if( actualRes == 0 ) // points
actualRes = screenRes
elseif( actualRes == 1 )
if( screenRes == 96 )
actualRes = 72
else
actualRes = screenRes
endif
endif
return actualRes
End
static Function/S RewritePanelCodeResolution(panel, newRes)
String panel
Variable newRes
String code= WinRecreation(panel, 4)
Wave/T tw = ListToTextWave(code, "\r")
// insert three lines of code before line 2 (line 0 is Macro... and line 1 is PauseUpdate...)
InsertPoints 2,3, tw
tw[2]= " SetIgorOption PanelResolution=?"
tw[3]= " Variable oldResolution = V_Flag"
tw[4]= " SetIgorOption PanelResolution="+num2istr(newRes)
Variable lines= numpnts(tw)
// insert SetIgorOption PanelResolution=oldResolution
// before EndMacro (line lines-1)
InsertPoints lines-1, 1, tw
tw[lines-1]= " SetIgorOption PanelResolution=oldResolution"
// convert back to code
String list
wfprintf list, "%s\r", tw
return list
End
April 14, 2017 at 06:03 pm - Permalink
April 19, 2017 at 02:32 am - Permalink