diff --git a/twander.py b/twander.py index e3dd0e8..d7f59fc 100755 --- a/twander.py +++ b/twander.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 3.196 2006/12/11 09:21:19 tundra Exp $" +RCSID = "$Id: twander.py,v 3.197 2006/12/14 06:26:01 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -148,6 +148,21 @@ KDIRSC11 = '' KDIRSC12 = '' +# Set Directory Shortcuts + +KSETSC1 = '' +KSETSC2 = '' +KSETSC3 = '' +KSETSC4 = '' +KSETSC5 = '' +KSETSC6 = '' +KSETSC7 = '' +KSETSC8 = '' +KSETSC9 = '' +KSETSC10 = '' +KSETSC11 = '' +KSETSC12 = '' + # Program Memories MEMCLR1 = '' @@ -1228,6 +1243,18 @@ "KDIRSC10":KDIRSC10, "KDIRSC11":KDIRSC11, "KDIRSC12":KDIRSC12, + "KSETSC1":KSETSC1, + "KSETSC2":KSETSC2, + "KSETSC3":KSETSC3, + "KSETSC4":KSETSC4, + "KSETSC5":KSETSC5, + "KSETSC6":KSETSC6, + "KSETSC7":KSETSC7, + "KSETSC8":KSETSC8, + "KSETSC9":KSETSC9, + "KSETSC10":KSETSC10, + "KSETSC11":KSETSC11, + "KSETSC12":KSETSC12, "MEMCLR1":MEMCLR1, "MEMCLR2":MEMCLR2, "MEMCLR3":MEMCLR3, @@ -2294,6 +2321,24 @@ self.DirList.bind(self.KeyBindings["KDIRSC10"], lambda event :DirSCKeyPress(event, 10)) self.DirList.bind(self.KeyBindings["KDIRSC11"], lambda event :DirSCKeyPress(event, 11)) self.DirList.bind(self.KeyBindings["KDIRSC12"], lambda event :DirSCKeyPress(event, 12)) + + + ### + # Set Directory Shortcut Keys - All Bound To A Common Handler + ### + + self.DirList.bind(self.KeyBindings["KSETSC1"], lambda event :DirSCSet(event, 1)) + self.DirList.bind(self.KeyBindings["KSETSC2"], lambda event :DirSCSet(event, 2)) + self.DirList.bind(self.KeyBindings["KSETSC3"], lambda event :DirSCSet(event, 3)) + self.DirList.bind(self.KeyBindings["KSETSC4"], lambda event :DirSCSet(event, 4)) + self.DirList.bind(self.KeyBindings["KSETSC5"], lambda event :DirSCSet(event, 5)) + self.DirList.bind(self.KeyBindings["KSETSC6"], lambda event :DirSCSet(event, 6)) + self.DirList.bind(self.KeyBindings["KSETSC7"], lambda event :DirSCSet(event, 7)) + self.DirList.bind(self.KeyBindings["KSETSC8"], lambda event :DirSCSet(event, 8)) + self.DirList.bind(self.KeyBindings["KSETSC9"], lambda event :DirSCSet(event, 9)) + self.DirList.bind(self.KeyBindings["KSETSC10"], lambda event :DirSCSet(event, 10)) + self.DirList.bind(self.KeyBindings["KSETSC11"], lambda event :DirSCSet(event, 11)) + self.DirList.bind(self.KeyBindings["KSETSC12"], lambda event :DirSCSet(event, 12)) ### @@ -2700,6 +2745,7 @@ event.state &= ~DontCareMask # Kill the bits we don't care about # Check for, and handle accelerator keys + if event.state == AltMask: # Set menu button associated with accelerator @@ -3552,7 +3598,7 @@ ##### -# Event Handler: Handler Function Keys +# Event Handler: Process Directory Shortcut Request ##### def DirSCKeyPress(event, index): @@ -3571,6 +3617,26 @@ # End of 'DirSCKeyPress()' +##### +# Event Handler: Set Desired Directory Shortcut Key To Current Directory +##### + +def DirSCSet(event, index): + + # Set the indicated shortcut key to the current directory + # And update the menus to reflect this fact + + UI.DirSCKeys[index-1] = UI.CurrentDir + LoadShortcutMenu() + + # Inhibit further processing of key - some Function Keys + # have default behavior in Tk which we want to suppress. + + return "break" + +# End of 'DirSCSet()' + + #-------------------- Memory Features --------------------# #####