
                   ------------------------------------
                                 CodeTemps

                         Version 1.30 (31-Mar-03)

                            Andrew Ayre 1997-98
               Additions/changes by Ray Favre from 01-05-99
                   ------------------------------------

INTRODUCTION...

  CodeTemps allows the conversion of window templates (created in
utilities such as !TemplEd) to DrWimp wimp-function calls.

  This allows windows to be defined and created entirely in BASIC
using DrWimp within your 'RunImage', instead of loading them in from a
Templates file.

  One advantage of this is that if you secure your source code so it
cannot be altered, then neither can your windows.

  This version of !CodeTemps provides output which is only suitable
for using in programs constructed with Dr Wimp Version 3.80 or later.


USING...

  Load in the usual way by double-clicking on the !CodeTemps
application icon. (A special warning window appears on loading. Please
close this when you have read the message. From the 'Options' item on
the iconbar menu you can stop the warning being displayed on start-up,
if you wish.)

  !CodeTemps supports interactive help, such as Acorn's !Help.

  Clicking on the iconbar icon opens the main window, but CodeTemps
cannot do anything until you drop a Templates file (&FEC) onto the
main window or the iconbar icon.

  Once a templates file has been loaded, the main window will show all
the windows defined in the templates file.

  Click Select over a window name and a save window will appear,
allowing you to save the corresponding BASIC code to a file or
straight into your DrWimp application.

      N.B. The supplied version currently has a limit of 30 windows
           per loaded template file. This can easily be changed by
           opening the !Run file and altering the value at the end of
           the line which reads:
    
                 Set Max$TemplateWindows 30

           (You might also need to increase the WimpSlot values if
           you make 'Max$TemplateWindows' very large indeed - but this
           is unlikely)  

OUTPUT

  The output BASIC code for a window will contain one call of
FNwimp_createwindow, and then if there are any icons, a call of
FNwimp_createicon for each icon defined. If any icons use an outline
font then any necessary calls of FNwimp_getfont will also be included
in the output.

HELPFUL INFORMATION

1) FLAGS...

  The wimp-functions 'FNwimp_createwindow' and 'FNwimp_createicon'
require flags to be set to give various options for the resulting
window and the icons. !CodeTemps automatically prepares these flags
and allows them to be represented in the output Basic code as binary
(eg. %000101101101), decimal (eg. 365), or hexadecimal (eg. &16D) at
your choice. You can choose which base is used from the options
window. By default, binary is used - as it is often more convenient to
be able to read the individual bit settings.

  The 'colourflags%' value (introduced in Dr Wimp 3.80) is always
produced as a Hex value - because each hex digit then represents the
colour of one item of window furniture. (see Dr Wimp Manual)

  A quick reference to the wimp-function flag details is given in the
textfile 'QuickRef'.

  The options window is obtained by clicking on the 'options...' item
of the CodeTemps iconbar menu.

2) TEMPLED ICON NAMES...

       (A copy of !TemplEd is included in the Dr Wimp package.)

  !TemplEd is a template editor which, among its other attributes,
allows you to give names to icons (by using the icon validation
string). Naming icons allows the names to be used in your 'RunImage'
as an alternative to using icon numbers. 

  For example, you may put 'Nwrite' in the validation string of icon 3
in a window to give it the name 'write'.

Normally when saving the window from !CodeTemps as BASIC, the line to
define this icon will start with:

  icon3%=FNwimp_createicon(......

  But if the 'Use TemplEd icon names' option is turned on in the
'Options' window, then when the window is saved the line will start
with:

  write%=FNwimp_createicon(......

This makes using icon names very easy to implement.

3) NOTE ON USING OUTLINE FONTS...

  If an outline font is used in an icon then, as mentioned earlier,
!CodeTemps will write a call of 'FNwimp_getfont' for that font and put
the corresponding font handle into the call of 'FNwimp_createicon'.

If the same font is used later in another icon, in the same window,
then there will not be another call of 'FNwimp_getfont' for this same
font, as it is unnecessary. The already-available font handle will, of
course, be put in the new call of 'FNwimp_createicon'.

  Note however, that if you are converting more than one window for
the same application, and more than one template uses the same font,
then there will be a call of FNwimp_getfont for that font for each window.
One of these calls can be removed as the font handles will be identical.


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

For distribution conditions see the !!ReadMe!! file.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

EOF130