Copyright: Copyright 1998 Noval Conseil
Citation: A bon chat, bon rat


CodeWarp

CodeWarp v1.15 - Copyright 1998 Noval Conseil - Eric Grange

What's CodeWarp ?

Compatibility

Installation

Using CodeWarp

Options

Known Issues / History

Registering / Contact / Disclaimer


What's CodeWarp ?

CodeWarp is a little expert for Inprise/Borland Delphi 3/4, allowing quick code navigation in your source. It displays classes, funcs & procs in a popup tree view, and brings the editor to those spots in a click. If you ever found yourself repeatedly striking the PageUp and PageDown keys, using the Search command just to get to that petty procedure lost in your file, wheeling desperately across your class-browser's never ending class-tree, or roaming your packages in search for some golden component's code, you'll adopt CodeWarp.

This is a real productivity-oriented tool and not a put-all-the-classes-from-every-source-in-an-over-packed-tree-window like class browsers generally are. The aim is to warp the cursor where you want it to go and not to display a clean, object-oriented, but barely useable view.

So how does CodeWarp does it all ?

- it opens a huge TreeView with tons of structured shortcuts

- it opens a popup, it is not crowding your desktop space but making use of it all

- it loads instantaneously

- it's always up-to-date

- it can work on buggy or incomplete code

- it can be fully operated without the mouse (all keys are below/within right hand).

Practice proves CodeWarp gets you to the right position in a few keyboard clicks.


Compatibility

CodeWarp requires Inprise/Borland Delphi 3 or 4, but it could also work with other Borland OpenToolsAPI compatible software like C++Builder and JBuilder, but hasn't been tested (I don't have them...), and the CodeWarp parser doesn't understand C++ or Java yet. :-(

CodeWarp has been tested under Delphi 3 Standard, Delphi 3 C/S and Delphi 4 Standard.

•	If you have any other version, don't hesitate to report good/bad compatibility.

•	If you find any conflicts between CodeWarp and another package (conflicting object/units names, etc.).

Great care has been taken by choosing weird unit/class names to avoid this problem, but, er, nobody knows.


Installation

Codewarp Package File :

Delphi 3	CodeWarp.dpl

Delphi 4	CodeWarp.bpl

This help file should be copied to your windows\help directory. Place the CodeWarp package file anywhere you see fit (delphi\bin is a good choice).

Start Delphi and Install CodeWarp as a standard design-time package. Remove it the same way.

You should now be ready to use CodeWarp.

Registry Key :

For those of you who don't like things that happen behind their back, you should be aware that CodeWarp stores all preferences in the registry, so don't be too surprised if you see a new key

HKEY_CURRENT_USER\Software\CodeWarp


Using CodeWarp

After installing CodeWarp in the Delphi IDE, you get two new Menu Items, 'About Code Warp', under the Help menu, allowing to reach the About Box (along with Options, Legends and Registration window), and a 'Code Warp' item under the Search Menu, this one calling the CodeWarp popup panel (but you will for sure prefer the shortcut : Ctrl+W, this shortcut can be directly used from the editor window).

The CodeWarp panel is a tree representation of the active unit in the editor windows :

- [1] classes : shortcuts to class declarations and member implementation for each class

- [2] interface : shortcuts to interface items (classes, uses, type, const, procs & funcs prototypes...)

- [3] implementation : shortcuts to implementation stuff (classes, uses, type, const, initialization/finalization...)

- [4] procedures : shortcuts to procedure implementations

- [5] functions : shortcuts to function implementations

- [6] project : shortcuts to units & forms in your project

- [7] components : shortcuts to known component packages and units within these packets (requires the package source (.dpk and .pas))

- [8] local libraries : shortcuts to your local libraries units (directory & file tree) *

- [9] VCL Source : shortcuts to VCL unit files (this requires you to have the VCL source files, they come with Client-Server versions of Delphi) *

Base entries are identified by a quick number (1 to 9), typing that number selects and opens/closes the node, keypad is top for this. By default, the first node (classes) is opened. You can change this from the options window.

Node Icons are color coded depending on kind. The legend can be accessed by pressing F1.

You can either double-click the items or use the space bar/enter key to warp the editor position to the selected spot in the code. When units get longer than three or four screen pages, you will quickly get addicted to warping, believe me.

TIP : You have just opened the functions node, are facing 200+ functions and want to go directly to XTraFunc ? Type 'x' repeatedly and the treeview will circle on the nodes beginning with 'x', if there is only one function beginning with 'x', you'll get it in only one keystroke...

