diff --git a/twander.py b/twander.py index 92607f0..9d60527 100755 --- a/twander.py +++ b/twander.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 2.68 2003/01/18 02:38:22 tundra Exp $" +RCSID = "$Id: twander.py,v 2.69 2003/01/18 19:13:35 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -14,8 +14,8 @@ DATE = "2002-2003" CPRT = chr(169) OWNER = "TundraWare Inc." -RIGHTS = "All Rights Reserved" -COPYRIGHT = "Copyright %s %s %s %s. " % (CPRT, DATE, OWNER, RIGHTS) +RIGHTS = "All Rights Reserved." +COPYRIGHT = "Copyright %s %s %s %s" % (CPRT, DATE, OWNER, RIGHTS) #----------------------------------------------------------# @@ -141,21 +141,47 @@ WIDTH = 90 ##### -# Colors +# Default Colors ##### +# Main Display Colors + BCOLOR = "black" FCOLOR = "green" +# Menu Colors + +MBARCOL = "beige" +MBCOLOR = "beige" +MFCOLOR = "black" + +# Help Screen Colors + +HBCOLOR = "lightgreen" +HFCOLOR = "black" ##### -# Fonts +# Default Display Fonts ##### +# Main Display Font + FNAME = "Courier" FSZ = 12 FWT = "bold" +# Menu Font + +MFNAME = "Courier" +MFSZ = 12 +MFWT = "bold" + +# Help Screen Font + +HFNAME = "Courier" +HFSZ = 10 +HFWT = "italic" + #------------------- Nothing Below Here Should Need Changing ------------------# @@ -337,6 +363,7 @@ hCOMMANDS = 'Command Definitions' hKEYS = 'Keyboard Assignments' hDIRSC = 'Directory Shortcuts' +hNONE = 'No %s Found.' hUSERVBLS = 'User-Defined Variables' hVBLSOPTS = 'Internal Variables & Options' @@ -899,11 +926,11 @@ # Setup the cascading submenus - self.UserVbls = Menu(self.HelpBtn.menu, font=(FNAME, FSZ, "bold")) - self.CmdDefs = Menu(self.HelpBtn.menu, font=(FNAME, FSZ, "bold")) - self.VblsOpts = Menu(self.HelpBtn.menu, font=(FNAME, FSZ, "bold")) - self.Keys = Menu(self.HelpBtn.menu, font=(FNAME, FSZ, "bold")) - self.DirSCs = Menu(self.HelpBtn.menu, font=(FNAME, FSZ, "bold")) + self.UserVbls = Menu(self.HelpBtn.menu, foreground=MFCOLOR, background=MBCOLOR, font=(MFNAME, MFSZ, MFWT)) + self.CmdDefs = Menu(self.HelpBtn.menu, foreground=MFCOLOR, background=MBCOLOR, font=(MFNAME, MFSZ, MFWT)) + self.VblsOpts = Menu(self.HelpBtn.menu, foreground=MFCOLOR, background=MBCOLOR, font=(MFNAME, MFSZ, MFWT)) + self.Keys = Menu(self.HelpBtn.menu, foreground=MFCOLOR, background=MBCOLOR,font=(MFNAME, MFSZ, MFWT)) + self.DirSCs = Menu(self.HelpBtn.menu, foreground=MFCOLOR, background=MBCOLOR, font=(MFNAME, MFSZ, MFWT)) # Setup the Directory Listing and Scrollbars @@ -2450,8 +2477,11 @@ # Any user-set options have now been read, set the GUI for i in (UI.CmdBtn, UI.DirBtn, UI.HistBtn, UI.HelpBtn): - i.config(font=(FNAME, FSZ, "bold")) - i.menu.config(font=("courier", FSZ, "bold")) + i.config(foreground=MFCOLOR, background=MBCOLOR, font=(MFNAME, MFSZ, MFWT)) + i.menu.config(foreground=MFCOLOR, background=MBCOLOR, font=(MFNAME, MFSZ, MFWT)) + + # Set Menu Bar background to match buttons + UI.mBar.config(background=MBARCOL) UI.DirList.config(font=(FNAME, FSZ, FWT), foreground=FCOLOR, background=BCOLOR, @@ -2480,12 +2510,21 @@ (hVBLSOPTS, UI.VblsOpts, GetIntVars() + GetOptions()), (hKEYS, UI.Keys, GetKeyBindings()), (hDIRSC, UI.DirSCs, GetDirShortcuts())): - mvbl.delete(0,END) - for l in mlist: - mvbl.add_command(label=l, command=None) + mvbl.delete(0,END) + + # Indicated if there is nothing to display for this class of help + if not mlist: + mvbl.add_command(label=hNONE % mname, command=None, foreground=HFCOLOR, background=HBCOLOR, + font=(HFNAME, HFSZ, HFWT)) + + # Load the help class with relevant information + else: + for l in mlist: + mvbl.add_command(label=l, command=None, foreground=HFCOLOR, background=HBCOLOR, font=(HFNAME, HFSZ, HFWT)) + UI.HelpBtn.menu.add_cascade(label=mname, menu=mvbl) - + # Setup the About item UI.HelpBtn.menu.add_command(label=hABOUT, command=lambda title=hABOUT, @@ -2653,7 +2692,9 @@ debuginfo = [] for x in range(len(UI.FuncKeys)): key = "F" + str(x+1) - debuginfo.append(key + " " * (10-len(key)) + UI.FuncKeys[x]) + path = UI.FuncKeys[x] + if path: + debuginfo.append(key + " " * (10-len(key)) + path) return debuginfo @@ -2759,8 +2800,10 @@ UI.OptionsNumeric = {"DEBUGLEVEL":DEBUGLEVEL, "FSZ":FSZ, "HEIGHT":HEIGHT, "MAXDIR":MAXDIR, "MAXHIST":MAXHIST, "MAXNESTING":MAXNESTING, "REFRESHINT":REFRESHINT, "WIDTH":WIDTH} -UI.OptionsString = {"BCOLOR":BCOLOR, "FCOLOR":FCOLOR, "FNAME":FNAME, "FWT":FWT, "QUOTECHAR":QUOTECHAR, - "STARTDIR":STARTDIR} +UI.OptionsString = {"BCOLOR":BCOLOR, "FCOLOR":FCOLOR, "FNAME":FNAME, "FSZ":HFSZ, "FWT":FWT, # Main Font/Colors + "MBCOLOR":MBCOLOR, "MFCOLOR":MFCOLOR, "MFNAME":MFNAME, "MFSZ":MFSZ, "MFWT":MFWT, # Menu Font/Colors + "HBCOLOR":HBCOLOR, "HFCOLOR":HFCOLOR, "HFNAME":HFNAME, "HFSZ":HFSZ, "HFWT":HFWT, # Help Font/Colors + "MBARCOL":MBARCOL, "QUOTECHAR":QUOTECHAR, "STARTDIR":STARTDIR} # Other # Prepare storage for key bindings UI.KeyBindings = {}