ABOUT Color XCMD....

These external commands deal with a special color window on top of the HyperCard window. All drawings can be performed in any screen depth resolution and in dithering mode or with use of color lookup tables. Mouse events in color window are sent to HyperCard.

Requirements:

Mac II, Centris or Quadra with system 7.0 or more recent.
HyperCard 2.0 or more recent.
For 8 bit depth pictures set memory of HyperCard to 2 Mo.
For 32 bit depth pictures set memory of HyperCard to 5 Mo.
See Technical Documentation for special inits of globals, name of externals windows...

Special Thanks for external commands used in demo stack :

HCBalloon © Len Saaf, Raleigh Associates 1991
MacType 1.3 © Frederic Rinaldi 1990
Resources 1.0 ©Steve Maller Apple Computer 1988

See HINTS for special inits of globals, name of special windows, script for correcting a bug in HC 2.2...

INSTALLATION

Copy required XCMD and XFCN from the Color XCMD demo stack to your stack with a resource editor or add in your OpenStack script

start using stack <the long name of your Color XCMD copy demo stack>

HINTS

Globals:

Name of special windows:

Special event:

By example:

on closeEnterField
global textname
ink on,0,221,221,221,the rect of textname
text textname
end closeEnterField

Creation of the color window:

by InitColor which must be first called

Special handler in stack script with HC version 2.2:

--- this handler for avoiding a new bug in HC 2.2 (corrected in 2.3)

on mousedoubleclick
send mouseup to the target
end mousedoubleclick

--- this bug disappear in 2.3 version after I send a bug stack to the HC developement team


PICT & PICTRES XCMD for displaying pictures

Pict longfilename,on/off,effect[,rect[,option]]

PictRes PICTresID,on/off,rect

where:

Example:

PICT "DD:diapos:photo1",on,7,the rect of card button "Photo"


CLUT XCMD for changing Color LookUp Table

Clut longfilename[,eraserect]

where:

Example:

CLUT "DD:diapos:photo1",the rect of card button "Photo"

N.B.: CLUT is only useful for screen depth equal or lower to 8 !


XCMD for drawing simple graphics

InvertCRect rect

Ink on/off,effect[,r,g,b[,rect[,pat]]]

DrawBorder on/off,rect[,r,g,b[,pat]]

WinDraw [rect[,effect]]

where:

InverCRect draws a rect in inverse colors
Ink fills a rect with black or the specified color with a pattern n° pat
DrawBorder draws a black or color rectangular border with a pattern n° pat
Windraw puts an offscreen graphics on the screen (previously drawn off)


XCMD for drawing styled field texts

Text textfieldname[,on/off[,r,g,b]]

EnterField textfieldname

EnterMenuField textfieldname

where:

NB: you can close editing windows in EnterField and EnterMenuField by pressing EnterKey.


MISCELEANOUS XCMD or XFCN

AddClut2Pict CLUTfilename,PICTfilename

SnapShot filename,rect

Depth()

RestoreCLUT

Fade in|out[,speed(0-8)[,red,green,blue(0-255)]]

where:

AddClut2Pict attachs a CLUT resource to PICTfilename by adding colors present in the CLUT of CLUTfilename to the best CLUT of PICTfilename. This XCMD allows to add few colors (16 or less) to PICT file and restricts the colors used for displaying the PICT (240 or more)

SnapShot takes a snapshot of the specified rect and stores the resulting PICT in the file named filename

Depth is a XFCN that returns the current depth of main monitor.

RestoreCLUT is useful for restoring the system color palette.

Fade for screen fading effect (don't forget to add fade out in your CloseStack handler in case of problem !)


All rights reserved. Freeware for non-profit use.

For commercial use contact

Gilles Kuntz
11, rue des Trois Epis
38100 GRENOBLE FRANCE
email: Gilles.Kuntz@imag.fr