Some of the node refer to a unit (units in your project, in a component package, in a directory...), you can use them to simply warp to the unit source or you can expand them, they will be parsed, and entries 1 to 5 will be added to the treeview for the selected unit, allowing to warp directly to the MyClass.MyFunc methode in the MyUnit.pas of MyPackage, just before checking how Borland handled that exotic WM_STRANGEMESSAGE in TStrangeThing of RTL\SYS\strgstuf.pas.

The User Interface is highly customizable, just reach "About CodeWarp" then "Options" (either from the Delphi Help Menu or by pressing F1 with CodeWarp window open). All options are described with hints.

Note on "local libraries" and "VCL Source" :

These entries actually work as a small file explorer, displaying all ".pas" files in folders under a base directory. Like the project and component entries, these entries are filled only when expanded, so you may experience a 1 or 2 seconds wait if you have hundreds of files in your directories...


Options

There is a variety of options to customize how your source is parsed, what is displayed or hidden and how CodeWarp will behave. This options are accessed by clicking Options in the About form (Help/About CodeWarp).

Class Parser Options

Display Options

CodeWarp User Interface Options

VCL Path Options

Local Libs Options

Re-Parsing Options


Class Parser Options

Ignore Forward Declarations

Ignore EZ inheritance

Include Record Types

Mirror Class Scope

Mirror Class Methods


Display Options

Hide Options

Sorting


CodeWarp UI

Shortcut Key

Default Entry

Drill Remembrance

Cosmetics

Behaviours


VCL Path

This options allows you to set the VCL Source path (the VCL Source some with Delphi C/S, not with the standard edition). Three options are offered :

•	None / Unavailable : if you don't have the VCL Source or don't want to see it.

•	Default Path (C:\Program Files\Borland\Delphi 3\Source).

•	Custom Path : use this option to specify any path (if the VCL is on a networked disk or you used a custom install directory)

Note : This entry actually works as a small file explorer, displaying all ".pas" files in folders under a base directory. It is filled only when expanded, so you may experience a 1 or 2 seconds wait if you have hundreds of files in your directories...


Local Libs

This option allows you to declare the paths to your local libraries directories.Multiple directories (Entry Path) will appear under a Entry Name subnode in CodeWarp's tree, if only one entry is declared, it will appear directly under the Local Libraries entry :

•	To add a new directory, enter its name and path in the edit boxes and press Add

•	To remove a directory, select it and use popup-menu, the Del or Suppr Key.

•	To edit an Entry Name, use popup-menu or long-click it (same as standard listview)

•	To edit an Entry Path, use popup-menu or double-click it

•	To arrange entries, use Move Up / Move Down in the popup-menu

Note : This entry actually works as a small file explorer, displaying all ".pas" files in folders under a base directory. It is filled only when expanded, so you may experience a 1 or 2 seconds wait if you have hundreds of files in your directories...


Re-Parse

CodeWarp default behaviour is to fully re-parse the active unit each time it is invoked.

This means that what you see in the tree is always up-to-date, but this process can eat up some time if you're on a slow computer and browsing very large files (100 Ko or more, such monsters exist in the VCL).

CodeWarp can activate a comparison mechanism before re-parsing a unit : it will re-parse and re-build the tree only if something changed in the source, but the comparison, though not as time-consuming as the parser, takes some time (if you are frequently modifying a large file, performance will be better without comparison).

This options allows you tune the comparison mechanism activation for files of a certain size.

Note : When a unit is not reparsed, CodeWarp's tree is left as is between consecutive Ctrl+W.


Registering

Registering

CodeWarp v1.xx is now distributed as free software, so there is no warranty of any kind (see standard disclaimer below). However, Noval Conseil retains copyright on all aspects of this softwares, to the extent permitted by the law, by "free software", it is only and solely meant that users do not need a licence to use the software.

For Commercial/Business or Enthousiasmed users, a PostCard or a Donation is always welcome ;-).

Contact / Support / Registrations / Flames

shall be sent to : egrange@hotmail.com

Disclaimer of Warranty

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE SOLD "AS IS" AND

WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY

OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED.

NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.

The user must assume the entire risk of using the program.  ANY

LIABILITY OF THE SELLER WILL BE LIMITED EXCLUSIVELY TO PRODUCT

REPLACEMENT AND UPDATES, REFUNDS OF PURCHASE PRICE ARE NOT

POSSIBLE considering that you had time to test the product during

the evaluation period.

If CodeWarp turns your backups to garbage, blows up your network, scares your girlfriend away or if your puppy dies after eating a printout, well, too bad. Your were warned (but if any of these happens, report !).

(Standard Disclaimer, but hey, M$'s is worse, get a look at it...)

Property and Trademarks

Delphi is a registered trademark of Borland/Inprise. Inprise has no connections of any kind to CodeWarp, they just happen to sell one of the best development tool in this part of the world. Other trademarks are property of there respective owners.


Known Issues / History

Known Issues / What is coming soon :

1)	Warping to a form method, with the form unit closed, brings the form to front,

