diff --git a/twander.py b/twander.py index e716a41..b862fc7 100755 --- a/twander.py +++ b/twander.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 3.149 2005/01/07 10:30:20 tundra Exp $" +RCSID = "$Id: twander.py,v 3.150 2005/01/07 11:09:54 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -84,6 +84,9 @@ FONTINCR = '' # Increase Font Size MOUSECTX = '' # Pop-up Command Menu MOUSEDIR = '' # Pop-up Directory Menu +MOUSEHIST = '' # Pop-up History Menu +MOUSEWILD = '' # Pop-up Wildcard Menu +MOUSESC = '' # Pop-up Shortcut Menu KEYPRESS = '' # Any keypress (for commands) QUITPROG = '' # Quit the program READCONF = '' # Re-read the configuration file @@ -455,7 +458,7 @@ # Name The Key/Mouse Assignments Which We Do Not Allow To Be Rebound In The Config File -NOREBIND = ["MOUSECTX", "MOUSEDIR", "MOUSEBACK", "MOUSEUP", "MOUSESEL"] +NOREBIND = ["MOUSECTX", "MOUSEDIR", "MOUSEHIST", "MOUSEWILD", "MOUSESC", "MOUSEBACK","MOUSEUP", "MOUSESEL"] ##### @@ -941,6 +944,9 @@ "FONTINCR":FONTINCR, "MOUSECTX":MOUSECTX, "MOUSEDIR":MOUSEDIR, + "MOUSEHIST":MOUSEHIST, + "MOUSEWILD":MOUSEWILD, + "MOUSESC":MOUSESC, "KEYPRESS":KEYPRESS, "QUITPROG":QUITPROG, "READCONF":READCONF, @@ -1633,6 +1639,11 @@ UI.ShortBtn.menu.add_command(label="Startdir", command=lambda: KeyStartDir(None)) UI.ShortBtn.menu.add_command(label="Root", command=lambda: KeyRootDir(None)) + # If were on Win32 and have the extensions loaded also offer the drive list + + if OSNAME == 'nt' and GetWin32Drives(): + UI.ShortBtn.menu.add_command(label="DriveList", command=lambda: KeyDriveList(None)) + # Add Shortcut Key Definitions idx=1 @@ -1765,7 +1776,7 @@ # Setup the Shortcut Menu - self.ShortBtn = Menubutton(self.mBar, text=SCMENU, underline=0, state=DISABLED) + self.ShortBtn = Menubutton(self.mBar, text=SCMENU, underline=6, state=DISABLED) self.ShortBtn.menu = Menu(self.ShortBtn) self.ShortBtn.pack(side=LEFT, padx=MENUPADX) @@ -1839,6 +1850,15 @@ # Bind handler to invoke Directory Menu self.DirList.bind(self.KeyBindings["MOUSEDIR"], MouseClick) + # Bind handler to invoke Directory Menu + self.DirList.bind(self.KeyBindings["MOUSEHIST"], MouseClick) + + # Bind handler to invoke Directory Menu + self.DirList.bind(self.KeyBindings["MOUSEWILD"], MouseClick) + + # Bind handler to invoke Directory Menu + self.DirList.bind(self.KeyBindings["MOUSESC"], MouseClick) + # Bind handler for individual keystrokes self.DirList.bind(self.KeyBindings["KEYPRESS"], KeystrokeHandler) @@ -2231,6 +2251,10 @@ x, y = UI.DirList.winfo_pointerxy() # Position near mouse PopupMenu(UI.DirBtn.menu, x, y) # Display Directory Menu + elif event.state == (Button3Mask | AltMask): # Alt-Button-3 + x, y = UI.DirList.winfo_pointerxy() # Position near mouse + PopupMenu(UI.ShortBtn.menu, x, y) # Display Shortcut Menu + # End Of 'MouseClick()' @@ -2242,7 +2266,7 @@ event.state &= ~DontCareMask # Kill the bits we don't care about - if event.state == Button1Mask: # Double-Button-2 / No Modifier + if event.state == Button1Mask: # Double-Button-1 / No Modifier DirListHandler(event) # Execute selected item elif event.state == (Button1Mask | ControlMask): # Control-DblButton-1 @@ -2345,6 +2369,10 @@ elif event.char == 'h': button = UI.HistBtn + # Shortcut Menu + elif event.char == 'u': + button = UI.ShortBtn + # Sort Menu elif event.char == 's': button = UI.SortBtn @@ -2461,6 +2489,7 @@ if USEWIN32ALL and (UI.CurrentDir != SHOWDRIVES): WIN32ALLON = not WIN32ALLON RefreshDirList(event) + LoadShortcutMenu() # Decides whether or not to show drive list return 'break'