Enhancements for tkeclipse

From: Edmunds Family <edmunds_at_pacifier.com>
Date: Wed 08 Dec 1999 10:08:43 AM GMT
Message-ID: <000f01bf4164$53aac9e0$5e8941d8@edmunds>
Enhancements for tkeclipse
Author: Doug Edmunds <edmunds@pacifier.com>
Date:  8 December 1999

I have worked up some changes to make tkeclipse v 4.2.1
more user-friendly.  These enhancements are especially
helpful if you are editing, testing, editing, testing...
the same file.

Changes:

1. Adds a Reload button (automatically recompile
   the last file loaded during the session).
2. Bring up the Compile File popup by
   right-clicking the Query Entry label area.
3. Displays the name of the last file you have loaded.

These changes have been tested on Windows 95/98.
If you appreciate these enhancements (or can't get
them to work), email me. If you like them, ask
IC-Parc to include them in the next official version.

----Detailed instructions:-----
Read the instructions all the way to the end first.
Use your text editor's Search to find the spot where
code changes go.  You will avoid typo's if you
copy/paste the changes.

Suggestion: Put an extra line starting with
a # before each line change in case you want
to find the changes later. Something like
###CHANGED###
   will do.

Find these files:
   tkeclipse.tcl
   eclipse_tools.tcl
They should both be located in the lib_tcl subdirectory.

1.
Open tkeclipse.tcl in a text editor.

-- In the section marked
-- "Load packages and initialise global settings"
-- Add this line after the other 'set' statements

set tkecl(last_file_selected) {}

2.
--In  the section "Make the toplevel window"
-- Find this line:
label .query.label -text "Query Entry"

-- Comment out that line(by putting a # in front of it),
-- and add these three lines right below it:

set querylabeltext "Query Entry - $tkecl(last_file_selected)"
label .query.label -textvariable querylabeltext
bind .query.label <Button-3> {tkecl:remove_current_highlights;
tkecl:compile_popup}

3.
-- Find this line (about 10 lines further down):
frame .query.buttons

-- Add this line right after it:

button .query.buttons.reload -text "reload" -command {tkecl:compile_file
$tkecl(last_file_selected)}

-- (The next line after that starts with the words
--   "button .query.buttons.make")

4.
-- In the section "Pack the toplevel window"
-- Find the line:
pack .query.buttons.run .query.buttons.more -side left -expand 1 -fill x

-- Comment it out (put a # in front) and add this line
-- right after it:
pack .query.buttons.reload .query.buttons.run .query.buttons.more -side
left -expand 1 -fill x

-- Save your changes to tkeclipse.tcl.

5.
-- Open the file eclipse_tools.tcl in your text editor.

-- Find the proc tkecl:compile_popup.

-- Find line:
    global tkecl
-- Add this line right after it:
    global querylabeltext

6.
-- Also in proc tkecl:compile_popup
-- Add these 2 lines just before the final '}'

    set tkecl(last_file_selected) $file
    set querylabeltext "Query Entry - $file"

-- The proc should now read:

proc tkecl:compile_popup {} {
    global tkecl
    global querylabeltext

    set file [tk_getOpenFile -defaultextension
$tkecl(defaultextension) -filetypes $tkecl(filetypes) -title "Compile
File" -initialdir [pwd]]
    tkecl:compile_file $file
    set tkecl(last_file_selected) $file
    set querylabeltext "Query Entry - $file"

}

-----------------------------
That's it. Save both files and reopen tkeclipse.

Note: The Reload button only works after you have
loaded a file. Until then, nothing will happen when
you press it.

Only the most recently loaded filename is stored.

Right-click where it says "Query Entry" to
open the compile file pop-up.
Received on Wed Dec 8 10:15:46 1999

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:04 PM GMT GMT