cft.tcl Description
#!/bin/sh #-*-tcl-*- # the next line restarts using wish \ exec wish "$0" ${1+"$@"}Version:
cft - Configurable File Tool
0.92
Requirements:tcl/Tk 8.0 or above
Description:This tool will allow one to mkdir, browse, view, copy, move, delete, duplicate, rename, and convert-ascii files on Unix or Windows systems. It uses the tcl file command to perform the 'file' actions. The graphic extensions recognized are those supported by the core TK image types (.gif, .xbm, .ppm and .pgm). Book-marked directories can be saved by using the bookmark icon on the menu bar. An [X] icon on the toolbar deletes the current directory entry from the bookmark list(see Help Bookmark). The find boxes next to the Directories and Files labels allow one to quickly find directories or files by typing in some matching letters. The down arrow on the keybord allows one to continue the search if the first item found was not the item requested, and more items in the list box contained matching letters. cft can be customized to incorporate commands simply by adding them using the Configure Options menu (see Help under the Configure Options menu). cft can also be extended to open a file with a particular extension with an application of choice using the ADD - Associated File Types (see Help under the Associated File Types menu).
Navigating:The tool is driven by double-clicking on directories to cd to that directory. A single left-mouse button-click selects a file or directory. A single right-mouse button-click selects a pop-up menu with options. Selecting an option from the pop-up menu completes the operation. Double-clicking on a file opens the file in a browser, or if one of the core image types, a button is created with file's image in it.
History:cft was originally just a collection tcl proc's to help in day-to-day activities. It occurred to me that at the rate I was adding stuff to the utility, the tool would become unmanageable. I decided, for better or worse, to dump all global references into one large array (PREFS) and concentrate on a simple way of saving user-defined commands. This enabled the tool to become a little more manageable. Since I spend most of my time on Unix systems, I left in chmod, tarit, gzip, and unpackit. I also left in some handy RCS source code control commands that I use every-day.
Platforms Tested: cft has been tested on Solaris, IRIX, Linux, NT, and Windows. With some slight modifications to areas that test for tcl_platform, it could be used on Mac's and other untested platforms. Known Bugs:
Future Work:
List of Functions
Associated Comment
Example configuration file for windows.
Associated Comment
Sample configuration file cft running on Unix (Solaris).
Associated Comment
Procedure: getUnixHost Gets the current hostname if on a unix platform
Associated Comment
Help info for setting development project variables.
Associated Comment
Procedure: updateProjectData Updates project informataion once the developer has completed the set project dialog
Associated Comment
Procedure: setproject This dialog allows the developer to create, update or simply set the current development project. @see updateProjectData for parameter details.
Associated Comment
Set environment variable Name: with the contents of Value: and exits from the Environment set-up menu.
Associated Comment
Exits from the Environment set-up menu.
Associated Comment
Help info for setting environment variables.
Associated Comment
The Environment Variable Editing menu allows one to customize environment variables, while running cft. Common types of environment variables changes might be CLASSPATH, RCSROOT, and others. To create a new environment variable use the "NEW" button to blank-out the Name and Value entries. To temporarily set the environment variable, use the "OK" button. The "Override" button permanently saves an environment variable entry. The "Re-Set" button removes an "overriden" entry.
@see helpEnv
Associated Comment
Convert Text File to native. (i.e. UNIX <-> Dos...If on a Unix system, remove Crtl-M from Dos files, if on Windows, add Crtl-M.
Associated Comment
A color configuration menu that provides color control of certain widgets, or their components.
Associated Comment
Updates, and saves color selection from color configuration menu.
Associated Comment
Selects an RGB (8-bit) color using three slider bars for the selection red, blue, and green.
Associated Comment
Runs any custom command. (except for those containing + )
= 0, Run a file-associated command.
Associated Comment
Save file selections from listboxes, into global SEL_FILES
Associated Comment
Parse and run command from either options, or file associations menu; Replace #_FILE_# with the currently selected file and $_UIP_# with the user input dialog entry. Replace other special "keywords" with their associated values (#_PWD_#, and #_FROOT_#)
= 0, Run a file-associated command.
Associated Comment
A pop-up file selection menu that is activated when trying to locate a new command
Associated Comment
A pop-up menu that is activated using the right-mouse-button. New "customized" buttons can be added by using the Configure Options menu and using the "ADD" button.
@see "Configure Options Help"Associated Comment
Due to differing screen resolutions, available fonts, etc., a test "options" pop-up menu is activated at start-up to determine the width of the options menu. The Height of a row is stored in global PREFS(OPT_H) and the width is stored in PREFS(OPT_W)
Associated Comment
Adds a new blank entry to the options menu. The Name and Settings field must be completed to save the entry.
Associated Comment
Removes an entry from the options menu.
Associated Comment
Saves options after an add, delete or "OK" button was pressed.
Associated Comment
Help information for the options menu.
Associated Comment
Menu that allows one to associate a file with some action.
@see "Configure Options Help"Associated Comment
Deletes entries from the "File Types" association menu.
Associated Comment
Saves file type associations after an add, delete or "OK button
Associated Comment
Adds a new blank entry to the file types menu. The Extension and Open With field must be completed to save the entry.
Associated Comment
Help info for the file type association menu.
Associated Comment
Associated Comment
Adds your current working directory as a bookmark entry.
Associated Comment
"OK" - deletes selected items from the selection list
Associated Comment
Builds a listbox with bookmarked items to be deleted
Associated Comment
Removes bookmarked directory entries.
Associated Comment
Go-to a directory from a "bookmark". If directory does not exist, remove it from "bookmark"
Associated Comment
Get the user login id (unix-only) @reutrn users login id.
Associated Comment
Write state information to .cft.cfg
Associated Comment
Read-in global parameters from the configuration file.
Associated Comment
Procedure to tag/un-tag RCS files with symbolic name.
0 = Remove RCS tag from file.
Associated Comment
Attempt to find the end-part of the path. Assuming that you are in the 'rcsroot' or in your 'development' directory otherwise, return [localPWD].
Associated Comment
Check the RCS file for the associated symbolic name (RCS_BASE_VER)
Associated Comment
Tag RCS file with symbolic name (RCS_BASE_VER)
Associated Comment
Get state version from 'pwd' .rcsState.
Associated Comment
Switch from RCS directory to current working directory and back.
Associated Comment
If PREFS(BUILD_DIR) exists, then switch to that directory...
Associated Comment
If PREFS(LAST_COMMAND) exists, then clear that command...
Associated Comment
If PREFS(LAST_COMMAND) exists, then re-run that command...
Associated Comment
Loads info about RCS file activity, for current working directory.
Associated Comment
Saves info about RCS file activity, for the current working directory. It is applied for each RCS check-out, check-in session.
Associated Comment
Check current environment array for "name"
0 = not found.
Associated Comment
Given a command name, search through the $path environment variable for its location.
Associated Comment
HelpAbout pop-up menu.
Associated Comment
Help about bookmarks.
Associated Comment
Unpacks .zip, .Z, .gz (on unix-only)
Associated Comment
Up button; 64-bit encoded gif file. 22dirup.gif
Associated Comment
Remove "bookmark"; 64-bit encoded gif file. 22del.gif
Associated Comment
Down button; 64-bit encoded gif file. 22bookmark.gif
Associated Comment
Right button; 64-bit encoded gif file. 22rgtb2.gif
Associated Comment
hiloaz: File sort a-z, hi->lo; 64-bit encoded gif file. 22z-a.gif
Associated Comment
Date sort hi->low; 64-bit encoded gif file. 22datelh.gif
Associated Comment
File size sort, hi->lo; 64-bit encoded gif file. 229-1.gif
Associated Comment
File sort a-z, lo->hi; 64-bit encoded gif file. 22a-z.gif
Associated Comment
Date sort lo->hi; 64-bit encoded gif file. 22datehl.gif
Associated Comment
File size lo->hi; 64-bit encoded gif file. 221-9.gif
Associated Comment
Refresh; 64-bit encoded gif file. 22refresh.gif
Associated Comment
home; 64-bit encoded gif file. 22home.gif
Associated Comment
dev; 64-bit encoded gif file. 22dev.gif
Associated Comment
mirror; 64-bit encoded gif file. 22lmirror.gif
Associated Comment
build; 64-bit encoded gif file. 22build.gif
Associated Comment
build; 64-bit encoded gif file. 22bolt1.gif : This is displayed when there are no last commands available. Last commands will remain available untill the user 'cancels' or relpaces the last command with a new command.
Associated Comment
build; 64-bit encoded gif file. 22bolt2.gif : This is displayed when there is a last command available. Last commands will remain available untill the user 'cancels' or relpaces the last command with a new command.
Associated Comment
build; 64-bit encoded gif file. 22selectall.gif : This is displayed when there are no last commands available. Last commands will remain available untill the user 'cancels' or relpaces the last command with a new command.
Associated Comment
cut; 64-bit encoded gif file. 22cut.gif
Associated Comment
copy; 64-bit encoded gif file. 22copy.gif
Associated Comment
paste; 64-bit encoded gif file. 22paste.gif
Associated Comment
rename; 64-bit encoded gif file. 22rename.gif
Associated Comment
mkdir; 64-bit encoded gif file. 22mkdir.gif
Associated Comment
convert; 64-bit encoded gif file. 22convert.gif
Associated Comment
help; 64-bit encoded gif file. 22question.gif
Associated Comment
help; 64-bit encoded gif file. 22config.gif
Associated Comment
delete; 64-bit encoded gif file. 22remove.gif
Associated Comment
duplicate; 64-bit encoded gif file. 22dup1.gif
Associated Comment
browse; 64-bit encoded gif file. 22browse.gif
Associated Comment
search; 64-bit encoded gif file. 22lfind.gif
Associated Comment
next; 64-bit encoded gif file. 22next.gif
Associated Comment
prev; 64-bit encoded gif file. 22prev.gif
Associated Comment
Tars-up a list files (unix-only)
Associated Comment
Tar and compress files (unix-only)
If a single file is selected, then the .Z or .gz file takes on the name of the file selected.
If multiple files are selected, then "doIt type" is called to get the name of the .Z or .gz file and tarit is called a second time "count = 1" to indecate that a PREFS(TAR_FILE_NAME) has been entered.
Multiple file flow:Associated Comment
Pop-up menu with buttons generated from user-defined options.
Associated Comment
Being a separate proc, this allows one to reset HOME env, while cft is running.
Associated Comment
Process file selection...
Associated Comment
Get cursor's x y position as it it is moving for listbox selection.
Associated Comment
Get marked cursor's x y position for listbox selection.
Associated Comment
Clear selections, and set selection to nearest y listbox location.
Associated Comment
Clear selections, and set all associaed file widgets to the given index.
Associated Comment
Set selections to nearest y listbox location.
Associated Comment
cfg Main widget that displays files and directories. Window manager configurations
Associated Comment
Function to get available disk-space. NOTE: Currently a stubb function.
Associated Comment
Procedure to set brwose widget to line-number
Associated Comment
Find an item in a text widget.
Associated Comment
Find next or previous search item.
Associated Comment
This procedure attempts to compute the current line-number while scrolling
Associated Comment
Help browse file.
Associated Comment
Saves changes made to a file opened for browse
Associated Comment
Displays either a file or global PREFS(DATA).
Associated Comment
Displays the output from the df program (unix-only)
Associated Comment
Compare "a" with "b" and return a 0 or 1.
Associated Comment
Compare "a" with "b" and return a 0 or 1.
Associated Comment
Re-set image count and destroy image widget.
Associated Comment
Display thumb-nailed sized images on a scrolling canvas widget.
Associated Comment
Make thumb-nail images and put them on a scrolling canvas widget.
Associated Comment
Hilite all instances of "Search for"" in a text widget.
Associated Comment
Hilite all instances of "Search for"" in the selected file.
Associated Comment
Return a file date in a displayable format
Associated Comment
Change directory to the level above.
Associated Comment
Return (lower-case) file extension.
Associated Comment
General purpose message pop-up dialog.
Associated Comment
scrolls multiple list-boxes.
Associated Comment
Update list-boxes with current directory info.
Associated Comment
Update list-boxes with current file info. global PREFS
Associated Comment
Procedure rcs-diff using tkdiff.
Associated Comment
Checkout(unlocked) a temporary copy of the RCS ,v files to be browsed.
Associated Comment
View the output from the RCS rlog command.
Associated Comment
Cycle through all selected files and perform "tkdiff" on each against the RCS repository.
Associated Comment
Get an unlocked copy (latest version) of a file in the RCS repository.
Associated Comment
Unlock the latest copy checked-out
Associated Comment
Get user's check-in message and issue the check-in commad if "OK" is selected.
Associated Comment
Create new RCS managed file(s)
Associated Comment
Check-in RCS managed files.
Associated Comment
Lock RCS managed files without getting a copy from the repository.
Associated Comment
Check-out RCS managed files
Associated Comment
Clear out message area
Associated Comment
Set a message
Associated Comment
Set an error message
Associated Comment
Procedure to display differences between two text files.
Associated Comment
Remove files and directories
Associated Comment
Pop-up dialog to get arguments for chmod, and mkdir, RCSROOT, etc.
Associated Comment
Parse the output from the doit_test pop-up dialog, combine static user defined commands and call runCmd.
= 0, Run a file-associated command.
Associated Comment
This pop-up dialog appears when User Input Parameters #_UIP_# is in the command string PREFS(_X).
= 0, Run a file-associated command.
Associated Comment
(unix-only) runs xwd command.
Associated Comment
(unix-only) Pop-up dialog to get the name of the xwd file, waits 5 seconds and runs getScreenShot.
Associated Comment
Pop-up dialog to get new file name for file rename. It also checks to prevent rename - that will delete an existing file.
Associated Comment
Procedure to rename a file.
Associated Comment
(unix-only) procedure to change file permissions.
Associated Comment
Uses the tcl file command to make a new directory.
Associated Comment
Sets RCS_BASE_VER variable and saves current state.
Associated Comment
Sets DEVELOPMENT_DIR variable and saves current state.
Associated Comment
Sets BUILD_DIR variable and saves current state.
Associated Comment
Sets Browse Size Limit
Associated Comment
Sets Browse Size Limit
Associated Comment
Sets RCSROOT variable and saves current state.
Associated Comment
Saves items selected from the listbox for a later "paste" operation.
Associated Comment
"move" or "copy" files saved in the copy or cut sequence. Uses the tcl file command to "copy" or "rename".
Associated Comment
Set file sort method.
dn = file date min-> max.
fm = file name max-> min.
fn = file name min-> max.
sm = file size max-> min.
sn = file size min-> max.
Associated Comment
Calculate a toplevel's window's relative position to its parent or some other window.
e.g. Place new toplevel .foo on top of the main window '.' offset 30 pixels in x and y. . .foo 30 30
Associated Comment
Create a button and display an image on it.
Associated Comment
Make thumbnail images out of the originals.