AddIcons

ALWAYS REMEMBER TO BACKUP YOUR APPLICATION FILES BEFORE YOU TRY
ANYTHING NEW.  I AM JUST LIKE EVERYONE ELSE - I MAKE MISTAKES TOO.

I wanted an easy & fast way to add icons to all or selected buttons in my application.  
I was able to find a template that adds the icons after the fact (you can't see the changes
in the IDE).  So not being able to find something that was quick, easy and pretty much user 
friendly, I wrote this program.

Here is what it does and how it works.

This program allows you to store your Button and Icon associations.  You can also define the
justification, width and height of the buttons.  It does not do everything, you still have to 
manually move & align the buttons on the windows in the Clarion IDE.

Create a TXA file from your existing application, select Export Text from the File menu of the 
Clarion IDE.  This TXA file will be used to make all changes to your application.

On initial startup a window will be displayed with prompts to enter the Data Path and the 
Location of Icons.  The Data Path is the location were you want the ButtonIcons data file to
be stored.  The Location of Icons should be the same path that the Clarion IDE uses for the
image/icon files (i.e. c:\clarion5\images).  This info may be changed by selecting FILE and then
Update Application INI from the menu bar.
 
The Browse the ButtonIcons File window will be displayed after startup.  From this browse 
window you enter the Button Name and Icon Name associations along with Field Justification,
Button Width and Button Height.  You can also specify to Replace Existing Icons.  If the
Replace Existing Icons field is unchecked then no processing will occur for that Button Name.
You should always preceed the Button Name with a ? (i.e. ?Button:Ok), doing so makes it
easier to find the correct button in the TXA file.

If you have multiple buttons with the same prefix you can specify an icon for an individual
button or have all the buttons with the same prefix have the same icon.  Lets say you have
these three buttons: ?Button:Lookup:Name, ?Button:Lookup:Number, ?Button:Lookup:ZipCode.
If you create an entry for ?Button:Lookup all buttons that begin with ?Button:Lookup will be
assigned the same icon, unless an entry is found with a closer match.  If you then create
another entry for ?Button:Lookup:ZipCode then any buttons found that begin with 
?Button:Lookup:ZipCode will be assigned a different icon from the other ?Button:Lookup buttons.

If you press the Lookup Button that is next the the Icon Name field the Windows file open
dialog box will be displayed.  You can use this dialog box to select an icon.  The Icon that
you have selected will be displayed to the right of the Lookup Button.

When you have finished entering the Button/Icon associations enter the filename of the
the TXA file that you created from your application in the Source File field.  You may also
press the Lookup Button next to the Source File field to use the Windows file open dialog.
Once a valid filename has been entered the Process TXA button will be enabled.  Press
the Process TXA button to begin adding/updating the icons in your TXA file.  The Process TXA
routine will first make a backup copy of the TXA file with a file extension of BXA.  If a backup
file of the same name already exists a warning message will be displayed, if  you select 
Yes to continue the existing BXA file will be overwritten, if no is selected the process is 
terminated.

When the Process TXA routine has completed, load your application in the Clarion IDE, then 
select Import Text from the File menu and select the name of TXA file that you started with.
When prompted to Auto Rename, Replace All or Prompt select Replace All.  This will import 
the the TXA file with the updated Button/Icon settings.

ALWAYS REMEMBER TO BACKUP YOUR APPLICATION FILES BEFORE YOU TRY
ANYTHING NEW.  I AM JUST LIKE EVERYONE ELSE - I MAKE MISTAKES TOO.

This program is FreeWare.  The APP and DCT files are available at no cost, email me and
I will send them to you.  If you make any changes please send them to me.

This program should be pretty easy to use.  However, if you have any questions, you may
contact me via eMail - machone@ao.net.


Pete