not the code view. However, the cursor in the code view is positionned Ok.

If anybody knows how to get rid of that behaviour...

2)	Delphi 4 : support for newly introduced project features.

3)	Parser does NOT actually cares about comments (whatever their styles), in most

cases, this is no problem for general use (commented out procs can still be

reached, etc.) but this causes some mess up with commented out language tags.

4)	CodeWarp as static window rather than popup. Could prove useful as Inprise

do not activate the code explorer in Delphi 4 Standard.

5)	The ToolBar ain't right in D4. Seems to be a bug with D4's toolbar component as

even from within the D4 IDE, I can't get the buttons in the right order...

7)	<Your suggestions here>...

History :

1.15	New features : 	Added a shortcut toolbar for mouse-addicts. Works the same

way as regular numpad shorcuts.

If 'Classes' contains only one class, it is expanded right

                            	from start (that's one click less).

Fixes :	Standard VCL path now uses registry entries for D3 & D4

Fixed multiple-opening bug, CodeWarp would sometimes re-open an

already opened file in the IDE.

Fixed search path problem (registry key name fix for D4)

Many spelling fixes (thanks Hendy Irrawan)

Fixed a bug concerning missed methods & class declarations in

the implementation section (thanks again Hendy Irawan)

1.14	New feature :	A custom invokation shortcut can now be defined

Fixes :	Some misspellings. Yet zillions remains, Help !

1.13	New features :	Delphi 4 compatibility.

Local Libs entry editing enhanced a little.

Package Files are now sorted.

Fixes :	'uses' parsing now allows for comments in between units, however

this 'uses'/comments stuff is not over yet (see KI 3).

Fixed double '\' bug for local libs/vcl subdir browsing.

1.12	Status Change : CodeWarp is now distributed as Copyrighted FreeWare.

New feature :  	Multiple Local Libraries, you can no define any number of

of local library paths

Fixes :	Invoking CodeWarp with no opened form/source is no Ok.

Last unit in a DPK was shown with a semicolon ';' and CodeWarp

failed warping to this file. Now Fixed.

'uses' parsing used to mess up with 'in' statements. Fixed.

'File not found' error now displays the missing file's name.

1.11	New features : 	CodeWarp can now focus the procedure you're in, remember

the expanded nodes and the last focused node.

'uses' clause now parsed (referenced units are warpable).

Added this help file.

Fixes :	Direct File Warping, now works under component entry.

Default Entry is consistent with picked option (it misbehaved in v1.10).

Fixed Bug when DPK file could not be found.

1.10	Major Additions :	Project files, Components, Local libraries

and VCL Source entries

You can now warp to files or to special positions in

files (they are parsed only when necessary)

Added Parse Cache, big units are re-parsed only if changed, now the

final cpu-cycle-eater is the treeview (80-90%).

Fixed bug with class declarations in implementation part of units

(CodeWarp would miss some class methods and class scopes)

Fixed/Added 'packed record' (now listed along with standard records)

Show Class Method Under "Procedures" & "Function" now saved properly

1.03	CodeWarp now correctly finds procs & funcs with left tabs & spaces

(was working in some alpha, but got lost in between.. :( )

Gradient caption bar is no longer filled with a gradient when in

low-color modes (less than 15 bits/pixels)

Thanks goes to R.Franklin for reporting these.

1.02	Added Class Scope entries (and accompanying options)

1.01	Added Record support, Implementation entries

Minor cosmetic fixes & enhancements

1.00	First Public Release Version


Ignore Forward Declarations

If this option is set, CodeWarp will not display forward class declarations in the treeview.

For instance :

TMyClass = class;

TAnotherClass = class (TSomeAncestor)

... some stuff here ...

end;

TMyClass = class (TAnotherClass)

... some more stuff here ...

end;

If option is set, entries will be :

 |

+ TAnotherClass = class (TSomeAncestor)

+ TMyClass = class (TAnotherClass)

 |

else, you will see :

 |

+ TMyClass

+ TAnotherClass = class (TSomeAncestor)

+ TMyClass = class (TAnotherClass)

 |


Ignore EZ inheritance

If this option is set, EZ class inheritances will not be displayed. This is mainly to filter out subclassings with no additions (takes out the Exception subclassings in the VCL).

The following declaration is considered an EZ inheritance :

TMyClass = class (TAncestorClass);

but this one :

TMyClass = class (TAncestorClass)

end;

is not, and a TMyClass entry will be displayed, whatever the value of the Ignore EZ inheritance option (it is considered to be a class in making).


Include Record Types

If this option is set, record types will be listed along class types in the class entry. But as pascal does not allow member methods for a record, this node will never have child, and clicking on it will warp to the record's declaration.

CodeWarp visually differentiates  classes from records.

Example :

TRect = record

Left, Top, Right, Bottom : Integer;

end;

if option is is set, will be listed as

 |

+ TRect = record

 |


Mirror Class Scope

This options mirrors class scope in the class tree.

Class scope nodes are always visible in the interface & implementation entries.

For Instance :

TMyClass = class (TSomeAncestor)

private

FMyField : TFieldType;

public

constructor Create; override;

destructor Destroy; override;

function SomePublicFunc : TFuncResultType;

end;

Will be displayed as, if option is NOT set :

but, if option is set, you will see :


Mirror Class Methods

If this option is set, class methods will not only be listed in classes under their class, but also in the procedures and functions entries along with their class name (MyClass.MyFunc).


Hide Options

Hide Method Kind Text :

This option will hide the "procedure", "function", "constructor" or "destructor" qualifier.

Hide Method Parameters :

This option will hide the parameters of the method in the treeview.

Example :

function MyFunc(firstParam : TType; secondParam : Integer) : Boolean;

will be displayed as

Hide	Hide

Kind	Parameters	Result

not set	not set

not set	set

set	not set

set	set


Sorting

Activating this options sorts the node in alphabetical order, instead of leaving them in the source order.

Files and Directories are always sorted in alphabetical order (Project, Components, VCL Source and Local Libs entries).


Shortcut Key

This option allows to set an alternate invokation key for CodeWarp when the default Shortcut (CTRL+W) is already used by the IDE (such as in the Classic Keyboard setting, where Ctrl+W moves the source one line up).

The shortcut is specified using standard Windows description, ie. for English Windows versions, this Ctrl/Shift/Alt in any combination and a Key, for French version it is Ctrl/Maj/Alt, etc...

If you specified an invalid shortcut, CodeWarp will detect it and ask you to enter a correct one. Once a valid shortcut is entered, it is immediately activated and will be remembered along with other options.


Default Entry

This options allows you to select wich entry will be displayed after CodeWarp is invoked.

The choices are :

- root node (classes, interface, implementation...) : selects the corresponding root node

- Closest Procedure/Method : selects the closest procedure/method your cursor was in the editing window

- The Previously Focused : selects the node that was focused the las time CodeWarp was invoked (if it still exists). You can use this option in combination with Drill Remembrance if you want the treeview to stay "as is" between invocations.

For Instance (Closes Procedure/Method) :

In the following code chunk,

...

(1)

...

procedure MyProc;

begin

(2)...MyProc stuff here...

end;

(3)

function MyClass.MyFunc(someParam : TSomeType) : Integer;

begin

(4)...MyFunc stuff here...

end;

...

Considering that MyProc is the very first procedure of the unit, if your cursor was in :

- (1), (2) & (3)  : MyProc will be selected, under the procedures entry

- (4) : MyFunc will be selected, under the Classes/MyClass entry


Cosmetics

Window Height = Full Screen Height :

If this option is set, CodeWarp popup window will take your full screen height, if not set, CodeWarp will only take 2/3 of the screen size. Why 2/3 ? well, in 800x600, the popup appears just below the main delphi bar...


Behaviours

A double click on a node... :

This options allows to set the behaviour of mouse clicks, it does not affect keyboard clicks. Some people expand treenodes by clicking on the  expand [+] button, others double-click the item. But double-clicking an item in codewarp means warping, and some nodes (like files) can be expanded AND warped to.

The two options are :

- Warps to Code Position : a double click always warps (on a warp node). If you are a double-click-to-expand addict, this one is not for you.

- Expands Node or Warp : a double click will expand/collapse a node (if this node has children) and warp only if node is childless. This means that you cannot warp to a file with the mouse.


Drill Remembrance

This option is for tree-drillers who do not like to lose their drills between consecutive Ctrl+W : CodeWarp can remember which nodes were expanded the last time it was invoked.

This option is not checked by default, and each time you invoke CodeWarp, a neat, fully collapsed tree, is presented.

In fact, this is done by :

- remembering the captions of the opened nodes in the tree

- rebuilding the tree by parsing the unit

- expanding nodes and branches according to the remembered captions

This means that even if you trashed or altered whole chunks of your code, as long as the names are kept as they are, drill remembrance works. But if you expanded class TMyClass, then renamed it to TMyClassRenamed, it won't be expanded at the next invocation.

You can use this option along with Default Entry = The Previously Focused if you want the tree view to stay completely 'as is' in between invocations.