diff --git a/twander.py b/twander.py index c9eb18b..797b118 100755 --- a/twander.py +++ b/twander.py @@ -4,7 +4,7 @@ PROGNAME = "twander" -RCSID = "$Id: twander.py,v 1.84 2002/11/26 19:28:15 tundra Exp $" +RCSID = "$Id: twander.py,v 1.85 2002/11/26 21:01:04 tundra Exp $" VERSION = RCSID.split()[2] @@ -64,17 +64,26 @@ DIRHOME = '' # Goto $HOME DIRBACK = '' # Goto previous directory DIRSTART = '' # Goto starting directory -DIRUP = '' # Go up one directory level +DIRUP = '' # Go up one directory level +MSEBACK = '' # Go back one directory with mouse +MSEUP = '' # Go up one directory with mouse # Selection Keys +SELALL = '' # Select all items SELNEXT = '' # Select next item +SELNONE = '' # Unselect all items SELPREV = '' # Select previous item SELEND = '' # Select bottom item SELTOP = '' # Select top item SELKEY = '' # Select item w/keyboard SELMOUSE = '' # Select item w/mouse +# Intra-Display Movement + +PGDN = '' # Move page down +PGUP = '' # Move page up + ##### # Default Directories & Files @@ -250,7 +259,7 @@ " -h print this help information", " -n name name of font to use (default: courier)", " -q quiet mode - no warnings (default: warnings on)", - " -r turn off automatic refreshing of the directory display (default: on)", + " -r turn off automatic content refreshing (default: refresh on)", " -s size size of font to use (default: 12)", " -v print detailed version information", " -w wght weight/style of font to use (default: bold)", @@ -485,12 +494,24 @@ # Bind handler for "Up Dir" self.DirList.bind(DIRUP, KeyUpDir) + # Bind handler for "Mouse Back Dir" + self.DirList.bind(MSEBACK, KeyBackDir) + + # Bind handler for "Mouse Up Dir" + self.DirList.bind(MSEUP, KeyUpDir) + # Selection Keys + # Bind handler for "Select All" + self.DirList.bind(SELALL, KeySelAll) + # Bind handler for "Next Item" self.DirList.bind(SELNEXT, KeySelNext) + # Bind handler for "Select No Items" + self.DirList.bind(SELNONE, KeySelNone) + # Bind handler for "Previous Item" self.DirList.bind(SELPREV, KeySelPrev) @@ -506,6 +527,16 @@ # Bind handler for "Mouse Select" self.DirList.bind(SELMOUSE, DirListHandler) + + # Intra-display movement + + # Bind Handler for "Move Page Down + self.DirList.bind(PGDN, KeyPageDown) + + # Bind Handler for "Move Page Up" + self.DirList.bind(PGUP, KeyPageUp) + + # Give the listbox focus so it gets keystrokes self.DirList.focus() @@ -754,6 +785,16 @@ ##### +# Event Handler: Select All Items +##### + +def KeySelAll(event): + UI.DirList.selection_set(0, END) + +# End of 'KeySelAll()' + + +##### # Event Handler: Select Next Item ##### @@ -765,6 +806,16 @@ ##### +# Event Handler: Select No Items +##### + +def KeySelNone(event): + UI.DirList.selection_clear(0, END) + +# End of 'KeySelNone()' + + +##### # Event Handler: Select Previous Item ##### @@ -1111,6 +1162,30 @@ ##### +# Event Handler: Move Down A Page +##### + +def KeyPageDown(event): + UI.DirList.yview_scroll(1, "pages") + +# End of 'KeyPageDown()' + + +##### +# Event Handler: Move Up A Page +##### + +def KeyPageUp(event): + UI.DirList.yview_scroll(-1, "pages") + + +# End of 'KeyPageUp()' + + +#-------------- Handler Utility Functions -----------------# + + +##### # Refresh contents of directory listing to stay in sync with reality #####