SL-Edit

Version 3.01

SourceForge.net Logo
by Stephan Linkel


History
Overview
Features
The Clipboard
The Document Structure
The File 'filetypes.tcl'
Bindings in the textwidget
Plugins
Filesystem
Where to download SL-Edit

History:

SL-Edit was first programmed 1999. At that time it could only handle one file at once and the only improvement to notepad was the replace function.
In 2000, the program has been completely re-written. Now it got the ability to handle more than one file at once, plugins could be embedded, and it was at last nearly as functionally than version 3.00
And in 2002, SL-Edit was re-written one more time. Now it uses the advantages of the whole BWidget package, which means that almost all modules are used. Furthermore, it got a filesystem view in order to compensate the mostly long waiting times by using DDE and opening a file from Windows' Explorer.


Overview:

SL-Edit is a simple plain-text-editor (i.e. no WYSIWYG like letter writing and layout software) as there are many many others. Myself, I used mostly notepad, which is too simple, you have to do all yourself, so I tried many others, like UltraEdit, but even these programs had not all the functions I wish. So I thought: "Hey, why don't you write your own editor? Then you can be really sure, that everything you need can be done!".
This was the beginning of SL-Edit (I know, it's a silly name...simply put my initials S.L. and Edit together)...
And in version 3.00 it became better than I ever thought at first.


Features:

SL-Edit has these abilities:

Clipboard:

SL-Edit has a special clipboard function to save more than one string.
If you use the default keys CTRL-x, CTRL-c, CTRL-v you save a string it in the main clipboard, which also can be accessed from all other applications.
If you want to save more than one string (for variable names, etc.), press SHIFT-CTRL-c and SHIFT-CTRL-v and then any character key. For example: select a test, then press SHIFT-CTRL-c. Your cursor now will be shown as a waiting clock. Now Press any key, e.g. 'd' and the selected string will be saved under this key. In the Clipboard menu now appears a entry for this key. To Paste the saved data, press SHIFT-CTRL-v, again the waiting clock, and then 'd', and it will be pasted.
It's very simple, but useful.


Document Structure:

SL-Edit can show the document structure of a text. Look at the file 'filetypes.tcl' in the SL-Edit directory. There you will find a procedure called 'Filetypes::treeFill'. This procedure will always be called on any open or save. It searches in the text for a string like '>MARK<*>/MARK<'. For every string like this it will create a marker and a link to it in the Document Structure Tree. You can use it for quickly jump to a special segment in your text. You can also add a tag named '>IMG<[string]>/IMG<' where '[string]' is the filename without extension of a gif file in the ./images/ subdirectory of SL-Edit. Then this image will be shown beside the marker name
Furthermore, there is a procedure called 'Filetypes::treeFill_tcl'. This procedure will be called, when the opened file has the extension '.tcl'. It searches for procedures and creates a marker for every procedure in the text.
Write your own procedure 'Filetypes::treeFill_[extension]' for any file extension you want to upgrade the document structure. If you wrote such a procedure, please send it to Stephan.Linkel@t-online.de, so I'll add it to the next release.
You can also create temporary markers in the text, which will only exist at this runtime with the popup menu of the textwidget ('Add Marker').

Open the sourcecode ('sl-edit.tcl') to see how it looks


The File 'filetypes.tcl':

In this file you can write some procedures to support special filetypes.
The 3 procedures, that are possible are 'Filetypes::treeFill_*', 'Filetypes::init_*' and 'Filetypes::keyRelease_*', where * is the extension of the file.
'Filetypes::treeFill_*' is called when the Document Structure is processed.
'Filetypes::init_*' is called by opening a file.
'Filetypes::keyRelease_*' is called by every changing key release.
With this procedures, you are for example able to write a syntax highlighting.
See the delivered filetypes.tcl for the 3 procedures for .tcl files. I have written syntax highlighting and Document Structure processing.

Bindings:

SL-Edit has these bindings in the textwidget:
Any key
will update the indicators showing position and length of the text, or, if any text selected, the length of the selected text.
will call the procedure 'Filetypes::keyRelease_*', if it exists (See The File 'filetypes.tcl')
Control-a
will select the whole text
Control-f
shows the search window
Control-r
shows the replace window
Control-z
undo
F5
updates the Document Structure
Shift-Return
will do a newline with syntax indent, when syntax indent is disabled and a clear newline when it is enabled.
Shift-Backspace
will delete all white-spaces between the linestart and the insert cursor.
Control-Backspace
will delete all white-spaces between the previous word and the insert cursor; ignores newlines.
SL-Edit has these global bindings:
Escape
Will cancel most of eventually processes with long periods, e.g. Replace or File listings. This key also works for the tcl-specific procedures from the original filetypes.tcl
Control-o
open a file
Control-s
save the text
Control-n
create a new, clear tab
Control-q
Close a file
Alt-F4
Hide SL-Edit, if DDE and Winico are used, or exit if not used
Shift-F10
Ends the busy status. Use this if you found a bug which does not unset the busy status. Don't forget to report the bug to Stephan.Linkel@t-online.de
Shift-F11
Shows the log window of the start-up
Shift-F12
Shows the Tcl/Tk console


Plugins:

SL-Edit can be upgraded with plugins, which are little Tcl/Tk scripts named '[plugin name].tcl' in the ./plugins/ directory.
There will be a menu item in the menu 'Plugins' which will execute the script.
How it works:
SL-Edit creates a procedure with contains the source code saved in a plugin file.
You can access these variables:
SYS
array, which contains the specifications of the config.ini file
RUNTIME
array, which contains values for the runtime, e.g. textvariables etc.
TK
array, which contains the widget paths for the most important widgets
textwidget
string, which contains the path name of the textwidget actually shown
textwidget
string, which contains the path name of the document structure tree actually shown
Look at one of the provided plugins to see how they work and orient you at these.


Filesystem:

The Filesystem tab shows a Windows Explorer like view of the filesystem. You can do the most important functions like creating, editing, renaming, copying, moving and deleting files and directories.
Note, that the Filesystem Tab is still in beta-status.
Bindings in the listbox:
F2
rename the selected file or directory
F5
update the listbox
F7
create a new directory


Download:

You can download SL-Edit at http://sourceforge.net/projects/sledit