66// This file was created by () byte physics Thomas Braun, support@byte-physics.de
77// (c) 2013
88
9- static Function IgorStartOrNewHook ( igorApplicationNameStr)
9+ static Function IgorBeforeQuitHook ( igorApplicationNameStr)
1010 string igorApplicationNameStr
1111
12- setHooksAndUpdate ()
12+ preparePanelClose ()
1313 return 0
1414End
1515
16- static Function IgorQuitHook ( igorApplicationNameStr)
16+ static Function IgorBeforeNewHook ( igorApplicationNameStr)
1717 string igorApplicationNameStr
1818
1919 preparePanelClose ()
2020 return 0
2121End
2222
23- static Function IgorBeforeNewHook ( igorApplicationNameStr)
24- string igorApplicationNameStr
23+ static Function BeforeExperimentSaveHook ( rN,fileName,path,type,creator,kind)
24+ Variable rN, kind
25+ String fileName, path, type, creator
2526
26- preparePanelClose ()
27+ markAsUnInitialized ()
2728 return 0
2829End
2930
30- Function setHooksAndUpdate ()
31- Execute / Q "SetIgorOption IndependentModuleDev=1"
31+ Function initializePanel ()
3232
33- // prevent multiple hooks of the same function
34- SetIgorHook / K AfterCompiledHook= updatePanel
33+ debugprint ( "called" )
34+
35+ Execute / Q "SetIgorOption IndependentModuleDev=1"
3536
36- SetIgorHook AfterCompiledHook= updatePanel
37- debugprint ( "SetIgorHook AfterCompiledHook: " + S_info)
37+ SetIgorHook AfterCompiledHook= updatePanel
38+ debugprint ( "AfterCompiledHook: " + S_info)
3839 updatePanel ()
3940End
4041
4142// Prepare for panel closing, must be called before the panel is killed or the experiment closed
4243Function preparePanelClose ()
44+
4345 SetIgorHook / K AfterCompiledHook= updatePanel
44- debugprint ( "SetIgorHook AfterCompiledHook: " + S_info)
46+ debugprint ( "AfterCompiledHook: " + S_info)
4547
4648 DoWindow $ GetPanel ()
4749 if ( V_flag == 0 )
@@ -60,6 +62,14 @@ Function panelHook(s)
6062 Variable hookResult = 0
6163
6264 switch ( s. eventCode)
65+ case 0: // activate
66+ if ( isInitialized ())
67+ break
68+ endif
69+ initializePanel ()
70+ markAsUnInitialized ()
71+ hookResult = 1
72+ break
6373 case 2: // kill
6474 preparePanelClose ()
6575 hookResult = 1
0 commit comments