+----------------------------------------------------------------------------+
|                                                                          |
|                                                                       |
|                                                                      |
|                                                                       |
|                                                                       |
|                                                                    |
|                                                             |
|                                                        |
|                                                      |
|                       Copyright  1996-1997 by:  |
|                                                  |
|                           WHITE ANTS SYSTEMHOUSE BV  |
|                            Geleen 12                  |
|                                  8032 GB Zwolle             |
|                                        Netherlands                |
|                                                               |
|                                         Tel. +31 38 453 86 31      |
|                                              Fax. +31 38 453 41 22      |
|                                                                        |
|                                             www.whiteants.com          |
|                                            support@whiteants.com      |
|                                                                           |
+----------------------------------------------------------------------------+



                        COMPONENT RENAMER 1.01
                        ======================



CONTENTS
--------
* History
* Introduction
* Description
* Limitations
* Files
* Install
* White Ants
* Technical Support
* How To Reach Us


HISTORY
-------
Feb 14, 1997 - (1.01) Old style unit -> new style unit in ModelMaker Model
Feb 04, 1997 - Initial Release 1.0


INTRODUCTION
------------

COMPONENT RENAMER 1.0 is Freeware (more info see Disclaim.txt) and contains a
helpful 16/32 bit Delphi unit CMPNAMES.PAS which enables you to define your
own component naming rules.

You'll enjoy this unit if you find yourself removing the standard names
Delphi assigns to components all the time. Whenever you drop a component on a
form during design time, the Renamer will apply the name rule you defined for
the component class. You could for example define that a TSpeedbutton should be
named Btn rather than SpeedButton1.

The idea of naming rules and the basic rule mechanism was taken from
Ray Lischners book Secrets of Delphi 2.0. We at White Ants extended his idea
into this unit.


DESCRIPTION
-----------

The Unit CMPNAMES.PAS contains a TRenamer class (private) which is applies user
definable naming rules to component names when components are added to a Delphi
form during design time. This allows you to define your own naming rules rather
than letting Delphi name your components.

For example you might define some rules like

Default=%t%N
TSpeedButton=Btn%N
TBitButton=Btn%N

The Renamer will then apply the names Btn, Btn1...Btn<n> for speedbuttons and
bit buttons rather than SpeedButton1..SpeedButton<n>, BitButton1..BitButton<n>.

The default rule in this example will rename TListboxes to "ListBox",
"ListBox1".."ListBox<n>" rather than ListBox1 to ListBox<n>.
Also applying the default rule a single Memo on your form will be named "Memo"
rather than "Memo1".

Naming rules should be defined in the NAMERULE.INI file which you should place
in the same directory as the COMPLIB.DCL. Whenever to rebuild the COMPLIB.DCL
the rules are interpreted. At the same time a NAMERULE.LOG file is written to
the same directory to inform you about rules have been used and to which
components the default rule applies.

Name Rules should be defined like: ( private profile / ini file format)

[NameRules]
Default=%t%N
TSpeedButton=Btn%N
etc..


The following format specifiers are supported:

   %t    : ClassName without leading 'T' e.g. Edit rather than TEdit
   %T    : ClassName including leading 'T' . e.g. TEdit
   %n    : Always add a number making the component's name unique
   %N    : Only add a number if the component's name is non-unique

Delphi's default rule expressed in this style is:
   %t%n

The Renamers default rule is:
   %t%N  ,which will only add a number if necessary.

The unit CMPNAMES adds NO components to your VCL, so don't be amazed not to
find any. In fact it only uses the Register procedure which is called by Delphi
if you install the unit in the VCL. The Register procedure will instantiate the
Renamer.

There is no demo for this unit. Just install CMPNAMES.PAS in your component
library and see what happens when you add a new component to a form.


LIMITATIONS
-----------

The Renamer uses a TDesignerWrapper class to obtain information from the
currently active form. It hooks / unhooks this designer"-spy" between the
active form and it's form designer to spy for renames. If you have any other
software installed that uses this mechanism this will not work. The Renamer
will detect this and display an error. In this case you will not be able to use
this unit.

The same goes for the DCL's Screen.OnActiveFormChange event. The Renamer
handles this event storing the old eventhandler.

Usually there should be no problem however!


FILES
-----

Main files
- README.TXT    This file
- DISCLAIM.TXT  The file containing the disclaimer for the component Renamer
- CMPNAMES.PAS  contains TRenamer class and some utilities
- DSGNWRAP.DCR  contains class TDesignerWrapper which is used by the Renamer.
- CONTAINR.PAS  contains a WAS container / collection class
- FILTERS.PAS   contains the WAS streaming mechanism, used by CONTAINERs
- NUMUTILS.PAS  contains numeric utilities used by CMPNAMES
- STRUTILS.PAS  contains string utilities used by CMPNAMES
- FILEUTIL.PAS  contains file utilities used by CMPNAMES
- TEXTSTRM.PAS  contains text stream classes used by CMPNAMES (logging only)
- NAMERULE.INI  example name rules. Put this file in the COMPLIB.DCL directory

ModelMaker Model files (compatible with MMWin 3.20 and newer)
- CMPNAMES.MPR .MMB .MMC .MMD .MME:
		the Model files containing CMPNAMES.PAS and DSGNWRAP.PAS


INSTALL
-------

- Unzip CMPNAMES.ZIP, for example in directory c:\CMPNAMES
- Copy the file NAMERULE.INI to the directory in which your COMPLIB.DCL is
  stored (Delphi 1.0: in the install components dialog you can find this path)
- Install the unit CMPNAMES.PAS in your component library
  (Delphi 1.0: Options|Install Components|Add...). You will NOT see a new
  component since there is no component defined in this unit, but you can have
  a look in the NAMERULE.LOG file which gives you feed back about the installed
  naming rules.
- Start adding components to a form and watch the Renamer work.

The ModelMaker 3.20 model can be loaded in ModelMaker. This can cause some
problems due to missing aliases. The Model of Component Renamer assumes that
the alias 'was' points to the directory in which you would like the unit code
to be generated. To solve this problem you can do two things:

1. Create an alias 'was'. (pop-up menu in Units view | source aliases)

2. Create your own alias.
   Edit the unit properties (pop-up menu in Units view | Edit Unit) and set the
   property 'Source Path alias' to the just created alias.


WHITE ANTS
----------

White Ants systemhouse BV is specialised in developing software in Borland
Delphi for all Microsoft Windows platforms.

Our main activities are:

1) Turnkey building of customer specific software.
   Varying from single applications to complex real-time distributed computer
   systems and multi-tier client/server solutions.

2) Tools and components for professional colleague software developers.
   Including the Delphi CASE tool ModelMaker.


Visit our website for information about us and our latest tools and components:

   www.whiteants.com

Or e-mail us at info@whiteants.com


TECHNICAL SUPPORT
-----------------

Please e-mail us at support@whiteants.com if you have any problems or find any
bugs in this code.
We do not offer support on our FREEWARE by telephone, fax or letter.


HOW TO REACH US
---------------

White Ants systemhouse BV
Geleen 12
8032 GB Zwolle
Netherlands

Tel. +31 38 453 86 31
Fax. +31 38 453 41 22

www.whiteants.com
support@whiteants.com
