View Tip

Warning! Some tips requires you to edit the Windows Registry. You should always be carefull when you do this and make sure you have a copy before doing so. The publisher of Source Edit will not take any responsibility for any damages these tips might cause to your system.


Short tutorial on how to use the Tools Configuration dialog box

The Tools Configuration dialog is probably one of the most complex utilities in Source Edit. At least according to the number of postings in the forum and e-mail questions I've got about how to use it.

Actually it isn't so hard to use, at least I hope you will agree with me after reading this tutorial :-)

The Tools Configuration allows you to add third-party tools to the Source Edit environment. This could, for example, be a compiler, a run-time environment, or a file viewer. The tool you add will be added as a menu command to the Tools menu and optionally as a button on the Tools toolbar.



The above image shows the Tools Configuration dialog with a configuration for compiling Java files using the javac.exe compiler that comes with the Sun JDK. As the Command Line I have the path to javac.exe, the easiest way is to use the Browse button [...] next to the edit box and select the file you want. As an argument to javac I pass $(FileTitle).

There are a few of these $(xxxx) named constants. They represent the current file you have opened in Source Edit. If you press the little arrow button next to the Command Line edit box you'll see a list of these constants in clear text. $(FileTitle) means file name with extention (but not the path).

So the tool is launching javac and passes the file name with extention to it. I could have used $(FullName) as well which would have passed the full path and name of the file. But in this case it isn't necessary because I use $(FileFolder) as the Working Directory.

Filling in the Working Directory edit box is optional. But in this case I want javac.exe to work in the directory of the current opened file, otherwise it wouldn't find it since I don't pass the path in the command line. So $(FileFolder) will simply be replaced with the path of the current opened file. You can press the Folder button next to the Working Directory edit box to add this constant (so you don't have to remember it's name).

The next edit box is the Menu Item Text. Here simply type in the text as you want it to appear on the Tools menu.

Check the Save all open files first check box if you want all opened files in Source Edit to be saved before launching the tool. The current document will always be saved when you launch a tool. So if you haven't saved the current document before the Save As... dialog will appear when you launch a tool.

Next we have the DOS Program Settings. If the program you want to launch with this tool configuration is a DOS or command line program you have the ability to capture the output of the program. The output will then appear in the Output window of Source Edit. In the above image you'll see that I have checked the Capture Output check box just to do so. However javac.exe doesn't redirect its output to StdOut so I also need to have the Use alternative capture method option checked. If you don't know how your tool will write it's output you'll just have to try and see for yourself. The third option is Keep prompt open after program exits which you don't need to check if you capture the output. But if you don't but rather want to watch the output in the Command Prompt window then check this option.

If you want you can add a button to the Tools toolbar. Simply check the Put command on toolbar check box. You can also edit the default image by clicking the Edit Image button which will launch the Button Editor. The Button Editor is a simple image editor that will allow you to load some predefined images or let you create one from scratch.

Now, maybe the most importent thing!
Always click the Add button (or the Replace button if you want to replace a selected tool in the list) before you click the Close button.

That's it! It wasn't that hard was it :-)

Written by: Joacim AnderssonMore tips...