home *** CD-ROM | disk | FTP | other *** search
- Documentation file for PatEdit pattern editor
- written by Don Hyde 1988
-
-
- Not copyrighted, you may make whatever use you may wish of
- this program and its accompanying documentation. No warranties
- of any kind are made or implied.
-
-
- The purpose of this program is to eliminate graph paper and
- guessing from the process of creating the necessary patterns for
- input to the Amiga SetAfPt macro call. This call sets the area
- fill pattern for the area filling graphics calls such as
- RectFill, AreaDraw, etc.
-
- The program's input is entirely through the intuition
- interface, with most functions being performed with the mouse.
- To run from cli, type PatEdit. An icon is also supplied, and the
- program can be run from the Workbench with it.
-
- The large field of white squares on a green background at the
- left is the pattern itself. Clicking on the squares inverts the
- individual bits. Clicking on the Clear gadget below the pattern
- clears it to all white (zero bits). Moving the slider beside the
- field changes the vertical size of the pattern. Since the Amiga
- functions restrict this size to be a power of 2, the possible
- sizes are 1, 2, 4, 8, 16, or 32 bits high. I'm not sure what the
- actual maximum value allowed by the Amiga functions is, but 32 is
- all that would fit on the screen and make the squares easy to
- click on. When you move the slider, the program selects the
- nearest allowed value.
-
- The large rectangular area on the right shows you what the
- pattern will look like on a large area of the screen. When the
- program starts, this area will be black because it starts with
- black ink in both pens. Below the example area are two color
- palettes, one for each of the two Amiga pens. Clicking the mouse
- on the color palettes changes the color of its pen. The example
- area will reflect these choices. In a program you would call
- SetAPen and SetBPen to set pen 1 and 2 respectively.
-
- Pressing the right mouse button reveals a Project menu with
- the menuitems Load, Save, About, and Quit.
-
- Load and Save bring up Charlie Heath's file requester, which
- will display files having the extension .pat, which is used by
- the program to designate its data files. Load, as you might
- expect loads one of these small files. Save saves the pattern in
- a file called <filename>.pat. It also creates a file named
- <filename>.h, which contains C code for the data which you will
- need to pass to SetAfPt, SetAPen, and SetBPen in order to use the
- patterns. You will also need to call SetDrMd(rp, JAM2) in order
- to make patterns like the ones on the screen. Other arguments to
- SetDrMd can cause some interesting effects, and you may want to
- experiment with them.
-
- About briefly describes the program.
-
- Quit, makes the program go away.
-
- The screen, window, menus, and Gadgets were created with
- PowerWindows2, which I highly recommend to anyone who intends to
- create programs for the Intuition environment. With PW2, it is
- not only possible, but easy and convenient to create programs
- like this one. Including some learning of PW2, which I had just
- upgraded from the earlier version, it took me two days to get
- this tool up and debugged. I have included the PW2 internal form
- file PatEdit.pw for anyone who is interested in modifications to
- the program. The program was compiled with Manx c 3.40B. I have
- included a makefile. If you do not have make, you should be able
- to figure out how to link and load it from the makefile.
-
- I have not included source code for Charlie Heath's file
- requester, since his message asks that it be distributed only in
- archive form, and without modifications. I think that modified
- object is ok, so I have included that. As supplied it will not
- operate on a low-resolution screen, so it needs slight
- modifications to work here, and I have added a filter so that it
- displays only .pat files. It is widely available in the public
- domain, so I trust you will be able to find it if you need to
- modify it. The needed changes are:
-
- In the static struct NewWindow NewFiles, the first number,
- which defines the left margin of the window, must be changed to
- 0, since the width of the window is 320, and that is the full
- width of a low-resolution screen. This change is adequate to
- make the program run.
-
- After the comment /* Here you can add a file/directory
- filter */, after the next line of code which begins p_D->isfile =
- ..., add the lines:
-
- /* .pat filter */
- if (p_D->isfile) /* filter only files, not directories */
- { p_mung=index(dir_info->fib_FileName, '.'); /* find . in name */
- if (!p_mung || strcmp(p_mung, ".pat")) return NL;
- }
-
- The line after is: p_mung = p_D->dE[0];
-
- This second change is the filter for files with .pat
- extensions.
-
- I hope you can enjoy the program and find it useful. It is
- pretty to look at anyway.
-
- Don Hyde
- 6641 Scott St.
- Hollywood, FL 33024
-
- (305)966-8179
-