DataCAD How-To's



HOW TO MAKE ICON BUTTONS 

(For a Word 6-format version of this How-to,
click here to download)

INTRODUCTION

This page was written for the DOS version of DataCAD.  It is NOT applicable to the Windows versions.  We hope to have this page updated for the Windows version in the near future.  9/12/02.

Now it’s time to make the graphic icons which run across the top of your screen. The file names for these are what go in the .pof columns 15-22. Note that this is 8 characters; the maximum allowed under DOS. The .pof extension is not included in these columns.

There is no reason why your icons have to have pictures on them. You can simply draw text. Sometimes a picture IS worth a thousand words, but sometimes it just makes more sense to use text.

One way to create icons is right in DCad (more later), but here is how you would do it outside of DCad. First of all you need a graphics program which can show you each pixel, enlarged, so that you can edit each one. And it must be able to allow you to easily pick one of the standard 256 colors supported by DCad. I have found Paint Shop Pro to be a good one, and it’s available in both Win3.1 and Win95 versions. It is shareware and is available by searching at the following location (there are lots of others, but this works for now):

http://www.winsite.com/search (search for: Paint Shop Pro)

The .pof (picture out file) images that make up DCad’s icons is proprietary and not supported by any of the graphics programs. So to edit them you must convert them to a PCX format, which can be read by all of the popular graphics programs. Once you have finished changing your icon(s) you must then convert the file back to a POF file that DCad can read. DCad comes with a DOS utility which will do both of these conversions. They are located in DCad’s \POF directory, and are called pof2pcx.exe and pcx2pof.exe.

To convert a POF file to a PCX file you must make sure that the POF file and the pof2pcx.exe file are both located in the same directory where your POF and PCX files are located. Let’s say you were going to convert the icon moveicon.pof to a PCX file of the same name. At the DOS prompt, type:

pof2pcx[.exe] moveicon[.pof] moveicon[.pcx]

Note that you do not type the extensions in the brackets (.exe, .pof, or .pcx). You will now have a PCX file that can be edited in your graphics program. When you have finished making your changes and want to save the PCX file back to a POF file you would type the following at the DOS prompt (let’s assume you are going to give your new icon a new name -- mov2icon.pof.

pcx2pof[.exe] moveicon[.pcx] mov2icon[.pof]

If you want to convert a lot of icons all at once you can use one of the following batch files to do it quickly. Note that I have placed a copy of pcx2pof.exe and pof2pcx.exe in a new directory called \SUP\ MENUPOF\TEMP, which is where I do all my icon work. If you do your work in another directory you will need to modify the path accordingly.

If you’re not familiar with batch files, just open your ASCII text editor and type in the 3 lines shown for each file. Name the files as shown (MAKEPCX.BAT & MAKEPOF.BAT). Make sure they are also located in the directory where you will do your icon work. The MAKEPCX file, for instance, will make a copy of all the POF files in the current directory, run the pof2pcx conversion, then delete all the copied POF files. Make sure you copy these EXACTLY or they will not work.

MAKEPCX.BAT
COPY_*.POF_*.
FOR_%%N_IN_(C:\DCAD7\SUP\MENUPOF\TEMP\*. )_DO_pof2pcx_%%N_%%N
DEL_*.
 

MAKEPOF.BAT
COPY_*.PCX *.
FOR_%%N_IN_(C:\DCAD7\SUP\MENUPOF\TEMP\*. )_DO_pcx2pof_%%N_%%N
DEL_*.

( _ indicates a blank space -- don't type it in)
 
 

There is also a PCX/POF conversion program (written in QBasic) located on the "Icon Bar Collection Disk" which will interactively accomplish the same tasks.

Like the KEY files, the best way to make a new icon is often to start with an existing one, editing it as you see fit. In Paint Shop Pro (PSP) open the PCX icon file and zoom into it to about 14x. Now you can edit each individual pixel, zooming back out to see what the icon will look like at it’s actual size. If you want to make a new icon, open a new file in PSP and specify the size in pixels. Remember that small icons are 24x24 pixels, the medium ones are 32x32, and the large, default icons are 48x48. You can make a small icon out of a larger one by reducing an existing icon. However, you will probably find that the reduced icon needs to be touched up in order to make it read properly at its reduced size.

When you have finished, use the pcx2pof.exe conversion utility to convert your new icon(s) back to a POF format. Transfer your new POF icon to the \SUP\MENUPOF directory in DCad; this is the same directory that the KEY files are located in.

To make icons inside DataCAD without exiting DataCAD and without having to translate to or from the PCX format, you can use this method from Joseph Baron. It won an Honor Award in the Best of Cheap Tricks.

1. Draw a square that is .464" x .464" (this is the outline of the icon). This size is for the 32x32 resolution icons.

2. Draw anything you want in the square.

3. Change the display scale to 12" = 12" (full scale).

4. Save the icon using FileI/O / PixelOut/ToPof by Area to your \SUP\MENUPOF directory.

Now you can add all your new POF file name to the .pof column in your KEY file so that it can be used by DataCAD on the icon bar.

Written by: Michael Smith

February 1997

William Mitropoulos Associates
Architects
Lexington, MA


I’d like to acknowledge the following individuals whose collective information helped me to write this article:

Evan Shu Nick Pyner, Joseph Baron, Rick Morse, Dale Weiss, Mark Madura, Ted Blockley
 


Go Back to the WMA DataCAD Page