Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Operating System Utilities /
Chapter 5 - Control Panel Extensions


Summary of Control Panel Extensions

Pascal Summary

Constants

CONST
   {component types}
   SoundPanelType                = 'sndP';   {sound panel}
   VideoPanelType                = 'vidP';   {video panel}
   {component subtypes}
   kAlertSoundsPanel             = 'alrt';   {alert sounds panel}
   kInputsPanel                  = 'mics';   {input devices panel}
   kOutputsPanel                 = 'spek';   {output devices panel}
   kVolumesSubType               = 'vols';   {volumes panel}
   {component flags}
   channelFlagDontOpenResFile    = 2;        {do not open resource file}
   {Component Manager request codes for routines}
   kPanelGetDitlSelect           = 0;        {get panel's item list}
   kPanelGetTitleSelect          = 1;        {get panel's name}
   kPanelInstallSelect           = 2;        {restore item settings}
   kPanelEventSelect             = 3;        {handle event in panel}
   kPanelItemSelect              = 4;        {handle click in a panel item}
   kPanelRemoveSelect            = 5;        {panel is about to be removed}
   kPanelValidateInputSelect     = 6;        {validate panel settings}
   kPanelGetSettingsSelect       = 7;        {get panel settings}
   kPanelSetSettingsSelect       = 8;        {set panel settings}

Control Panel Extension-Defined Routines

Managing Panel Components

FUNCTION MyPanelGetDITL		(globals: Handle; VAR ditl: Handle)
				: ComponentResult;
FUNCTION MyPanelInstall		(globals: Handle; dialog: DialogPtr; 
				itemOffset: Integer): ComponentResult;
FUNCTION MyPanelGetTitle	(self: ComponentInstance; title: Str255)
				: ComponentResult;
FUNCTION MyPanelRemove		(globals: Handle; dialog: DialogPtr; 
				itemOffset: Integer): ComponentResult;

Handling Panel Events

FUNCTION MyPanelItem		(globals: Handle; dialog: DialogPtr; 
				itemOffset: Integer; itemNum: Integer)
				: ComponentResult;
FUNCTION MyPanelEvent		(globals: Handle; dialog: DialogPtr; 
				itemOffset: Integer; theEvent: eventRecord; 
				VAR itemHit: Integer; VAR handled: Boolean)
				: ComponentResult;

Managing Panel Settings

FUNCTION MyPanelValidateInput
				(globals: Handle; VAR ok: Boolean)
				: ComponentResult;
FUNCTION MyPanelGetSettings	(globals: Handle; VAR ud: UserData; 
				flags: LongInt): ComponentResult;
FUNCTION MyPanelSetSettings	(globals: Handle; ud: UserData; 
				flags: LongInt): ComponentResult;

C Summary

Constants

/*component types*/
#define SoundPanelType           'sndP'   /*sound panel*/
#define VideoPanelType           'vidP'   /*video panel*/
/*component subtypes*/
#define kAlertSoundsPanel        'alrt'   /*alert sounds panel*/
#define kInputsPanel             'mics'   /*input devices panel*/
#define kOutputsPanel            'spek'   /*output devices panel*/
#define kVolumesSubType          'vols'   /*volumes panel*/
/*component flags*/
enum {
   channelFlagDontOpenResFile    = 2      /*do not open resource file*/
};
/*Component Manager request codes for routines*/
enum {
   kPanelGetDitlSelect           = 0,     /*get panel's item list*/
   kPanelGetTitleSelect,                  /*get panel's name*/
   kPanelInstallSelect,                   /*restore item settings*/
   kPanelEventSelect,                     /*handle event in panel*/
   kPanelItemSelect,                      /*handle click in a panel item*/
   kPanelRemoveSelect,                    /*panel is about to be removed*/
   kPanelValidateInputSelect,             /*validate panel settings*/
   kPanelGetSettingsSelect,               /*get panel settings*/
   kPanelSetSettingsSelect                /*set panel settings*/
};

Control Panel Extension-Defined Routines

Managing Panel Components

pascal ComponentResult MyPanelGetDITL
				(Handle globals, Handle *ditl);
pascal ComponentResult MyPanelInstall
				(Handle globals, DialogPtr dialog, 
				short itemOffset);
pascal ComponentResult MyPanelGetTitle
				(ComponentInstance self, StringPtr title);
pascal ComponentResult MyPanelRemove
				(Handle globals, DialogPtr dialog, 
				short itemOffset);

Handling Panel Events

pascal ComponentResult MyPanelItem
				(Handle globals, DialogPtr dialog, 
				short itemOffset, short itemNum);
pascal ComponentResult MyPanelEvent
				(Handle globals, DialogPtr dialog, 
				short itemOffset, eventRecord *theEvent, 
				short *itemHit, Boolean *handled);

Managing Panel Settings

pascal ComponentResult MyPanelValidateInput
				(Handle globals, Boolean *ok);
pascal ComponentResult MyPanelGetSettings
				(Handle globals, UserData *ud, long flags);
pascal ComponentResult MyPanelSetSettings
				(Handle globals, UserData *ud, long flags);


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996