Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
BigEasy/BigEasyDialogs.h
/* |
File: BigEasyDialogs.h |
Contains: xxx put contents here xxx |
Written by: xxx put writers here xxx |
Copyright: © 1992 by Apple Computer, Inc., all rights reserved. |
Change History (most recent first): |
<2+> 5/5/93 dvb Fields & controls. |
<2> 4/3/92 dvb New calls for getting text & numbers. |
<1> 1/20/92 dvb first checked in |
*/ |
/* file: BigEasyDialogs.h |
* |
* Started 2 January 1992, more or less. |
* |
*/ |
/*-------------------------- |
Inclusions |
--------------------------*/ |
#include <Types.h> |
/*-------------------------- |
Types |
--------------------------*/ |
typedef void (*beDialogUpdate)(long refcon,const Rect *updateRect); |
typedef void (*beDialogKey)(long refcon,short key,short mods); |
typedef void (*beDialogClick)(long refcon,Point p,short mods); |
typedef void (*beDialogIdle)(long refcon); |
typedef struct |
{ |
short count; |
short defaultButton; /* highlighted, and <return> hits it */ |
short cancelButton; /* cmd-. or 'escape' hits it */ |
struct |
{ |
Str31 name; |
char key; /* cmd-key for the button, or 0 for none */ |
} button[5]; |
} EasyDialogButtonList; |
#define kEasyDialogOkay ((EasyDialogButtonList *)-1) |
#define kEasyDialogOkayCancel ((EasyDialogButtonList *)-2) |
#define kEasyDialogCancelOkay ((EasyDialogButtonList *)-3) |
#define kEasyDialogSaveDiscardCancel ((EasyDialogButtonList *)-4) |
typedef enum |
{ |
easyButton, /* long */ |
easyCheckbox, /* long */ |
easyRadioGroup, /* long */ |
easyTextNumber, /* 256 bytes */ |
easyTextString /* long */ |
}; |
typedef void (*EasyFieldDialogProc)(short itemNumber,struct EasyField *field); |
typedef struct |
{ |
char itemNumber; |
char itemCount; /* How many of that type. */ |
char itemType; /* Regular buttons terminate dialog */ |
char general; /* fractional bits for number */ |
} EasyField; |
typedef struct |
{ |
short defaultButton; /* one for enter key, and roundrected */ |
short cancelButton; /* one for esc and cmd-., and makes no change in output */ |
EasyField field[100]; |
} EasyFieldList; |
/*-------------------------- |
Routines |
--------------------------*/ |
long EasyDialog(Rect *windowRect, |
beDialogUpdate updateProc, |
beDialogKey keyProc, |
beDialogClick clickProc, |
beDialogIdle idleProc, |
EasyDialogButtonList *buttonList, |
long refcon); |
short EasyDialogMessage(short iconID, |
StringPtr header,StringPtr body, |
EasyDialogButtonList *buttonList); |
Boolean EasyDialogGetString(const StringPtr dialogTitle, |
const StringPtr dialogPrompt, |
StringPtr inOutString,short maxInOutStringLength); |
Boolean EasyDialogGetNumber(const StringPtr dialogTitle, |
const StringPtr dialogPrompt, |
long *inOutNumber); |
Boolean EasyFieldDialog(short dialogID,EasyFieldList *fieldList,void *data, |
StringPtr dialogTitle); |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-03-19