|
From: creedon <icr...@us...> - 2006-02-18 18:41:26
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/tools/windowTypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16676 Modified Files: runOpenRecentMenuScript Log Message: use factored init code Index: runOpenRecentMenuScript =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/tools/windowTypes/runOpenRecentMenuScript,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** runOpenRecentMenuScript 9 Feb 2006 03:12:57 -0000 1.3 --- runOpenRecentMenuScript 18 Feb 2006 18:41:22 -0000 1.4 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.verbs.builtins.Frontier.tools.windowTypes.runOpenRecentMenuScript ! on runOpenRecentMenuScript (ix) { ÇChanges Ç2/8/06; 5:18:31 PM by TAC Çadded some initialization Ç11/1/05; 8:51:49 AM by TAC Çadded check for missing files and way deal with them Ç9/24/05; 8:45:56 PM by TAC Çcreated bundle { // init if not (defined (user.prefs.openRecentMenu)) { new (tableType, @user.prefs.openRecentMenu)}; if not (defined (user.prefs.openRecentMenu.items)) { new (tableType, @user.prefs.openRecentMenu.items)}; if not (defined (user.prefs.openRecentMenu.maxNumberOfItems)) { user.prefs.openRecentMenu.maxNumberOfItems = 20}}; local (count = sizeOf (user.prefs.openRecentMenu.items)); ix = number (ix); if ix > count { // clear menu table.emptyTable (@user.prefs.openRecentMenu.items)} else { local (f); ix = count + 1 - ix; // translate from position in menu to position in items table f = user.prefs.openRecentMenu.items [ix]; if not (file.exists (f)) { local (s = file.fileFromPath (f)); case dialog.threeWay ("File \"" + s + "\" is missing.", "Find", "Clear", "Cancel") { 1 { if file.getFileDialog ("Find file \"" + s + "\"...", @f, 0) { user.prefs.openRecentMenu.items [ix] = f} else { return (false)}}; 2 { delete (user.prefs.openRecentMenu.items [ix]); return (false)}; 3 { return (false)}}}; Frontier.tools.windowTypes.commands.open (f)}; return (true)}; Çbundle // testing ÇrunOpenRecentMenuScript ("1") \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.verbs.builtins.Frontier.tools.windowTypes.runOpenRecentMenuScript ! on runOpenRecentMenuScript (ix) { ÇChanges Ç2/16/06; 8:14:40 PM by TAC Çuse factored init code Ç2/8/06; 5:18:31 PM by TAC Çadded some initialization Ç11/1/05; 8:51:49 AM by TAC Çadded check for missing files and way deal with them Ç9/24/05; 8:45:56 PM by TAC Çcreated Frontier.openRecentMenu.init (); local (count = sizeOf (user.prefs.openRecentMenu.items)); ix = number (ix); if ix > count { // clear menu table.emptyTable (@user.prefs.openRecentMenu.items)} else { local (f); ix = count + 1 - ix; // translate from position in menu to position in items table f = user.prefs.openRecentMenu.items [ix]; if not (file.exists (f)) { local (s = file.fileFromPath (f)); case dialog.threeWay ("File \"" + s + "\" is missing.", "Find", "Clear", "Cancel") { 1 { if file.getFileDialog ("Find file \"" + s + "\"...", @f, 0) { user.prefs.openRecentMenu.items [ix] = f} else { return (false)}}; 2 { delete (user.prefs.openRecentMenu.items [ix]); return (false)}; 3 { return (false)}}}; Frontier.tools.windowTypes.commands.open (f)}; return (true)}; Çbundle // testing ÇrunOpenRecentMenuScript ("1") \ No newline at end of file |