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: More Macintosh Toolbox /
Chapter 8 - Control Panels


Summary of Control Panels

Pascal Summary

Constants

CONST 
      {values for the message parameter for control device functions}
      initDev     = 0;  {perform initialization}
      hitDev      = 1;  {handle click in enabled item}
      closeDev    = 2;  {respond to user closing the control panel}
      nulDev      = 3;  {handle null event}
      updateDev   = 4;  {handle update event}
      activDev    = 5;  {handle activate event}
      deActivDev  = 6;  {respond to control panel becoming inactive}
      keyEvtDev   = 7;  {handle key-down or auto-key event}
      macDev      = 8;  {check whether control panel can run }
                        { on current system}
      undoDev     = 9;  {handle Undo command}
      cutDev      = 10; {handle Cut command}
      copyDev     = 11; {handle Copy command} 
      pasteDev    = 12; {handle Paste command}
      clearDev    = 13; {handle Clear command}
      {initial value of cdevStorageValue}
      cdevUnset   = 3;  {the control device function has not }
                        { returned a handle}
      {error codes} 
      cdevGenErr  = -1; {general error; no error dialog box is displayed }
                        { to the user}
      cdevMemErr  =  0; {not enough memory available to continue; an }
                        { out-of-memory error dialog box is displayed to }
                        { the user}
      cdevResErr  =  1; {needed resource is not available or is missing; }
                        { error dialog box is displayed to the user}
      {values for the message parameter for a monitors extension function}
      initMsg        = 1;  {perform initialization}
      okMsg          = 2;  {user clicked OK button}
      cancelMsg      = 3;  {user clicked Cancel button}
      hitMsg         = 4;  {user clicked enabled control}
      nulMsg         = 5;  {handle null event}
      updateMsg      = 6;  {handle update event}
      activateMsg    = 7;  {not used}
      deactivateMsg  = 8;  {not used}
      keyEvtMsg      = 9;  {handle keyboard event}
      superMsg       = 10; {show superuser controls}
      normalMsg      = 11; {show only normal controls}
      startupMsg     = 12; {gives user status (whether a superuser)}

Application-Defined Routines

Control Device Functions

FUNCTION MyCdev    (message, item, numItems, CPrivateValue: 
                    Integer;VAR theEvent: EventRecord; 
                    cdevStorageValue: LongInt;
                    CPDialog: DialogPtr): LongInt; 

Monitors Extension Functions

FUCNTION MyMntrExt (message, item, numItems: Integer; 
                    monitorValue: LongInt; mDialog: DialogPtr; 
                    theEvent: EventRecord; screenNum: Integer; 
                    VAR screens: ScrnRsrcHandle; 
                    VAR scrnChanged: Boolean): LongInt;

C Summary

Constants

enum {
      /*values for the message parameter for control device functions*/
      initDev     = 0,  /*perform initialization*/
      hitDev      = 1,  /*handle click in enabled item*/
      closeDev    = 2,  /*respond to user closing control panel*/
      nulDev      = 3,  /*handle null event*/
      updateDev   = 4,  /*handle update event*/
      activDev    = 5,  /*handle activate event*/
      deActivDev  = 6,  /*respond to control panel becoming inactive*/
      keyEvtDev   = 7,  /*handle key-down or auto-key event*/
      macDev      = 8,  /*determine whether control panel can run */
                        /* on current system*/
      undoDev     = 9,  /*handle Undo command*/
      cutDev      = 10, /*handle Cut command*/
      copyDev     = 11, /*handle Copy command*/ 
      pasteDev    = 12, /*handle Paste command*/
      clearDev    = 13, /*handle Clear command*/
      /*initial value of cdevStorageValue*/
      cdevUnset   = 3,  /*the control device function has not */
                        /* returned a handle*/
      /*error codes*/ 
      cdevGenErr  = -1, /*general error; no error dialog box is displayed */
                        /* to the user*/
      cdevMemErr  = 0,  /*not enough memory available to continue; an */
                        /* out-of-memory error dialog box is displayed to */
                        /* the user*/
      cdevResErr  =  1  /*needed resource is not available or is missing; */
                        /* error dialog box is displayed */
                        /* to the user*/
   };
enum {
      /*values for the message parameter for a monitors extension*/
      initMsg        = 1,  /*perform initialization*/
      okMsg          = 2,  /*user clicked OK button*/
      cancelMsg      = 3,  /*user clicked Cancel button*/
      hitMsg         = 4,  /*user clicked enabled control*/
      nulMsg         = 5,  /*handle null event*/
      updateMsg      = 6,  /*update event*/
      activateMsg    = 7,  /*not used*/
      deactivateMsg  = 8,  /*not used*/
      keyEvtMsg      = 9,  /*handle keyboard event*/
      superMsg       = 10, /*show superuser controls*/
      normalMsg      = 11, /*show only normal controls*/
      startupMsg     = 12  /*gives user status (whether a superuser)*/
   };

Application-Defined Routines

Control Device Functions

pascal unsigned long MyCdev
             (short message, short item, short numItems, short CPrivateVal, 
              const EventRecord *theEvent,
              unsigned long cdevStorageValue, 
              DialogPtr CPDialog); 

Monitors Extension Functions

pascal unsigned long MyMntrExt 
             (short message, short item, short numItems, 
              unsigned long monitorValue, 
              DialogPtr mDialog, 
              const EventRecord *theEvent, short screenNum,
              ScrnRsrcHandle screens, Boolean scrnChanged);

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996