ZoomBox CDEF

By Kyle Hammond
kyle [dot] hammond [at] snowmintcs [dot] com


Last updated 2001-01-26

Contents

Please note that this code is very nice if you're programming for Mac OS 7.x - 9.x. If you're doing programming for Mac OS X, there are much more modern solutions that Apple provides for you to use.

This archive contains the code for a control that looks like the System 7 standard window zoom box, although the CDEF will use the Appearance Manager (version 1.1 or higher) to draw the theme specific zoom button if the Appearance Manager is installed. ZoomBox CDEF is source code that you compile separately and add to your project.

The code for zooming is, by definition, application specific so none of that is done here. This CDEF is basically a button that looks like a window zoom box.

There is also a function to create a ControlDefUPP for use with Carbon.


Using the ZoomBox CDEF

  1. Add the relevant files to your project.
    • For Carbon targets: Add the ZoomBox.c file to your project.
    • For non-Carbon targets: Copy the CDEFs from ZoomBoxCDEF.rsrc or ZoomBox CDEF to your project.
  2. Create a control that uses it.
    • For Carbon targets: Call CreateCustomControl with the UPP from the NewZoomBoxCDEFUPP function.
    • For non-Carbon targets: Call NewControl with a procID of 2064 for PPC and 2048 for 68K (unless you renumber the CDEF resources).
  3. When the control is clicked and TrackControl returns the same part number as FindControl (which should be kControlButtonPart), do your zooming behavior.

Wish List

The following are some of the things I'd like to see implemented.

Note: These things will probably never get done because I don't program for Mac OS 7.x - 9.x anymore.

Downloads

ZoomBoxCDEF.hqx - Binhexed self-extracting archive (246K) - contains Codewarrior 11, Codewarrior Pro 4, Pro 5 and Pro 6 projects, source code, and the compiled CDEFs for 68K and PPC.

Acknowledgments

All the people who've written CDEFs and posted the source code.

Thanks to Brian S. Hall for the code to draw the Platinum zoom box without the Appearance Manager.

Go to my home page.

Send feedback to kyle [dot] hammond [at] snowmintcs [dot] com