Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26733 Modified Files: cmd2Click saveWindow tcpSetOffline opCursorMoved systemTrayIconRightClick opStruct2Click closeWindow opRightClick startup openWindow option2Click opReturnKey resume suspend compileChangedScript opCollapse shutdown control2Click opExpand systemTrayIcon2Click opInsert Log Message: changed to use Frontier.createUserCallbacksSubtable Index: tcpSetOffline =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/tcpSetOffline,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tcpSetOffline 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- tcpSetOffline 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.tcpSetOffline ! on tcpSetOffline (flOffline) { ÇChanges Ç10/16/01; 12:49:13 PM by DW ÇCreated. Called from tcp.setOffline. local (adrscript); if not defined (user.callbacks.tcpSetOffline) { new (tableType, @user.callbacks.tcpSetOffline)}; for adrscript in @user.callbacks.tcpSetOffline { try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ (flOffline)}}} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.tcpSetOffline ! on tcpSetOffline (flOffline) { ÇChanges Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables Ç10/16/01; 12:49:13 PM by DW ÇCreated. Called from tcp.setOffline. local (adrscript); Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.tcpSetOffline) // old code Çnew (tableType, @user.callbacks.tcpSetOffline) for adrscript in @user.callbacks.tcpSetOffline { try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ (flOffline)}}} \ No newline at end of file Index: opInsert =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/opInsert,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** opInsert 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- opInsert 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.opInsert ! on opInsert () { ÇThis script is called after the user creates a new headline in any outline. In turn it calls all the scripts in user.callbacks.opInsert Ç9/20/01; 2:57:32 PM by PBS local (adrscript); if not defined (user.callbacks.opInsert) { new (tableType, @user.callbacks.opInsert)}; for adrscript in @user.callbacks.opInsert { try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrscript^ ()}}} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.opInsert ! on opInsert () { ÇThis script is called after the user creates a new headline in any outline. In turn it calls all the scripts in user.callbacks.opInsert ÇChanges Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables Ç9/20/01; 2:57:32 PM by PBS local (adrscript); Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.opInsert) // old code Çnew (tableType, @user.callbacks.opInsert) for adrscript in @user.callbacks.opInsert { try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrscript^ ()}}} \ No newline at end of file Index: suspend =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/suspend,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** suspend 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- suspend 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.suspend ! on suspend () { ÇCall user's suspend scripts. ÇFor notification only. ÇChanges: ÇThursday, September 28, 2000 at 7:00:45 PM by JES ÇAllow the callback to be an address or the address of an address... local (i); if not defined (user.callbacks.suspend) { new (tabletype, @user.callbacks.suspend)}; for i = 1 to sizeof (user.callbacks.suspend) { try { local (adrScript = @user.callbacks.suspend [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ ()}}; return (true)} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.suspend ! on suspend () { ÇCall user's suspend scripts. For notification only. ÇChanges Ç6/18/05; 1:47:59 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables ÇThursday, September 28, 2000 at 7:00:45 PM by JES ÇAllow the callback to be an address or the address of an address... local (i); Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.suspend) // old code Çnew (tabletype, @user.callbacks.suspend) for i = 1 to sizeof (user.callbacks.suspend) { try { local (adrScript = @user.callbacks.suspend [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ ()}}; return (true)} \ No newline at end of file Index: opExpand =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/opExpand,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** opExpand 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- opExpand 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.opExpand ! on opExpand () { ÇCreated, Thu, Jul 13, 2000 at 11:18:23 PM by AR ÇThis script is called when the user expands a headline in an outline. It loops over scripts in user.callbacks.opExpand. ÇAdd your callback scripts to user.callbacks.opExpand. Return true if you "consume" the event, return false if you want other callback scripts to get a shot at it. ÇChanges: ÇThursday, September 28, 2000 at 6:12:13 PM by JES ÇAllow callbacks to be addresses or addresses of addresses... local (adrscript); if not defined (user.callbacks.opExpand) { new (tableType, @user.callbacks.opExpand)}; for adrscript in @user.callbacks.opExpand { try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; if adrscript^ () { return (true)}}}; //consumed return (false)} //not consumed \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.opExpand ! on opExpand () { ÇChanges: Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables ÇThursday, September 28, 2000 at 6:12:13 PM by JES ÇAllow callbacks to be addresses or addresses of addresses... ÇThu, Jul 13, 2000 at 11:18:23 PM by AR ÇCreated. ÇThis script is called when the user expands a headline in an outline. It loops over scripts in user.callbacks.opExpand. ÇAdd your callback scripts to user.callbacks.opExpand. Return true if you "consume" the event, return false if you want other callback scripts to get a shot at it. local (adrscript); Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.opExpand) // old code Çnew (tableType, @user.callbacks.opExpand) for adrscript in @user.callbacks.opExpand { try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; if adrscript^ () { return (true)}}}; //consumed return (false)} //not consumed \ No newline at end of file Index: resume =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/resume,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** resume 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- resume 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.resume ! on resume () { ÇCall user's resume scripts. ÇAny returned value is ignored. ÇChanges: ÇThursday, September 28, 2000 at 6:22:54 PM by JES ÇAllow the callback to be an address or the address of an address. local (i); if not defined (user.callbacks.resume) { new (tabletype, @user.callbacks.resume)}; for i = 1 to sizeof (user.callbacks.resume) { try { local (adrScript = @user.callbacks.resume [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ ()}}; return (true)} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.resume ! on resume () { ÇCall user's resume scripts. Any returned value is ignored. ÇChanges Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables ÇThursday, September 28, 2000 at 6:22:54 PM by JES ÇAllow the callback to be an address or the address of an address. local (i); Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.resume) // old code Çnew (tabletype, @user.callbacks.resume) for i = 1 to sizeof (user.callbacks.resume) { try { local (adrScript = @user.callbacks.resume [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ ()}}; return (true)} \ No newline at end of file Index: saveWindow =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/saveWindow,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** saveWindow 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- saveWindow 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.saveWindow ! on saveWindow (w, runnable = false) { Çnew in Frontier 4.0b7 ÇThursday, July 17, 1997 ÇNew parameter: runnable, defaults to false. ÇIf true, this is a deskscript. ÇCall user's saveWindow scripts. ÇFor notification only. This script Çwill save the window no matter what the Çuser's scripts return. ÇChanges: ÇThursday, September 28, 2000 at 6:24:24 PM by JES ÇAllow the callback to be an address or the address of an address... local (i); if string.lower (window.getFile (w)) endsWith ".ftds" { runnable = true}; if file.exists (window.getFile (w)) and file.type (w) == 'FTds' { runnable = true}; if not defined (user.callbacks.saveWindow) { new (tabletype, @user.callbacks.saveWindow)}; for i = 1 to sizeof (user.callbacks.saveWindow) { try { local (adrScript = @user.callbacks.saveWindow [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ (w, runnable)}}; local (x = fatPages.buildFileAtts (w, runnable)); return (x)} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.saveWindow ! on saveWindow (w, runnable = false) { Çnew in Frontier 4.0b7 ÇCall user's saveWindow scripts. ÇFor notification only. This script will save the window no matter what the user's scripts return. ÇChanges Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables ÇThursday, September 28, 2000 at 6:24:24 PM by JES ÇAllow the callback to be an address or the address of an address... ÇThursday, July 17, 1997 ÇNew parameter: runnable, defaults to false. If true, this is a deskscript. local (i); if string.lower (window.getFile (w)) endsWith ".ftds" { runnable = true}; if file.exists (window.getFile (w)) and file.type (w) == 'FTds' { runnable = true}; Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.saveWindow) // old code Çnew (tabletype, @user.callbacks.saveWindow) for i = 1 to sizeof (user.callbacks.saveWindow) { try { local (adrScript = @user.callbacks.saveWindow [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ (w, runnable)}}; local (x = fatPages.buildFileAtts (w, runnable)); return (x)} \ No newline at end of file Index: systemTrayIcon2Click =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/systemTrayIcon2Click,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** systemTrayIcon2Click 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- systemTrayIcon2Click 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.systemTrayIcon2Click ! on systemTrayIcon2Click () { if not defined (user.callbacks.systemTrayIcon2Click) { new (tabletype, @user.callbacks.systemTrayIcon2Click)}; local (i); for i = 1 to sizeof (user.callbacks.systemTrayIcon2Click) { try { local (adrScript = @user.callbacks.systemTrayIcon2Click [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ ()}}; return (true)} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.systemTrayIcon2Click ! on systemTrayIcon2Click () { ÇChanges Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables local (i); Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.systemTrayIcon2Click) // old code Çnew (tabletype, @user.callbacks.systemTrayIcon2Click) for i = 1 to sizeof (user.callbacks.systemTrayIcon2Click) { try { local (adrScript = @user.callbacks.systemTrayIcon2Click [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ ()}}; return (true)} \ No newline at end of file Index: opRightClick =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/opRightClick,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** opRightClick 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- opRightClick 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.opRightClick ! on opRightClick () { ÇCreated, Friday, August 18, 2000 at 2:28:24 PM by DW ÇThis script is called when the user right-clicks in any outline. In turn it calls all the scripts in user.callbacks.opRightClick. ÇThe first callback that returns a menu consumes the event, and we return the address they return to us. ÇChanges: ÇThursday, September 28, 2000 at 6:15:29 PM by JES ÇAllow the callback to be an address or the address of an address... local (adrscript, adrmenu = nil); if not defined (user.callbacks.opRightClick) { new (tableType, @user.callbacks.opRightClick)}; for adrscript in @user.callbacks.opRightClick { try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrscript^ (@adrmenu); if adrmenu != nil { return (adrmenu)}}}} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.opRightClick ! on opRightClick () { ÇChanges Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables ÇThursday, September 28, 2000 at 6:15:29 PM by JES ÇAllow the callback to be an address or the address of an address... ÇFriday, August 18, 2000 at 2:28:24 PM by DW ÇCreated. ÇThis script is called when the user right-clicks in any outline. In turn it calls all the scripts in user.callbacks.opRightClick. ÇThe first callback that returns a menu consumes the event, and we return the address they return to us. local (adrscript, adrmenu = nil); Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.opRightClick) // old code Çnew (tableType, @user.callbacks.opRightClick) for adrscript in @user.callbacks.opRightClick { try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrscript^ (@adrmenu); if adrmenu != nil { return (adrmenu)}}}} \ No newline at end of file Index: startup =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/startup,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** startup 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- startup 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.startup ! ÇCall user's startup scripts ÇChanges: ÇThursday, September 28, 2000 at 7:00:15 PM by JES ÇAllow the callback to be an address or the address of an address... if not defined (user.callbacks) { new (tabletype, @user.callbacks)}; if not defined (user.callbacks.startup) { new (tabletype, @user.callbacks.startup)}; local (i); for i = 1 to sizeof (user.callbacks.startup) { try { local (adrScript = @user.callbacks.startup [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ ()}} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.startup ! ÇCall user's startup scripts ÇChanges Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables ÇThursday, September 28, 2000 at 7:00:15 PM by JES ÇAllow the callback to be an address or the address of an address... Frontier.createUserCallbacksSubtable (nameOf (this^)); Çbundle // old code Çif not defined (user.callbacks) Çnew (tabletype, @user.callbacks) Çif not defined (user.callbacks.startup) // old code Çnew (tabletype, @user.callbacks.startup) local (i); for i = 1 to sizeof (user.callbacks.startup) { try { local (adrScript = @user.callbacks.startup [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ ()}} \ No newline at end of file Index: opStruct2Click =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/opStruct2Click,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** opStruct2Click 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- opStruct2Click 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.opStruct2Click ! on opStruct2Click () { ÇCreated, 1/15/00; 7:45:16 PM by DW ÇThis script is called when the user 2clicks on a headline in an outline to expand or collapse it. It loops over scripts in user.callbacks.opStruct2Click. ÇAdd your callback scripts to user.callbacks.opStruct2Click. Return true if you "consume" the 2click, return false if you want other callback scripts to get a shot at it. ÇChanges: ÇThursday, September 28, 2000 at 6:16:58 PM by JES ÇAllow the callback to be an address or the address of an address... local (adrscript); if not defined (user.callbacks.opStruct2Click) { new (tableType, @user.callbacks.opStruct2Click)}; for adrscript in @user.callbacks.opStruct2Click { try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; if adrscript^ () { return (true)}}}; //consumed return (false)}; //not consumed Çbundle //test code ÇopStruct2Click () \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.opStruct2Click ! on opStruct2Click () { ÇChanges Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables ÇThursday, September 28, 2000 at 6:16:58 PM by JES ÇAllow the callback to be an address or the address of an address... Ç1/15/00; 7:45:16 PM by DW ÇCreated. ÇThis script is called when the user 2clicks on a headline in an outline to expand or collapse it. It loops over scripts in user.callbacks.opStruct2Click. ÇAdd your callback scripts to user.callbacks.opStruct2Click. Return true if you "consume" the 2click, return false if you want other callback scripts to get a shot at it. local (adrscript); Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.opStruct2Click) // old code Çnew (tableType, @user.callbacks.opStruct2Click) for adrscript in @user.callbacks.opStruct2Click { try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; if adrscript^ () { return (true)}}}; //consumed return (false)}; //not consumed Çbundle //test code ÇopStruct2Click () \ No newline at end of file Index: opCursorMoved =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/opCursorMoved,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** opCursorMoved 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- opCursorMoved 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.opCursorMoved ! on opCursorMoved () { ÇCalled when the cursor moves in an outline. Ç08/14/00; 4:22:13 PM by PBS ÇChanges: ÇThursday, September 28, 2000 at 5:07:01 PM by JES ÇAllow callback entries to be addresses or addresses of addresses... local (adrScript); if not defined (user.callbacks.opCursorMoved) { new (tableType, @user.callbacks.opCursorMoved)}; for adrScript in @user.callbacks.opCursorMoved { try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ ()}}; return} //this callback can't consume events, it's for notification only \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.opCursorMoved ! on opCursorMoved () { ÇChanges Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables ÇThursday, September 28, 2000 at 5:07:01 PM by JES ÇAllow callback entries to be addresses or addresses of addresses... Ç08/14/00; 4:22:13 PM by PBS ÇCalled when the cursor moves in an outline. local (adrScript); Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.opCursorMoved) // old code Çnew (tableType, @user.callbacks.opCursorMoved) for adrScript in @user.callbacks.opCursorMoved { try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ ()}}; return} //this callback can't consume events, it's for notification only \ No newline at end of file Index: compileChangedScript =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/compileChangedScript,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** compileChangedScript 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- compileChangedScript 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.compileChangedScript ! on compileChangedScript (adr) { Çsee if the user wants to compile script changes Çthis script is called by Frontier before closing a script window that had been edited Çif you never want to see the dialog, delete the dialog call, and just return true ÇCallbacks implemented: Tue, Oct 7, 1997 ÇCallback script returns to true to handle this. ÇElse default behavior. ÇChanges: ÇThursday, September 28, 2000 at 6:05:24 PM by JES ÇAllow callbacks to be addresses or addresses of addresses... local (i); if not defined (user.callbacks.compileChangedScript) { new (tabletype, @user.callbacks.compileChangedScript)}; for i = 1 to sizeof (user.callbacks.compileChangedScript) { try { local (adrScript = @user.callbacks.compileChangedScript [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; if adrScript^ (adr) { return (true)}}}; local (scriptname = nameOf (adr^)); speaker.beep (); return (dialog.yesNoCancel ("Compile changes to \"" + scriptname + "\" before closing?"))} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.compileChangedScript ! on compileChangedScript (adr) { Çsee if the user wants to compile script changes Çthis script is called by Frontier before closing a script window that had been edited Çif you never want to see the dialog, delete the dialog call, and just return true ÇChanges Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables ÇThursday, September 28, 2000 at 6:05:24 PM by JES ÇAllow callbacks to be addresses or addresses of addresses... ÇTue, Oct 7, 1997 ÇCallbacks implemented: ÇCallback script returns true to handle this else default behavior. local (i); Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.compileChangedScript) // old code Çnew (tabletype, @user.callbacks.compileChangedScript) for i = 1 to sizeof (user.callbacks.compileChangedScript) { try { local (adrScript = @user.callbacks.compileChangedScript [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; if adrScript^ (adr) { return (true)}}}; local (scriptname = nameOf (adr^)); speaker.beep (); return (dialog.yesNoCancel ("Compile changes to \"" + scriptname + "\" before closing?"))} \ No newline at end of file Index: openWindow =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/openWindow,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** openWindow 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- openWindow 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.openWindow ! on openWindow (name) { ÇCall user's openWindow scripts. ÇReturned values are ignored. ÇChanges: ÇThursday, September 28, 2000 at 6:11:05 PM by JES ÇAllow callbacks to be addresses or addresses of addresses... local (i); if not defined (user.callbacks.openWindow) { new (tabletype, @user.callbacks.openWindow)}; for i = 1 to sizeof (user.callbacks.openWindow) { try { local (adrScript = @user.callbacks.openWindow [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ (name)}}; return (true)} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.openWindow ! on openWindow (name) { ÇCall user's openWindow scripts. ÇReturned values are ignored. ÇChanges Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables ÇThursday, September 28, 2000 at 6:11:05 PM by JES ÇAllow callbacks to be addresses or addresses of addresses... local (i); Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.openWindow) // old code Çnew (tabletype, @user.callbacks.openWindow) for i = 1 to sizeof (user.callbacks.openWindow) { try { local (adrScript = @user.callbacks.openWindow [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ (name)}}; return (true)} \ No newline at end of file Index: closeWindow =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/closeWindow,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** closeWindow 26 Mar 2005 19:41:18 -0000 1.1.1.1 --- closeWindow 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.closeWindow ! on closeWindow (title) { Çnew in Frontier 4.0b7 ÇSat, Apr 27, 1996 at 9:24:55 AM by DMB ÇThe script can prevent the close from happening by returning false ÇOr it can just make a note of the change ÇThe title may be the address of a database object, or "Error Info", "QuickScript", etc. ÇIt can also be called for the main window, when the database is about to be closed. Çsystem.shutdown scripts are called later, after changes have been saved. ÇThe script is only called when the user closes the window; not when a script does it. ÇHere's how to avoid the "Save Changes?" dialog: Çif title == file.fileFromPath (Frontier.getFilePath ()) ÇFileMenu.Save () ÇThu, Dec 19, 1996 at 9:08:29 AM by DW Çcall any number of scripts in user.hooks.closeWindow table Çany of these scripts can stop the window from closing Çthe last script has the last word ÇThursday, September 28, 2000 at 5:32:27 PM by JES ÇAllow callbacks to be addresses or addresses of addresses... if not defined (user.callbacks.closeWindow) { new (tabletype, @user.callbacks.closeWindow)}; bundle { //old code local (i); for i = 1 to sizeof (user.callbacks.closeWindow) { try { local (adrScript = @user.callbacks.closeWindow [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; if not adrScript^ (title) { return (false)}}}}; return (true)} Çreturn true to allow the window to close \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.closeWindow ! on closeWindow (title) { Çnew in Frontier 4.0b7 ÇChanges Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables ÇThursday, September 28, 2000 at 5:32:27 PM by JES ÇAllow callbacks to be addresses or addresses of addresses... ÇThu, Dec 19, 1996 at 9:08:29 AM by DW Çcall any number of scripts in user.hooks.closeWindow table Çany of these scripts can stop the window from closing Çthe last script has the last word ÇSat, Apr 27, 1996 at 9:24:55 AM by DMB ÇThe script can prevent the close from happening by returning false ÇOr it can just make a note of the change ÇThe title may be the address of a database object, or "Error Info", "QuickScript", etc. ÇIt can also be called for the main window, when the database is about to be closed. Çsystem.shutdown scripts are called later, after changes have been saved. ÇThe script is only called when the user closes the window; not when a script does it. ÇHere's how to avoid the "Save Changes?" dialog: Çif title == file.fileFromPath (Frontier.getFilePath ()) ÇFileMenu.Save () Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.closeWindow) // old code Çnew (tabletype, @user.callbacks.closeWindow) bundle { //old code local (i); for i = 1 to sizeof (user.callbacks.closeWindow) { try { local (adrScript = @user.callbacks.closeWindow [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; if not adrScript^ (title) { return (false)}}}}; return (true)} Çreturn true to allow the window to close \ No newline at end of file Index: cmd2Click =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/cmd2Click,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** cmd2Click 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- cmd2Click 19 Jun 2005 03:55:45 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.cmd2Click ! on cmd2Click (name) { Çcalled when you cmd-double-click on an identifier ÇIt enhances the default, built-in behavior of jumping to the named object. ÇIt checks for the option key, and closes the front window if it's pressed. ÇIf the name is a file rather than a db object, it will reveal it in the Finder Çssl change notes: Çenhanced to walk up the script/outline hierarchy and check every "with" path Çin an outline window, assume it's a oneLiner Çadded support for reserved constants, keywords & builtins Ç3/19/96: moved checkWith etc. to enhanced2click table to simplify distribution Ç6/17/95: added support for local scripts (via checkScript) Çchanges are Pioneerware by Scott S. Lawton ÇInternet: ss...@pr..., http://www.tiac.net/prefab/ Çdmb 8/15/96: integrated ssl's "enhanced2click" functionality Ç4.2 -- Wed, Dec 11, 1996 at 11:16:00 PM by DW Çhandles macros in web pages ÇNew callbacks for cmd2click ÇTue, Oct 7, 1997 at 11:37:49 AM by PBS ÇCallback script returns true if it handled the click, Çthen this script immediately returns true. ÇOtherwise, this script handles the click. ÇChanges: Ç4/20/01; 4:05:40 PM by JES ÇAllow callbacks to be addresses or addresses of addresses... on checkWith (name, callbackAction) { Çwalk up the script/outline hierarchy checking in "with" for a match: "table.[name]" Çcalled by my cmd2click, control2click ÇPioneerware by Scott S. Lawton Çrevisions Ç6/13/96: handle menuscripts Ç5/16/96: now handle an "object database map" Ç3/19/96: moved to enhanced2click table, updated paths Ç1/27/96 to handle double-clicking on part of the hierarchy within a single "with" Ç5/28/95 to handle comment in the "with" Ç5/15/95 to handle hierarchy within a single "with" Çe.g. "with ObjectModel, QXP, defs" Ç(Actually, I only look at pairs. It didn't seem worth the effort to test every combination.) Çpossible improvements Çlook for nested "with" (as I do for outlines & an "object database map"), e.g. Çwith Player Çwith Keys Çlook for all combinations with multiple "fields" (not just pairs), e.g. Çwith QXP, ObjectModel, defs Çlook at every "with" in an outline oneLiner Çcall Simple.window.frontmostType to handle menuscripts Çbut then the enhanced2click package wouldn't stand on its own local { categorizedName = name; theLine; space = " "; windowType = "Unknown"; Ç modified below... windowName = window.frontmost(); whereAmI; displayStatus; leftOfSelection = 0; rightOfSelection = 0}; try { Çthe following fails for a few cases, see Simple.window.frontmostType() ... the only one we need is handled in the else windowType = typeOf(windowName^)} else { Ç 6/13/96 if window.isMenuScript(windowName) { windowType = scriptType}}; on initialize() { displayStatus = op.getDisplay(); Ç want to restore it to original state op.setDisplay(false); Ç no need to show the user our travels case windowType { outlineType; Ç added 5/16/96 ==> changed to a case statement scriptType { whereAmI = op.getCursor()}}; Ç uniqueID, to restore at end if wp.inTextMode() { Ç doesn't apply to cmd2Click, but may to Jump wp.getSelect(@leftOfSelection, @rightOfSelection)}; };Çelse: the left/right of selection are correct at zero on restoreOutline() { case windowType { outlineType; Ç added 5/16/96 ==> changed to a case statement scriptType { op.setCursor(whereAmI)}}; wp.setTextMode(true); wp.setSelect(leftOfSelection, rightOfSelection); op.setDisplay(displayStatus)}; on checkAllFields() { Çglobals ÇtheLine Ç which has the spaces removed Çname ÇwhereAmI local { comma = ","; fieldCount; previous; i}; fieldCount = string.countFields(theLine, comma); for i = 1 to fieldCount { categorizedName = string.nthField(theLine, comma, i) + "." + name; if defined (categorizedName^) { restoreOutline(); callbackAction^(categorizedName, true); Ç second parameter: yes it's in a "with" return (true)}}; for i = 1 to fieldCount { Ç 5/15/95: check pairs next (less likely) previous = string.nthField(theLine, comma, i); for j = i+1 to fieldCount { categorizedName = previous + "." + string.nthField(theLine, comma, j) + "." + name; if defined (categorizedName^) { restoreOutline(); callbackAction^(categorizedName, true); Ç second parameter: yes it's in a "with" return (true)}}}; return false}; Ç won't get here if it finds a match on handleWith() { Ç1/27/96: call twice ==> moved to a subroutine theLine = string.popLeading( string.lower(op.getLineText()), space ); if theLine beginsWith "with " { theLine = string.commentDelete(theLine); Ç 5/28/95 Çget rid of the with, then strip out spaces so they don't interfere with nthField theLine = string.replaceAll( theLine - "with", space, "" ); if checkAllFields() { Çit also performs the callbackAction return true} else { return false}} else { return false}}; on handleOutlineHierarchy() { Ç5/16/96: doesn't actually check "with", but something similar Çit's easier to add here than as a separate script since it calls initialize & restoreOutline categorizedName = string.nthField(string.popLeading(op.getLineText(), space), space, 1) + "." + categorizedName; if defined (categorizedName^) { restoreOutline(); callbackAction^(categorizedName, true); Ç second parameter: yes it's in a "with" return (true)} else { return false}}; case windowType { scriptType { initialize(); if handleWith () { Ç 1/27/96: for cases like "with Player, keys"; 2click on keys return true}; Ç i.e. out of the whole script while op.go (left, 1) { if handleWith () { return true}}; Ç i.e. out of the whole script restoreOutline (); return false}; outlineType { Ç assume it's a oneLiner (5/16/96: also handle an "object database map") initialize(); local { theLine = string.lower(op.getLineText())}; if theLine contains "with " { Ç at present: only looks at the FIRST "with" local { fromPosition = string.patternMatch("with ", theLine) + 5; toPosition = string.patternMatch("{", theLine); numChars = toPosition - fromPosition}; Çget rid of the with, then strip out spaces so they don't interfere with nthField theLine = string.replaceAll(string.mid(theLine, fromPosition, numChars), space, ""); if checkAllFields() { Çit also performs the callbackAction return true}} Ç i.e. out of the whole script else { Ç modified 5/16/96 to walk up the hierarchy Çunlike "with", do NOT check the current line ÇcategorizedName starts out as just name; that's what we want here too while op.go(left, 1) { Ç 5/16/96 if handleOutlineHierarchy() { return true}}; Ç i.e. out of the whole script restoreOutline(); return false}}} else { return false}}; on pathToBracketedPath (s) { ÇSunday, January 25, 1998 at 4:21:03 PM by PBS local (path, flinquotes, flinbrackets, fladd, flend); local (i, ch = "", lastch = "", piece); local (oneElement = "", elementList = {}); for i = 1 to sizeOf (s) { fladd = false; flend = false; lastch = ch; ch = s [i]; case ch { '"' { if lastch == '\\' { fladd = true} else { if !flinquotes { flinquotes = true} else { flinquotes = false}}}; '[' { if !flinquotes { flinbrackets = true}}; ']' { if !flinquotes { flinbrackets = false}}; '.' { if !flinquotes and !flinbrackets { flend = true} else { fladd = true}}} else { fladd = true}; if fladd { oneElement = oneElement + ch}; if flend { elementList = elementList + oneElement; oneElement = ""}}; elementList = elementList + oneElement; for oneElement in elementList { path = path + "[\"" + oneElement + "\"]."}; path = string.mid (path, 1, sizeOf (path) - 1); // strip off trailing dot return (path)}; if not defined (user.callbacks.cmd2click) { new (tabletype, @user.callbacks.cmd2click)}; local (i); local (bracketedName); for i = 1 to sizeof (user.callbacks.cmd2click) { local (adrScript = @user.callbacks.cmd2click [i]); try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; if adrScript^ (name) { return (true)}}}; on checkOtherTables (name, callbackAction) { Çlook in tables that UserTalk references, but aren't global ... to match "table.[name]" Çcalled by my cmd2click, Cmd-Jump & possibly others ÇPioneerware by Scott S. Lawton Çrevisions Ç3/19/96: moved to enhanced2click table, updated paths Ç5/15/95: handle subtables, e.g. "dialog.getFile" (in Simple) should NOT be bracketed local { jumpPaths = { "system.compiler.language.constants", "system.compiler.language.builtins", "system.compiler.language.keywords", "system.misc", "people", "system.verbs", "Simple"}; path; test}; for path in jumpPaths { test = path + "." + name; Ç added 5/15/95 if defined (test^) { callbackAction^ (test); return true}; test = path + "." + "[\"" + name + "\"]"; if defined (test^) { callbackAction^ (test); return true}}; return false}; Ç will only get here if the above fails on checkScript (name) { Çlook in the script itself for a local "handler" Çcalled by my cmd2click, control2click, Cmd-Jump & possibly others ÇPioneerware by Scott S. Lawton Çrevisions Ç3/19/96: moved to enhanced2click table, updated paths Ç6/17/95: created local { windowType = "Unknown"; Ç modified below... whereAmI; displayStatus; leftOfSelection = 0; rightOfSelection = 0}; try { Çthe following fails for a few cases, see Simple.window.frontmostType() ... though it isn't needed here windowType = typeOf (window.frontmost()^)}; on initialize() { displayStatus = op.getDisplay(); Ç want to restore it to original state op.setDisplay (false); Ç no need to show the user our travels if windowType equals scriptType { whereAmI = op.getCursor()}; Ç uniqueID, to restore at end if wp.inTextMode() { Ç doesn't apply to cmd2Click, but may to Jump wp.getSelect(@leftOfSelection, @rightOfSelection)}; };Çelse: the left/right of selection are correct at zero on restoreOutline() { if windowType equals scriptType { op.setCursor(whereAmI)}; wp.setTextMode(true); wp.setSelect(leftOfSelection, rightOfSelection); op.setDisplay(displayStatus)}; if windowType equals scriptType { initialize(); bundle { Ç set the search parameters user.prefs.search.casesensitive = false; user.prefs.search.wholewords = false; user.prefs.search.wraparound = true}; op.firstSummit (); Ç FIND seems to take current heading as its scope if op.find ("on " + name) { Ç look for the "category" text wp.setTextMode (true); op.setDisplay (displayStatus); return true} else { restoreOutline (); return false}} else { return false}}; on doIt (objectName, fromWith = false) { ÇSSL: moved standard behavior here if kb.optionKey () { local (front = window.frontMost ()); edit (address (objectName)); if window.getFile (front) == nil { window.close (front)} else { window.hide (front)}} else { edit (address (objectName))}}; if defined (name^) { Çsimple: just jump to it doIt (name); return (true)}; bracketedName = pathToBracketedPath (name); if defined (bracketedName^) { doIt (bracketedName); return (true)}; if defined (("websites." + name)^) { //it's in the websites table ÇSaturday, January 24, 1998 at 4:03:20 PM by PBS doIt ("websites." + name); return (true)}; if defined (("websites." + bracketedName)^) { //it's in the websites table ÇSaturday, January 24, 1998 at 4:03:20 PM by PBS doIt ("websites." + bracketedName); return (true)}; bundle { Ç4.2 -- make cmd-2clicking work for macros ÇWed, Dec 11, 1996 at 7:30:25 PM by DW try { if defined (websites.["#data"].tools) { if defined (websites.["#data"].tools^.[name]) { edit (@websites.["#data"].tools^.[name]); return (true)}}}; try { if defined (user.html.macros.[name]) { edit (@user.html.macros.[name]); return (true)}}; try { if defined (user.html.renderers.[name]) { edit (@user.html.renderers.[name]); return (true)}}; try { if defined (html.data.standardMacros.[name]) { edit (@html.data.standardMacros.[name]); return (true)}}}; if checkOtherTables (name, @doIt) { Çcheck reserved words return (true)}; if checkWith (name, @doIt) { Çcheck every "with" return (true)}; if checkScript (name) { Çcheck this script return (true)}; if file.exists (name) { // maybe it's a filename if sys.os () == "MacOS" { return (Finder.reveal (name))} else { return (webBrowser.openDocument (file.folderFromPath (name)))}}; if name beginsWith "http://" or name beginsWith "www." { // it's a URL if not (name beginsWith "http://") { name = "http://" + name}; if webBrowser.openURL (name) { webBrowser.bringToFront ()}; return (true)}; return (false)} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.cmd2Click ! on cmd2Click (name) { Çcalled when you cmd-double-click on an identifier ÇIt enhances the default, built-in behavior of jumping to the named object. ÇIt checks for the option key, and closes the front window if it's pressed. ÇIf the name is a file rather than a db object, it will reveal it in the Finder ÇChanges Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables Ç4/20/01; 4:05:40 PM by JES ÇAllow callbacks to be addresses or addresses of addresses... ÇTue, Oct 7, 1997 at 11:37:49 AM by PBS ÇNew callbacks for cmd2click. Callback script returns true if it handled the click, then this script immediately returns true. Otherwise, this script handles the click. ÇWed, Dec 11, 1996 at 11:16:00 PM by DW Ç4.2, handles macros in web pages Ç8/15/96 by dmb Ç integrated ssl's "enhanced2click" functionality Ç3/19/96 by ssl Çmoved checkWith etc. to enhanced2click table to simplify distribution Ç6/17/95 by ssl Çadded support for local scripts (via checkScript) Çssl change notes Çenhanced to walk up the script/outline hierarchy and check every "with" path in an outline window, assume it's a oneLiner Çadded support for reserved constants, keywords & builtins Çchanges are Pioneerware by Scott S. Lawton ÇInternet: ss...@pr..., http://www.tiac.net/prefab/ on checkWith (name, callbackAction) { Çwalk up the script/outline hierarchy checking in "with" for a match: "table.[name]" Çcalled by my cmd2click, control2click ÇPioneerware by Scott S. Lawton Çrevisions Ç6/13/96: handle menuscripts Ç5/16/96: now handle an "object database map" Ç3/19/96: moved to enhanced2click table, updated paths Ç1/27/96 to handle double-clicking on part of the hierarchy within a single "with" Ç5/28/95 to handle comment in the "with" Ç5/15/95 to handle hierarchy within a single "with" Çe.g. "with ObjectModel, QXP, defs" Ç(Actually, I only look at pairs. It didn't seem worth the effort to test every combination.) Çpossible improvements Çlook for nested "with" (as I do for outlines & an "object database map"), e.g. Çwith Player Çwith Keys Çlook for all combinations with multiple "fields" (not just pairs), e.g. Çwith QXP, ObjectModel, defs Çlook at every "with" in an outline oneLiner Çcall Simple.window.frontmostType to handle menuscripts Çbut then the enhanced2click package wouldn't stand on its own local { categorizedName = name; theLine; space = " "; windowType = "Unknown"; Ç modified below... windowName = window.frontmost(); whereAmI; displayStatus; leftOfSelection = 0; rightOfSelection = 0}; try { Çthe following fails for a few cases, see Simple.window.frontmostType() ... the only one we need is handled in the else windowType = typeOf(windowName^)} else { Ç 6/13/96 if window.isMenuScript(windowName) { windowType = scriptType}}; on initialize() { displayStatus = op.getDisplay(); Ç want to restore it to original state op.setDisplay(false); Ç no need to show the user our travels case windowType { outlineType; Ç added 5/16/96 ==> changed to a case statement scriptType { whereAmI = op.getCursor()}}; Ç uniqueID, to restore at end if wp.inTextMode() { Ç doesn't apply to cmd2Click, but may to Jump wp.getSelect(@leftOfSelection, @rightOfSelection)}; };Çelse: the left/right of selection are correct at zero on restoreOutline() { case windowType { outlineType; Ç added 5/16/96 ==> changed to a case statement scriptType { op.setCursor(whereAmI)}}; wp.setTextMode(true); wp.setSelect(leftOfSelection, rightOfSelection); op.setDisplay(displayStatus)}; on checkAllFields() { Çglobals ÇtheLine Ç which has the spaces removed Çname ÇwhereAmI local { comma = ","; fieldCount; previous; i}; fieldCount = string.countFields(theLine, comma); for i = 1 to fieldCount { categorizedName = string.nthField(theLine, comma, i) + "." + name; if defined (categorizedName^) { restoreOutline(); callbackAction^(categorizedName, true); Ç second parameter: yes it's in a "with" return (true)}}; for i = 1 to fieldCount { Ç 5/15/95: check pairs next (less likely) previous = string.nthField(theLine, comma, i); for j = i+1 to fieldCount { categorizedName = previous + "." + string.nthField(theLine, comma, j) + "." + name; if defined (categorizedName^) { restoreOutline(); callbackAction^(categorizedName, true); Ç second parameter: yes it's in a "with" return (true)}}}; return false}; Ç won't get here if it finds a match on handleWith() { Ç1/27/96: call twice ==> moved to a subroutine theLine = string.popLeading( string.lower(op.getLineText()), space ); if theLine beginsWith "with " { theLine = string.commentDelete(theLine); Ç 5/28/95 Çget rid of the with, then strip out spaces so they don't interfere with nthField theLine = string.replaceAll( theLine - "with", space, "" ); if checkAllFields() { Çit also performs the callbackAction return true} else { return false}} else { return false}}; on handleOutlineHierarchy() { Ç5/16/96: doesn't actually check "with", but something similar Çit's easier to add here than as a separate script since it calls initialize & restoreOutline categorizedName = string.nthField(string.popLeading(op.getLineText(), space), space, 1) + "." + categorizedName; if defined (categorizedName^) { restoreOutline(); callbackAction^(categorizedName, true); Ç second parameter: yes it's in a "with" return (true)} else { return false}}; case windowType { scriptType { initialize(); if handleWith () { Ç 1/27/96: for cases like "with Player, keys"; 2click on keys return true}; Ç i.e. out of the whole script while op.go (left, 1) { if handleWith () { return true}}; Ç i.e. out of the whole script restoreOutline (); return false}; outlineType { Ç assume it's a oneLiner (5/16/96: also handle an "object database map") initialize(); local { theLine = string.lower(op.getLineText())}; if theLine contains "with " { Ç at present: only looks at the FIRST "with" local { fromPosition = string.patternMatch("with ", theLine) + 5; toPosition = string.patternMatch("{", theLine); numChars = toPosition - fromPosition}; Çget rid of the with, then strip out spaces so they don't interfere with nthField theLine = string.replaceAll(string.mid(theLine, fromPosition, numChars), space, ""); if checkAllFields() { Çit also performs the callbackAction return true}} Ç i.e. out of the whole script else { Ç modified 5/16/96 to walk up the hierarchy Çunlike "with", do NOT check the current line ÇcategorizedName starts out as just name; that's what we want here too while op.go(left, 1) { Ç 5/16/96 if handleOutlineHierarchy() { return true}}; Ç i.e. out of the whole script restoreOutline(); return false}}} else { return false}}; on pathToBracketedPath (s) { ÇSunday, January 25, 1998 at 4:21:03 PM by PBS local (path, flinquotes, flinbrackets, fladd, flend); local (i, ch = "", lastch = "", piece); local (oneElement = "", elementList = {}); for i = 1 to sizeOf (s) { fladd = false; flend = false; lastch = ch; ch = s [i]; case ch { '"' { if lastch == '\\' { fladd = true} else { if !flinquotes { flinquotes = true} else { flinquotes = false}}}; '[' { if !flinquotes { flinbrackets = true}}; ']' { if !flinquotes { flinbrackets = false}}; '.' { if !flinquotes and !flinbrackets { flend = true} else { fladd = true}}} else { fladd = true}; if fladd { oneElement = oneElement + ch}; if flend { elementList = elementList + oneElement; oneElement = ""}}; elementList = elementList + oneElement; for oneElement in elementList { path = path + "[\"" + oneElement + "\"]."}; path = string.mid (path, 1, sizeOf (path) - 1); // strip off trailing dot return (path)}; Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.cmd2click) // old code Çnew (tabletype, @user.callbacks.cmd2click) local (i); local (bracketedName); for i = 1 to sizeof (user.callbacks.cmd2click) { local (adrScript = @user.callbacks.cmd2click [i]); try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; if adrScript^ (name) { return (true)}}}; on checkOtherTables (name, callbackAction) { Çlook in tables that UserTalk references, but aren't global ... to match "table.[name]" Çcalled by my cmd2click, Cmd-Jump & possibly others ÇPioneerware by Scott S. Lawton Çrevisions Ç3/19/96: moved to enhanced2click table, updated paths Ç5/15/95: handle subtables, e.g. "dialog.getFile" (in Simple) should NOT be bracketed local { jumpPaths = { "system.compiler.language.constants", "system.compiler.language.builtins", "system.compiler.language.keywords", "system.misc", "people", "system.verbs", "Simple"}; path; test}; for path in jumpPaths { test = path + "." + name; Ç added 5/15/95 if defined (test^) { callbackAction^ (test); return true}; test = path + "." + "[\"" + name + "\"]"; if defined (test^) { callbackAction^ (test); return true}}; return false}; Ç will only get here if the above fails on checkScript (name) { Çlook in the script itself for a local "handler" Çcalled by my cmd2click, control2click, Cmd-Jump & possibly others ÇPioneerware by Scott S. Lawton Çrevisions Ç3/19/96: moved to enhanced2click table, updated paths Ç6/17/95: created local { windowType = "Unknown"; Ç modified below... whereAmI; displayStatus; leftOfSelection = 0; rightOfSelection = 0}; try { Çthe following fails for a few cases, see Simple.window.frontmostType() ... though it isn't needed here windowType = typeOf (window.frontmost()^)}; on initialize() { displayStatus = op.getDisplay(); Ç want to restore it to original state op.setDisplay (false); Ç no need to show the user our travels if windowType equals scriptType { whereAmI = op.getCursor()}; Ç uniqueID, to restore at end if wp.inTextMode() { Ç doesn't apply to cmd2Click, but may to Jump wp.getSelect(@leftOfSelection, @rightOfSelection)}; };Çelse: the left/right of selection are correct at zero on restoreOutline() { if windowType equals scriptType { op.setCursor(whereAmI)}; wp.setTextMode(true); wp.setSelect(leftOfSelection, rightOfSelection); op.setDisplay(displayStatus)}; if windowType equals scriptType { initialize(); bundle { Ç set the search parameters user.prefs.search.casesensitive = false; user.prefs.search.wholewords = false; user.prefs.search.wraparound = true}; op.firstSummit (); Ç FIND seems to take current heading as its scope if op.find ("on " + name) { Ç look for the "category" text wp.setTextMode (true); op.setDisplay (displayStatus); return true} else { restoreOutline (); return false}} else { return false}}; on doIt (objectName, fromWith = false) { ÇSSL: moved standard behavior here if kb.optionKey () { local (front = window.frontMost ()); edit (address (objectName)); if window.getFile (front) == nil { window.close (front)} else { window.hide (front)}} else { edit (address (objectName))}}; if defined (name^) { Çsimple: just jump to it doIt (name); return (true)}; bracketedName = pathToBracketedPath (name); if defined (bracketedName^) { doIt (bracketedName); return (true)}; if defined (("websites." + name)^) { //it's in the websites table ÇSaturday, January 24, 1998 at 4:03:20 PM by PBS doIt ("websites." + name); return (true)}; if defined (("websites." + bracketedName)^) { //it's in the websites table ÇSaturday, January 24, 1998 at 4:03:20 PM by PBS doIt ("websites." + bracketedName); return (true)}; bundle { Ç4.2 -- make cmd-2clicking work for macros ÇWed, Dec 11, 1996 at 7:30:25 PM by DW try { if defined (websites.["#data"].tools) { if defined (websites.["#data"].tools^.[name]) { edit (@websites.["#data"].tools^.[name]); return (true)}}}; try { if defined (user.html.macros.[name]) { edit (@user.html.macros.[name]); return (true)}}; try { if defined (user.html.renderers.[name]) { edit (@user.html.renderers.[name]); return (true)}}; try { if defined (html.data.standardMacros.[name]) { edit (@html.data.standardMacros.[name]); return (true)}}}; if checkOtherTables (name, @doIt) { Çcheck reserved words return (true)}; if checkWith (name, @doIt) { Çcheck every "with" return (true)}; if checkScript (name) { Çcheck this script return (true)}; if file.exists (name) { // maybe it's a filename if sys.os () == "MacOS" { return (Finder.reveal (name))} else { return (webBrowser.openDocument (file.folderFromPath (name)))}}; if name beginsWith "http://" or name beginsWith "www." { // it's a URL if not (name beginsWith "http://") { name = "http://" + name}; if webBrowser.openURL (name) { webBrowser.bringToFront ()}; return (true)}; return (false)} \ No newline at end of file Index: shutdown =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/shutdown,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** shutdown 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- shutdown 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.shutdown ! ÇCall user's shutdown scripts. ÇChanges: ÇThursday, September 28, 2000 at 6:50:39 PM by JES ÇAllow the callback to be an address or the address of an address... local (i); local (adr = @user.callbacks.shutdown); if not defined (adr^) { new (tabletype, adr)}; for i = 1 to sizeof (adr^) { try { local (adrScript = @adr^ [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ ()}} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.shutdown ! ÇCall user's shutdown scripts. ÇChanges Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables ÇThursday, September 28, 2000 at 6:50:39 PM by JES ÇAllow the callback to be an address or the address of an address... local (i); local (adr = Frontier.createUserCallbacksSubtable (nameOf (this^))); Çbundle // old code Çlocal (adr = @user.callbacks.shutdown) Çif not defined (adr^) Çnew (tabletype, adr) for i = 1 to sizeof (adr^) { try { local (adrScript = @adr^ [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; adrScript^ ()}} \ No newline at end of file Index: control2Click =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/control2Click,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** control2Click 26 Mar 2005 19:41:19 -0000 1.1.1.1 --- control2Click 19 Jun 2005 03:55:46 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.control2Click ! on control2Click (name) { ÇThis script is called when: ÇOn Windows, you alt-2click some text. ÇOn Macintosh, you control-2click some text. ÇCall into user.callbacks.control2Click ÇCallback script returns true if it handles the click. ÇOtherwise, this script handles the click. ÇChanges: ÇThursday, September 28, 2000 at 6:05:24 PM by JES ÇAllow callbacks to be addresses or addresses of addresses... local (i); if not defined (user.callbacks.control2Click) { new (tableType, @user.callbacks.control2Click)}; for i = 1 to sizeOf (user.callbacks.control2Click) { try { local (adrScript = @user.callbacks.control2Click [i]); while typeOf (adrScript^) == addressType { adrScript = adrScript^}; if adrScript^ (n... [truncated message content] |