home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / Appearance SDK 1.0.4 / Appearance Sample Code / Headers / PInterfaces / Controls.p < prev    next >
Encoding:
Text File  |  1999-07-16  |  77.9 KB  |  1,796 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Controls.p
  3.  
  4.      Contains:    Control Manager interfaces
  5.  
  6.      Version:    Technology:    Appearance 1.0.2
  7.                  Release:    To be used with Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1985-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Controls;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __CONTROLS__}
  28. {$SETC __CONTROLS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC ControlsIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __QUICKDRAW__}
  38. {$I Quickdraw.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __MENUS__}
  41. {$I Menus.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __TEXTEDIT__}
  44. {$I TextEdit.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __DRAG__}
  47. {$I Drag.p}
  48. {$ENDC}
  49. {$IFC UNDEFINED __ICONS__}
  50. {$I Icons.p}
  51. {$ENDC}
  52.  
  53.  
  54. {$PUSH}
  55. {$ALIGN MAC68K}
  56. {$LibExport+}
  57.  
  58.  
  59. CONST
  60.     _ControlDispatch            = $AA73;
  61.  
  62.  
  63. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  64. {    • Resource Types                                                                                    }
  65. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  66.     kControlDefProcType            = 'CDEF';
  67.     kControlTemplateResourceType = 'CNTL';
  68.     kControlColorTableResourceType = 'cctb';
  69.     kControlDefProcResourceType    = 'CDEF';
  70.     kControlTabListResType        = 'tab#';                        {  used for tab control (Appearance 1.0 and later) }
  71.     kControlListDescResType        = 'ldes';                        {  used for list box control (Appearance 1.0 and later) }
  72.  
  73. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  74. {    • Format of a ‘CNTL’ resource                                                                        }
  75. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  76.  
  77. TYPE
  78.     ControlTemplatePtr = ^ControlTemplate;
  79.     ControlTemplate = RECORD
  80.         controlRect:            Rect;
  81.         controlValue:            SInt16;
  82.         controlVisible:            BOOLEAN;
  83.         fill:                    SInt8;
  84.         controlMaximum:            SInt16;
  85.         controlMinimum:            SInt16;
  86.         controlDefProcID:        SInt16;
  87.         controlReference:        SInt32;
  88.         controlTitle:            Str255;
  89.     END;
  90.  
  91.     ControlTemplateHandle                = ^ControlTemplatePtr;
  92. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  93. {    • ControlHandle                                                                                        }
  94. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  95.     ControlRecordPtr = ^ControlRecord;
  96.     ControlPtr                            = ^ControlRecord;
  97.     ControlHandle                        = ^ControlPtr;
  98. {  ControlRef is obsolete. Use ControlHandle.  }
  99.     ControlRef                            = ControlHandle;
  100.     ControlPartCode                        = SInt16;
  101. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  102. { • Control ActionProcPtr                                                                                }
  103. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  104.     ControlActionProcPtr = ProcPtr;  { PROCEDURE ControlAction(theControl: ControlHandle; partCode: ControlPartCode); }
  105.  
  106.     ControlActionUPP = UniversalProcPtr;
  107. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  108. {    • ControlRecord                                                                                        }
  109. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  110.     ControlRecord = PACKED RECORD
  111.         nextControl:            ControlHandle;
  112.         contrlOwner:            WindowPtr;
  113.         contrlRect:                Rect;
  114.         contrlVis:                UInt8;
  115.         contrlHilite:            UInt8;
  116.         contrlValue:            SInt16;
  117.         contrlMin:                SInt16;
  118.         contrlMax:                SInt16;
  119.         contrlDefProc:            Handle;
  120.         contrlData:                Handle;
  121.         contrlAction:            ControlActionUPP;
  122.         contrlRfCon:            SInt32;
  123.         contrlTitle:            Str255;
  124.     END;
  125.  
  126. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  127. { • Control ActionProcPtr : Epilogue                                                                    }
  128. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  129.  
  130. CONST
  131.     uppControlActionProcInfo = $000002C0;
  132.  
  133. FUNCTION NewControlActionProc(userRoutine: ControlActionProcPtr): ControlActionUPP;
  134.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  135.     INLINE $2E9F;
  136.     {$ENDC}
  137.  
  138. PROCEDURE CallControlActionProc(theControl: ControlHandle; partCode: ControlPartCode; userRoutine: ControlActionUPP);
  139.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  140.     INLINE $205F, $4E90;
  141.     {$ENDC}
  142. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  143. {    • Control Color Table                                                                                }
  144. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  145.  
  146. CONST
  147.     cFrameColor                    = 0;
  148.     cBodyColor                    = 1;
  149.     cTextColor                    = 2;
  150.     cThumbColor                    = 3;
  151.     kNumberCtlCTabEntries        = 4;
  152.  
  153.  
  154. TYPE
  155.     CtlCTabPtr = ^CtlCTab;
  156.     CtlCTab = RECORD
  157.         ccSeed:                    SInt32;
  158.         ccRider:                SInt16;
  159.         ctSize:                    SInt16;
  160.         ctTable:                ARRAY [0..3] OF ColorSpec;
  161.     END;
  162.  
  163.     CCTabPtr                            = ^CtlCTab;
  164.     CCTabHandle                            = ^CCTabPtr;
  165. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  166. {    • Auxiliary Control Record                                                                            }
  167. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  168.     AuxCtlRecPtr = ^AuxCtlRec;
  169.     AuxCtlRec = RECORD
  170.         acNext:                    Handle;
  171.         acOwner:                ControlHandle;
  172.         acCTable:                CCTabHandle;
  173.         acFlags:                SInt16;
  174.         acReserved:                SInt32;
  175.         acRefCon:                SInt32;
  176.     END;
  177.  
  178.     AuxCtlPtr                            = ^AuxCtlRec;
  179.     AuxCtlHandle                        = ^AuxCtlPtr;
  180. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  181. {    • PopUp Menu Private Data Structure                                                                    }
  182. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  183.     PopupPrivateDataPtr = ^PopupPrivateData;
  184.     PopupPrivateData = RECORD
  185.         mHandle:                MenuHandle;
  186.         mID:                    SInt16;
  187.     END;
  188.  
  189.     PopupPrivateDataHandle                = ^PopupPrivateDataPtr;
  190.  
  191. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  192. {    • Errors are in the range -30580 .. -30599                                                            }
  193. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  194.  
  195. CONST
  196.     errMessageNotSupported        = -30580;
  197.     errDataNotSupported            = -30581;
  198.     errControlDoesntSupportFocus = -30582;
  199.     errWindowDoesntSupportFocus    = -30583;
  200.     errUnknownControl            = -30584;
  201.     errCouldntSetFocus            = -30585;
  202.     errNoRootControl            = -30586;
  203.     errRootAlreadyExists        = -30587;
  204.     errInvalidPartCode            = -30588;
  205.     errControlsAlreadyExist        = -30589;
  206.     errControlIsNotEmbedder        = -30590;
  207.     errDataSizeMismatch            = -30591;
  208.     errControlHiddenOrDisabled    = -30592;
  209.     errWindowRegionCodeInvalid    = -30593;
  210.     errCantEmbedIntoSelf        = -30594;
  211.     errCantEmbedRoot            = -30595;
  212.     errItemNotControl            = -30596;
  213.  
  214. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  215. {    • Control Definition ID’s                                                                            }
  216. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  217. {  Standard System 7 procIDs }
  218.  
  219.     pushButProc                    = 0;
  220.     checkBoxProc                = 1;
  221.     radioButProc                = 2;
  222.     scrollBarProc                = 16;
  223.     popupMenuProc                = 1008;
  224.  
  225.  
  226. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  227. {    • Control Types and ID’s available only with Appearance 1.0 and later                                }
  228. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  229.  
  230.     kControlSupportsNewMessages    = ' ok ';                        {  CDEF should return as result of kControlMsgTestNewMsgSupport }
  231.  
  232. { focusing part codes }
  233.     kControlFocusNoPart            = 0;                            {  tells control to clear its focus }
  234.     kControlFocusNextPart        = -1;                            {  tells control to focus on the next part }
  235.     kControlFocusPrevPart        = -2;                            {  tells control to focus on the previous part }
  236.  
  237.  
  238. TYPE
  239.     ControlFocusPart                    = SInt16;
  240. { Key Filter result codes                                                             }
  241. {                                                                                    }
  242. { Certain controls can have a keyfilter attached to them. The filter proc should    }
  243. { return one of the two constants below. If kKeyFilterBlockKey is returned, the    }
  244. { key is blocked and never makes it to the control. If kKeyFilterPassKey is        }
  245. { returned, the control receives the keystroke.                                    }
  246.  
  247. CONST
  248.     kControlKeyFilterBlockKey    = 0;
  249.     kControlKeyFilterPassKey    = 1;
  250.  
  251.  
  252. TYPE
  253.     ControlKeyFilterResult                = SInt16;
  254. {——————————————————————————————————————————————————————————————————————————————————————}
  255. {     SPECIAL FONT USAGE NOTES: You can specify the font to use for many control types.
  256.     The constants below are meta-font numbers which you can use to set a particular
  257.     control's font usage. There are essentially two modes you can use: 1) default,
  258.     which is essentially the same as it always has been, i.e. it uses the system font, unless
  259.     directed to use the window font via a control variant. 2) you can specify to use
  260.     the big or small system font in a generic manner. The Big system font is the font
  261.     used in menus, etc. Chicago has filled that role for some time now. Small system
  262.     font is currently Geneva 10. The meta-font number implies the size and style.
  263.     
  264.     NOTE:        Not all font attributes are used by all controls. Most, in fact, ignore
  265.                 the fore and back color (Static Text is the only one that does, for
  266.                 backwards compatibility). Also size, face, and addFontSize are ignored
  267.                 when using the meta-font numbering.
  268. }
  269. {——————————————————————————————————————————————————————————————————————————————————————}
  270.  
  271. CONST
  272.                                                                 {  Meta-font numbering - see not above  }
  273.     kControlFontBigSystemFont    = -1;                            {  force to big system font }
  274.     kControlFontSmallSystemFont    = -2;                            {  force to small system font }
  275.     kControlFontSmallBoldSystemFont = -3;                        {  force to small bold system font }
  276.  
  277. { Add these masks together to set the flags field of a ControlFontStyleRec    }
  278. { They specify which fields to apply to the text. It is important to make    }
  279. { sure that you specify only the fields that you wish to set.                }
  280.     kControlUseFontMask            = $0001;
  281.     kControlUseFaceMask            = $0002;
  282.     kControlUseSizeMask            = $0004;
  283.     kControlUseForeColorMask    = $0008;
  284.     kControlUseBackColorMask    = $0010;
  285.     kControlUseModeMask            = $0020;
  286.     kControlUseJustMask            = $0040;
  287.     kControlUseAllMask            = $00FF;
  288.     kControlAddFontSizeMask        = $0100;
  289.  
  290.  
  291. TYPE
  292.     ControlFontStyleRecPtr = ^ControlFontStyleRec;
  293.     ControlFontStyleRec = RECORD
  294.         flags:                    SInt16;
  295.         font:                    SInt16;
  296.         size:                    SInt16;
  297.         style:                    SInt16;
  298.         mode:                    SInt16;
  299.         just:                    SInt16;
  300.         foreColor:                RGBColor;
  301.         backColor:                RGBColor;
  302.     END;
  303.  
  304.     ControlFontStylePtr                    = ^ControlFontStyleRec;
  305. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  306. {    • Common data tags for Get/SetControlData                                                            }
  307. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  308.  
  309. CONST
  310.     kControlFontStyleTag        = 'font';
  311.     kControlKeyFilterTag        = 'fltr';
  312.  
  313.  
  314. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  315. {    • Control Feature Bits                                                                                }
  316. {——————————————————————————————————————————————————————————————————————————————————————————————————————}
  317.                                                                 {  Control feature bits - returned by GetControlFeatures  }
  318.     kControlSupportsGhosting    = $01;
  319.     kControlSupportsEmbedding    = $02;
  320.     kControlSupportsFocus        = $04;
  321.     kControlWantsIdle            = $08;
  322.     kControlWantsActivate        = $10;
  323.     kControlHandlesTracking        = $20;
  324.     kControlSupportsDataAccess    = $40;
  325.     kControlHasSpecialBackground = $80;
  326.     kControlGetsFocusOnClick    = $0100;
  327.     kControlSupportsCalcBestRect = $0200;
  328.     kControlSupportsLiveFeedback = $0400;
  329.  
  330. { Features introduced in Appearance 1.0.1 }
  331.     kControlHasRadioBehavior    = $0800;
  332.  
  333.                                                                 {  Control Messages  }
  334.     kControlMsgDrawGhost        = 13;
  335.     kControlMsgCalcBestRect        = 14;                            {  Calculate best fitting rectangle for control }
  336.     kControlMsgHandleTracking    = 15;
  337.     kControlMsgFocus            = 16;                            {  param indicates action. }
  338.     kControlMsgKeyDown            = 17;
  339.     kControlMsgIdle                = 18;
  340.     kControlMsgGetFeatures        = 19;
  341.     kControlMsgSetData            = 20;
  342.     kControlMsgGetData            = 21;
  343.     kControlMsgActivate            = 22;
  344.     kControlMsgSetUpBackground    = 23;
  345.     kControlMsgCalcValueFromPos    = 26;
  346.     kControlMsgTestNewMsgSupport = 27;                            {  See if this control supports new messaging }
  347.  
  348. { Messages in Appearance 1.0.1 or later}
  349.     kControlMsgSubValueChanged    = 25;
  350.     kControlMsgSubControlAdded    = 28;
  351.     kControlMsgSubControlRemoved = 29;
  352.  
  353. {——————————————————————————————————————————————————————————————————————————————————————}
  354. {     This structure is passed into a CDEF when called with the kControlMsgHandleTracking    }
  355. {    message                                                                             }
  356. {——————————————————————————————————————————————————————————————————————————————————————}
  357.  
  358. TYPE
  359.     ControlTrackingRecPtr = ^ControlTrackingRec;
  360.     ControlTrackingRec = RECORD
  361.         startPt:                Point;
  362.         modifiers:                SInt16;
  363.         action:                    ControlActionUPP;
  364.     END;
  365.  
  366.     ControlTrackingPtr                    = ^ControlTrackingRec;
  367. {——————————————————————————————————————————————————————————————————————————————————————}
  368. { This structure is passed into a CDEF when called with the kControlMsgKeyDown message }
  369. {——————————————————————————————————————————————————————————————————————————————————————}
  370.     ControlKeyDownRecPtr = ^ControlKeyDownRec;
  371.     ControlKeyDownRec = RECORD
  372.         modifiers:                SInt16;
  373.         keyCode:                SInt16;
  374.         charCode:                SInt16;
  375.     END;
  376.  
  377.     ControlKeyDownPtr                    = ^ControlKeyDownRec;
  378. {——————————————————————————————————————————————————————————————————————————————————————}
  379. { This structure is passed into a CDEF when called with the kControlMsgGetData or        }
  380. { kControlMsgSetData message                                                             }
  381. {——————————————————————————————————————————————————————————————————————————————————————}
  382.     ControlDataAccessRecPtr = ^ControlDataAccessRec;
  383.     ControlDataAccessRec = RECORD
  384.         tag:                    ResType;
  385.         part:                    ResType;
  386.         size:                    Size;
  387.         dataPtr:                Ptr;
  388.     END;
  389.  
  390.     ControlDataAccessPtr                = ^ControlDataAccessRec;
  391. {——————————————————————————————————————————————————————————————————————————————————————}
  392. { This structure is passed into a CDEF when called with the kControlCalcBestRect msg     }
  393. {——————————————————————————————————————————————————————————————————————————————————————}
  394.     ControlCalcSizeRecPtr = ^ControlCalcSizeRec;
  395.     ControlCalcSizeRec = RECORD
  396.         height:                    SInt16;
  397.         width:                    SInt16;
  398.         baseLine:                SInt16;
  399.     END;
  400.  
  401.     ControlCalcSizePtr                    = ^ControlCalcSizeRec;
  402. {——————————————————————————————————————————————————————————————————————————————————————}
  403. { This structure is passed into a CDEF when called with the kControlMsgSetUpBackground }
  404. { message is sent                                                                        }
  405. {——————————————————————————————————————————————————————————————————————————————————————}
  406.     ControlBackgroundRecPtr = ^ControlBackgroundRec;
  407.     ControlBackgroundRec = RECORD
  408.         depth:                    SInt16;
  409.         colorDevice:            BOOLEAN;
  410.     END;
  411.  
  412.     ControlBackgroundPtr                = ^ControlBackgroundRec;
  413. {——————————————————————————————————————————————————————————————————————————————————————}
  414. {    Key Filter                                                                            }
  415. {                                                                                        }
  416. { Definition of a key filter for intercepting and possibly changing keystrokes            }
  417. { which are destined for a control                                                        }
  418. {——————————————————————————————————————————————————————————————————————————————————————}
  419.     ControlKeyFilterProcPtr = ProcPtr;  { FUNCTION ControlKeyFilter(theControl: ControlHandle; VAR keyCode: SInt16; VAR charCode: SInt16; VAR modifiers: SInt16): ControlKeyFilterResult; }
  420.  
  421.     ControlKeyFilterUPP = UniversalProcPtr;
  422.  
  423. CONST
  424.     uppControlKeyFilterProcInfo = $00003FE0;
  425.  
  426. FUNCTION NewControlKeyFilterProc(userRoutine: ControlKeyFilterProcPtr): ControlKeyFilterUPP;
  427.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  428.     INLINE $2E9F;
  429.     {$ENDC}
  430.  
  431. FUNCTION CallControlKeyFilterProc(theControl: ControlHandle; VAR keyCode: SInt16; VAR charCode: SInt16; VAR modifiers: SInt16; userRoutine: ControlKeyFilterUPP): ControlKeyFilterResult;
  432.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  433.     INLINE $205F, $4E90;
  434.     {$ENDC}
  435. {——————————————————————————————————————————————————————————————————————————————————————}
  436. {    • BEVEL BUTTON INTERFACE (CDEF 2)                                                    }
  437. {——————————————————————————————————————————————————————————————————————————————————————}
  438. {    Bevel buttons allow you to control the content type (pict/icon/etc.), the behavior    }
  439. { (pushbutton/toggle/sticky), and the bevel size. You also have the option of            }
  440. {    attaching a menu to it. When a menu is present, you can specify which way the         }
  441. {    popup arrow is facing (down or right).                                                }
  442. {                                                                                        }
  443. {    This is all made possible by overloading the Min, Max, and Value parameters for the    }
  444. {    control, as well as adjusting the variant. Here's the breakdown of what goes where:    }
  445. {                                                                                        }
  446. {    Parameter                    What Goes Here                                            }
  447. {    ———————————————————            ————————————————————————————————————————————————————    }
  448. {    Min                            Hi Byte = Behavior, Lo Byte = content type.                }
  449. {    Max                            ResID for resource-based content types.                    }
  450. {    Value                        MenuID to attach, 0 = no menu, please.                    }
  451. {                                                                                        }
  452. {    The variant is broken down into two halfs. The low 2 bits control the bevel type.    }
  453. {    Bit 2 controls the popup arrow direction (if a menu is present) and bit 3 controls    }
  454. {    whether or not to use the control's owning window's font.                            }
  455. {                                                                                        }
  456. {    Constants for all you need to put this together are below. The values for behaviors    }
  457. {    are set up so that you can simply add them to the content type and pass them into    }
  458. {    the Min parameter of NewControl.                                                    }
  459. {                                                                                        }
  460. {    An example call:                                                                    }
  461. {                                                                                        }
  462. {    control = NewControl( window, &bounds, "\p", true, 0, kContentIconSuiteRes +         }
  463. {                            kBehaviorToggles, myIconSuiteID, bevelButtonSmallBevelProc,    }
  464. {                            0L );                                                        }
  465. {                                                                                        }
  466. {    Attaching a menu:                                                                    }
  467. {                                                                                        }
  468. {    control = NewControl( window, &bounds, "\p", true, kMyMenuID, kContentIconSuiteRes,    }
  469. {            myIconSuiteID, bevelButtonSmallBevelProc + kBevelButtonMenuOnRight, 0L );    }
  470. {                                                                                        }
  471. {    This will attach menu ID kMyMenuID to the button, with the popup arrow facing right.}
  472. {    This also puts the menu up to the right of the button. You can also specify that a    }
  473. {    menu can have multiple items checked at once by adding kBehaviorMultiValueMenus        }
  474. {    into the Min parameter. If you do use multivalue menus, the GetBevelButtonMenuValue    }
  475. {    helper function will return the last item chosen from the menu, whether or not it    }
  476. {    was checked.                                                                        }
  477. {                                                                                        }
  478. {    NOTE:     Bevel buttons with menus actually have *two* values. The value of the         }
  479. {            button (on/off), and the value of the menu. The menu value can be gotten    }
  480. {            with the GetBevelButtonMenuValue helper function.                            }
  481. {                                                                                        }
  482. {    Handle-based Content                                                                }
  483. {    ————————————————————                                                                }
  484. {    You can create your control and then set the content to an existing handle to an    }
  485. {    icon suite, etc. using the macros below. Please keep in mind that resource-based    }
  486. {    content is owned by the control, handle-based content is owned by you. The CDEF will}
  487. {    not try to dispose of handle-based content. If you are changing the content type of    }
  488. {    the button on the fly, you must make sure that if you are replacing a handle-        }
  489. {    based content with a resource-based content to properly dispose of the handle,        }
  490. {    else a memory leak will ensue.                                                        }
  491. {                                                                                        }
  492.  
  493. CONST
  494.                                                                 {  Bevel Button Proc IDs  }
  495.     kControlBevelButtonSmallBevelProc = 32;
  496.     kControlBevelButtonNormalBevelProc = 33;
  497.     kControlBevelButtonLargeBevelProc = 34;
  498.  
  499.                                                                 {  Bevel button graphic alignment values  }
  500.     kControlBevelButtonAlignSysDirection = -1;                    {  only left or right }
  501.     kControlBevelButtonAlignCenter = 0;
  502.     kControlBevelButtonAlignLeft = 1;
  503.     kControlBevelButtonAlignRight = 2;
  504.     kControlBevelButtonAlignTop    = 3;
  505.     kControlBevelButtonAlignBottom = 4;
  506.     kControlBevelButtonAlignTopLeft = 5;
  507.     kControlBevelButtonAlignBottomLeft = 6;
  508.     kControlBevelButtonAlignTopRight = 7;
  509.     kControlBevelButtonAlignBottomRight = 8;
  510.  
  511.  
  512. TYPE
  513.     ControlButtonGraphicAlignment        = SInt16;
  514.  
  515. CONST
  516.                                                                 {  Bevel button text alignment values  }
  517.     kControlBevelButtonAlignTextSysDirection = 0;
  518.     kControlBevelButtonAlignTextCenter = 1;
  519.     kControlBevelButtonAlignTextFlushRight = -1;
  520.     kControlBevelButtonAlignTextFlushLeft = -2;
  521.  
  522.  
  523. TYPE
  524.     ControlButtonTextAlignment            = SInt16;
  525.  
  526. CONST
  527.                                                                 {  Bevel button text placement values  }
  528.     kControlBevelButtonPlaceSysDirection = -1;                    {  if graphic on right, then on left }
  529.     kControlBevelButtonPlaceNormally = 0;
  530.     kControlBevelButtonPlaceToRightOfGraphic = 1;
  531.     kControlBevelButtonPlaceToLeftOfGraphic = 2;
  532.     kControlBevelButtonPlaceBelowGraphic = 3;
  533.     kControlBevelButtonPlaceAboveGraphic = 4;
  534.  
  535.  
  536. TYPE
  537.     ControlButtonTextPlacement            = SInt16;
  538. { Add these variant codes to kBevelButtonSmallBevelProc to change the type of button }
  539.  
  540. CONST
  541.     kControlBevelButtonSmallBevelVariant = 0;
  542.     kControlBevelButtonNormalBevelVariant = $01;
  543.     kControlBevelButtonLargeBevelVariant = $02;
  544.     kControlBevelButtonMenuOnRight = $04;
  545.  
  546. {
  547.    Behaviors of bevel buttons. These are set up so you can add
  548.    them together with the content types.
  549. }
  550.     kControlBehaviorPushbutton    = 0;
  551.     kControlBehaviorToggles        = $0100;
  552.     kControlBehaviorSticky        = $0200;
  553.     kControlBehaviorMultiValueMenu = $4000;                        {  only makes sense when a menu is attached. }
  554.     kControlBehaviorOffsetContents = $8000;
  555.  
  556. { Behaviors for 1.0.1 or later }
  557.     kControlBehaviorCommandMenu    = $2000;                        {  menu holds commands, not choices. Overrides multi-value bit. }
  558.  
  559. {  Content types supported by bevel buttons *and* image wells }
  560.     kControlContentTextOnly        = 0;
  561.     kControlContentIconSuiteRes    = 1;
  562.     kControlContentCIconRes        = 2;
  563.     kControlContentPictRes        = 3;
  564.     kControlContentIconSuiteHandle = 129;
  565.     kControlContentCIconHandle    = 130;
  566.     kControlContentPictHandle    = 131;
  567.     kControlContentIconRef        = 132;
  568.  
  569.  
  570. TYPE
  571.     ControlContentType                    = SInt16;
  572. { Data tags supported by the bevel button controls }
  573.  
  574. CONST
  575.     kControlBevelButtonContentTag = 'cont';                        {  ButtonContentInfo }
  576.     kControlBevelButtonTransformTag = 'tran';                    {  IconTransformType }
  577.     kControlBevelButtonTextAlignTag = 'tali';                    {  ButtonTextAlignment }
  578.     kControlBevelButtonTextOffsetTag = 'toff';                    {  SInt16 }
  579.     kControlBevelButtonGraphicAlignTag = 'gali';                {  ButtonGraphicAlignment }
  580.     kControlBevelButtonGraphicOffsetTag = 'goff';                {  Point }
  581.     kControlBevelButtonTextPlaceTag = 'tplc';                    {  ButtonTextPlacement }
  582.     kControlBevelButtonMenuValueTag = 'mval';                    {  SInt16 }
  583.     kControlBevelButtonMenuHandleTag = 'mhnd';                    {  MenuHandle }
  584.     kControlBevelButtonCenterPopupGlyphTag = 'pglc';            {  Boolean: true = center, false = bottom right }
  585.  
  586. { These are tags in 1.0.1 or later }
  587.     kControlBevelButtonLastMenuTag = 'lmnu';                    {  SInt16: menuID of last menu item selected from }
  588.     kControlBevelButtonMenuDelayTag = 'mdly';                    {  SInt32: ticks to delay before menu appears }
  589.  
  590. { Structure to pass into bevel buttons and image wells to set/get content type }
  591.  
  592. TYPE
  593.     ControlButtonContentInfoPtr = ^ControlButtonContentInfo;
  594.     ControlButtonContentInfo = RECORD
  595.         contentType:            ControlContentType;
  596.         CASE INTEGER OF
  597.         0: (
  598.             resID:                SInt16;
  599.             );
  600.         1: (
  601.             cIconHandle:        CIconHandle;
  602.             );
  603.         2: (
  604.             iconSuite:            Handle;
  605.             );
  606.         3: (
  607.             iconRef:            Handle;
  608.             );
  609.         4: (
  610.             picture:            PicHandle;
  611.             );
  612.     END;
  613.  
  614. {——————————————————————————————————————————————————————————————————————————————————————}
  615. {    • SLIDER (CDEF 3)                                                                    }
  616. {——————————————————————————————————————————————————————————————————————————————————————}
  617. {    There are several variants that control the behavior of the slider control. Any        }
  618. {    combination of the following three constants can be added to the basic CDEF ID        }
  619. {    (kSliderProc).                                                                        }
  620. {                                                                                        }
  621. {    Variants:                                                                            }
  622. {                                                                                        }
  623. {        kSliderLiveFeedback         Slider does not use "ghosted" indicator when tracking.    }
  624. {                                ActionProc is called (set via SetControlAction) as the    }
  625. {                                indicator is dragged. The value is updated so that the    }
  626. {                                actionproc can adjust some other property based on the    }
  627. {                                value each time the action proc is called. If no action    }
  628. {                                proc is installed, it reverts to the ghost indicator.    }
  629. {                                                                                        }
  630. {        kSliderHasTickMarks         Slider is drawn with 'tick marks'. The control            }
  631. {                                rectangle must be large enough to accomidate the tick    }
  632. {                                marks.                                                    }
  633. {                                                                                        }
  634. {        kSliderReverseDirection    Slider thumb points in opposite direction than normal.    }
  635. {                                If the slider is vertical, the thumb will point to the    }
  636. {                                left, if the slider is horizontal, the thumb will point    }
  637. {                                upwards.                                                }
  638. {                                                                                        }
  639. {        kSliderNonDirectional    This option overrides the kSliderReverseDirection and    }
  640. {                                kSliderHasTickMarks variants. It creates an indicator    }
  641. {                                which is rectangular and doesn't point in any direction    }
  642. {                                like the normal indicator does.                            }
  643.  
  644. CONST
  645.                                                                 {  Slider proc IDs  }
  646.     kControlSliderProc            = 48;
  647.     kControlSliderLiveFeedback    = $01;
  648.     kControlSliderHasTickMarks    = $02;
  649.     kControlSliderReverseDirection = $04;
  650.     kControlSliderNonDirectional = $08;
  651.  
  652.  
  653. {——————————————————————————————————————————————————————————————————————————————————————}
  654. {    • DISCLOSURE TRIANGLE (CDEF 4)                                                        }
  655. {——————————————————————————————————————————————————————————————————————————————————————}
  656. {    This control can be used as either left or right facing. It can also handle its own    }
  657. {    tracking if you wish. This means that when the 'autotoggle' variant is used, if the    }
  658. {    user clicks the control, it's state will change automatically from open to closed    }
  659. {    and vice-versa depending on its initial state. After a successful call to Track-    }
  660. {     Control, you can just check the current value to see what state it was switched to.    }
  661.                                                                 {  Triangle proc IDs  }
  662.     kControlTriangleProc        = 64;
  663.     kControlTriangleLeftFacingProc = 65;
  664.     kControlTriangleAutoToggleProc = 66;
  665.     kControlTriangleLeftFacingAutoToggleProc = 67;
  666.  
  667.                                                                 {  Tagged data supported by disclosure triangles  }
  668.     kControlTriangleLastValueTag = 'last';                        {  SInt16 }
  669.  
  670. {——————————————————————————————————————————————————————————————————————————————————————}
  671. {    • PROGRESS INDICATOR (CDEF 5)                                                        }
  672. {——————————————————————————————————————————————————————————————————————————————————————}
  673. {    This CDEF implements both determinate and indeterminate progress bars. To switch,     }
  674. {    just use SetControlData to set the indeterminate flag to make it indeterminate call    }
  675. {    IdleControls to step thru the animation. IdleControls should be called at least        }
  676. {    once during your event loop.                                                        }
  677. {                                                                                        }
  678.                                                                 {  Progress Bar proc IDs  }
  679.     kControlProgressBarProc        = 80;
  680.  
  681.                                                                 {  Tagged data supported by progress bars  }
  682.     kControlProgressBarIndeterminateTag = 'inde';                {  Boolean }
  683.  
  684. {——————————————————————————————————————————————————————————————————————————————————————}
  685. {    • LITTLE ARROWS (CDEF 6)                                                            }
  686. {——————————————————————————————————————————————————————————————————————————————————————}
  687. {     This control implements the little up and down arrows you'd see in the Memory        }
  688. {    control panel for adjusting the cache size.                                         }
  689.                                                                 {  Little Arrows proc IDs  }
  690.     kControlLittleArrowsProc    = 96;
  691.  
  692. {——————————————————————————————————————————————————————————————————————————————————————}
  693. {    • CHASING ARROWS (CDEF 7)                                                            }
  694. {——————————————————————————————————————————————————————————————————————————————————————}
  695. {    To animate this control, make sure to call IdleControls repeatedly.                    }
  696. {                                                                                        }
  697.                                                                 {  Chasing Arrows proc IDs  }
  698.     kControlChasingArrowsProc    = 112;
  699.  
  700. {——————————————————————————————————————————————————————————————————————————————————————}
  701. {    • TABS (CDEF 8)                                                                        }
  702. {——————————————————————————————————————————————————————————————————————————————————————}
  703. {    Tabs use an auxiliary resource (tab#) to hold tab information such as the tab name    }
  704. {    and an icon suite ID for each tab.                                                    }
  705. {                                                                                        }
  706. {    The ID of the tab# resource that you wish to associate with a tab control should     }
  707. {    be passed in as the Value parameter of the control. If you are using GetNewControl, }
  708. {    then the Value slot in the CNTL resource should have the ID of the 'tab#' resource    }
  709. {    on creation.                                                                        }
  710. {                                                                                        }
  711. {    Passing zero in for the tab# resource tells the control not to read in a tab# res.    }
  712. {    You can then use SetControlMaximum to add tabs, followed by a call to SetControlData}
  713. {    with the kControlTabInfoTag, passing in a pointer to a ControlTabInfoRec. This sets    }
  714. {     the name and optionally an icon for a tab.                                            }
  715.                                                                 {  Tabs proc IDs  }
  716.     kControlTabLargeProc        = 128;                            {  Large tab size, north facing     }
  717.     kControlTabSmallProc        = 129;                            {  Small tab size, north facing     }
  718.     kControlTabLargeNorthProc    = 128;                            {  Large tab size, north facing     }
  719.     kControlTabSmallNorthProc    = 129;                            {  Small tab size, north facing     }
  720.     kControlTabLargeSouthProc    = 130;                            {  Large tab size, south facing     }
  721.     kControlTabSmallSouthProc    = 131;                            {  Small tab size, south facing     }
  722.     kControlTabLargeEastProc    = 132;                            {  Large tab size, east facing     }
  723.     kControlTabSmallEastProc    = 133;                            {  Small tab size, east facing     }
  724.     kControlTabLargeWestProc    = 134;                            {  Large tab size, west facing     }
  725.     kControlTabSmallWestProc    = 135;                            {  Small tab size, west facing     }
  726.  
  727.                                                                 {  Tagged data supported by progress bars  }
  728.     kControlTabContentRectTag    = 'rect';                        {  Rect }
  729.     kControlTabEnabledFlagTag    = 'enab';                        {  Boolean }
  730.     kControlTabFontStyleTag        = 'font';                        {  ControlFontStyleRec }
  731.  
  732. { New tags in 1.0.1 or later }
  733.     kControlTabInfoTag            = 'tabi';                        {  ControlTabInfoRec }
  734.  
  735.     kControlTabInfoVersionZero    = 0;
  736.  
  737.  
  738. TYPE
  739.     ControlTabInfoRecPtr = ^ControlTabInfoRec;
  740.     ControlTabInfoRec = RECORD
  741.         version:                SInt16;                                    {  version of this structure. }
  742.         iconSuiteID:            SInt16;                                    {  icon suite to use. Zero indicates no icon }
  743.         name:                    Str255;                                    {  name to be displayed on the tab }
  744.     END;
  745.  
  746. {——————————————————————————————————————————————————————————————————————————————————————}
  747. {    • VISUAL SEPARATOR (CDEF 9)                                                            }
  748. {——————————————————————————————————————————————————————————————————————————————————————}
  749. {    Separator lines determine their orientation (horizontal or vertical) automatically    }
  750. {    based on the relative height and width of their contrlRect.                            }
  751.  
  752. CONST
  753.                                                                 {  Visual separator proc IDs  }
  754.     kControlSeparatorLineProc    = 144;
  755.  
  756.  
  757. {——————————————————————————————————————————————————————————————————————————————————————}
  758. {    • GROUP BOX (CDEF 10)                                                                }
  759. {——————————————————————————————————————————————————————————————————————————————————————}
  760. {    The group box CDEF can be use in several ways. It can have no title, a text title,     }
  761. {    a check box as the title, or a popup button as a title. There are two versions of     }
  762. {    group boxes, primary and secondary, which look slightly different.                    }
  763.                                                                 {  Group Box proc IDs  }
  764.     kControlGroupBoxTextTitleProc = 160;
  765.     kControlGroupBoxCheckBoxProc = 161;
  766.     kControlGroupBoxPopupButtonProc = 162;
  767.     kControlGroupBoxSecondaryTextTitleProc = 164;
  768.     kControlGroupBoxSecondaryCheckBoxProc = 165;
  769.     kControlGroupBoxSecondaryPopupButtonProc = 166;
  770.  
  771.                                                                 {  Tagged data supported by group box  }
  772.     kControlGroupBoxMenuHandleTag = 'mhan';                        {  MenuHandle (popup title only) }
  773.     kControlGroupBoxFontStyleTag = 'font';                        {  ControlFontStyleRec }
  774.  
  775. {——————————————————————————————————————————————————————————————————————————————————————}
  776. {    • IMAGE WELL (CDEF 11)                                                                }
  777. {——————————————————————————————————————————————————————————————————————————————————————}
  778. {    Image Wells allow you to control the content type (pict/icon/etc.) shown in the     }
  779. {    well.                                                                                }
  780. {                                                                                        }
  781. {    This is made possible by overloading the Min and Value parameters for the control.    }
  782. {                                                                                        }
  783. {    Parameter                    What Goes Here                                            }
  784. {    ———————————————————            ——————————————————————————————————————————————————        }
  785. {    Min                            content type (see constants for bevel buttons)            }
  786. {    Value                        Resource ID of content type, if resource-based.            }
  787. {                                                                                        }
  788. {                                                                                        }
  789. {    Handle-based Content                                                                }
  790. {    ————————————————————                                                                }
  791. {    You can create your control and then set the content to an existing handle to an    }
  792. {    icon suite, etc. using the macros below. Please keep in mind that resource-based    }
  793. {    content is owned by the control, handle-based content is owned by you. The CDEF will}
  794. {    not try to dispose of handle-based content. If you are changing the content type of    }
  795. {    the button on the fly, you must make sure that if you are replacing a handle-        }
  796. {    based content with a resource-based content to properly dispose of the handle,        }
  797. {    else a memory leak will ensue.                                                        }
  798. {                                                                                        }
  799.                                                                 {  Image Well proc IDs  }
  800.     kControlImageWellProc        = 176;
  801.  
  802.                                                                 {  Tagged data supported by image wells  }
  803.     kControlImageWellContentTag    = 'cont';                        {  ButtonContentInfo }
  804.     kControlImageWellTransformTag = 'tran';                        {  IconTransformType }
  805.  
  806. {——————————————————————————————————————————————————————————————————————————————————————}
  807. {    • POPUP ARROW (CDEF 12)                                                                }
  808. {——————————————————————————————————————————————————————————————————————————————————————}
  809. {    The popup arrow CDEF is used to draw the small arrow normally associated with a     }
  810. {    popup control. The arrow can point in four directions, and a small or large version }
  811. {    can be used. This control is provided to allow clients to draw the arrow in a         }
  812. {    normalized fashion which will take advantage of themes automatically.                }
  813. {                                                                                        }
  814.                                                                 {  Popup Arrow proc IDs  }
  815.     kControlPopupArrowEastProc    = 192;
  816.     kControlPopupArrowWestProc    = 193;
  817.     kControlPopupArrowNorthProc    = 194;
  818.     kControlPopupArrowSouthProc    = 195;
  819.     kControlPopupArrowSmallEastProc = 196;
  820.     kControlPopupArrowSmallWestProc = 197;
  821.     kControlPopupArrowSmallNorthProc = 198;
  822.     kControlPopupArrowSmallSouthProc = 199;
  823.  
  824. {——————————————————————————————————————————————————————————————————————————————————————}
  825. {    • PLACARD (CDEF 14)                                                                    }
  826. {——————————————————————————————————————————————————————————————————————————————————————}
  827.                                                                 {  Placard proc IDs  }
  828.     kControlPlacardProc            = 224;
  829.  
  830. {——————————————————————————————————————————————————————————————————————————————————————}
  831. {    • CLOCK (CDEF 15)                                                                    }
  832. {——————————————————————————————————————————————————————————————————————————————————————}
  833. {     NOTE:    You can specify more options in the Value paramter when creating the clock.    }
  834. {            See below.                                                                    }
  835.                                                                 {  Clock proc IDs  }
  836.     kControlClockTimeProc        = 240;
  837.     kControlClockTimeSecondsProc = 241;
  838.     kControlClockDateProc        = 242;
  839.     kControlClockMonthYearProc    = 243;
  840.  
  841. {——————————————————————————————————————————————————————————————————————————————————————}
  842. {     These flags can be passed into 'value' field on creation of the control.            }
  843. {     Value is set to 0 after control is created.                                            }
  844. {                                                                                        }
  845. {    The kClockIsLive value tells the clock to automatically update on idle (clock will    }
  846. {    have the current time). This flag is only valid when the kClockIsDisplayOnly flag    }
  847. {    is set.                                                                                }
  848. {——————————————————————————————————————————————————————————————————————————————————————}
  849.     kControlClockNoFlags        = 0;
  850.     kControlClockIsDisplayOnly    = 1;
  851.     kControlClockIsLive            = 2;
  852.  
  853.                                                                 {  Tagged data supported by clocks  }
  854.     kControlClockLongDateTag    = 'date';                        {  LongDateRec }
  855.     kControlClockFontStyleTag    = 'font';                        {  ControlFontStyleRec }
  856.  
  857. {——————————————————————————————————————————————————————————————————————————————————————}
  858. {    • USER PANE (CDEF 16)                                                                }
  859. {——————————————————————————————————————————————————————————————————————————————————————}
  860.                                                                 {  User Pane proc IDs  }
  861.     kControlUserPaneProc        = 256;
  862.  
  863. { Tagged data supported by user panes }
  864. { Currently, they are all proc ptrs for doing things like drawing and hit testing, etc. }
  865.     kControlUserItemDrawProcTag    = 'uidp';                        {  UserItemUPP }
  866.     kControlUserPaneDrawProcTag    = 'draw';                        {  ControlUserPaneDrawingUPP }
  867.     kControlUserPaneHitTestProcTag = 'hitt';                    {  ControlUserPaneHitTestUPP }
  868.     kControlUserPaneTrackingProcTag = 'trak';                    {  ControlUserPaneTrackingUPP }
  869.     kControlUserPaneIdleProcTag    = 'idle';                        {  ControlUserPaneIdleUPP }
  870.     kControlUserPaneKeyDownProcTag = 'keyd';                    {  ControlUserPaneKeyDownUPP }
  871.     kControlUserPaneActivateProcTag = 'acti';                    {  ControlUserPaneActivateUPP }
  872.     kControlUserPaneFocusProcTag = 'foci';                        {  ControlUserPaneFocusUPP }
  873.     kControlUserPaneBackgroundProcTag = 'back';                    {  ControlUserPaneBackgroundUPP }
  874.  
  875.  
  876. TYPE
  877.     ControlUserPaneDrawProcPtr = ProcPtr;  { PROCEDURE ControlUserPaneDraw(control: ControlHandle; part: SInt16); }
  878.  
  879.     ControlUserPaneHitTestProcPtr = ProcPtr;  { FUNCTION ControlUserPaneHitTest(control: ControlHandle; where: Point): ControlPartCode; }
  880.  
  881.     ControlUserPaneTrackingProcPtr = ProcPtr;  { FUNCTION ControlUserPaneTracking(control: ControlHandle; startPt: Point; actionProc: ControlActionUPP): ControlPartCode; }
  882.  
  883.     ControlUserPaneIdleProcPtr = ProcPtr;  { PROCEDURE ControlUserPaneIdle(control: ControlHandle); }
  884.  
  885.     ControlUserPaneKeyDownProcPtr = ProcPtr;  { FUNCTION ControlUserPaneKeyDown(control: ControlHandle; keyCode: SInt16; charCode: SInt16; modifiers: SInt16): ControlPartCode; }
  886.  
  887.     ControlUserPaneActivateProcPtr = ProcPtr;  { PROCEDURE ControlUserPaneActivate(control: ControlHandle; activating: BOOLEAN); }
  888.  
  889.     ControlUserPaneFocusProcPtr = ProcPtr;  { FUNCTION ControlUserPaneFocus(control: ControlHandle; action: ControlFocusPart): ControlPartCode; }
  890.  
  891.     ControlUserPaneBackgroundProcPtr = ProcPtr;  { PROCEDURE ControlUserPaneBackground(control: ControlHandle; info: ControlBackgroundPtr); }
  892.  
  893.     ControlUserPaneDrawUPP = UniversalProcPtr;
  894.     ControlUserPaneHitTestUPP = UniversalProcPtr;
  895.     ControlUserPaneTrackingUPP = UniversalProcPtr;
  896.     ControlUserPaneIdleUPP = UniversalProcPtr;
  897.     ControlUserPaneKeyDownUPP = UniversalProcPtr;
  898.     ControlUserPaneActivateUPP = UniversalProcPtr;
  899.     ControlUserPaneFocusUPP = UniversalProcPtr;
  900.     ControlUserPaneBackgroundUPP = UniversalProcPtr;
  901.  
  902. CONST
  903.     uppControlUserPaneDrawProcInfo = $000002C0;
  904.     uppControlUserPaneHitTestProcInfo = $000003E0;
  905.     uppControlUserPaneTrackingProcInfo = $00000FE0;
  906.     uppControlUserPaneIdleProcInfo = $000000C0;
  907.     uppControlUserPaneKeyDownProcInfo = $00002AE0;
  908.     uppControlUserPaneActivateProcInfo = $000001C0;
  909.     uppControlUserPaneFocusProcInfo = $000002E0;
  910.     uppControlUserPaneBackgroundProcInfo = $000003C0;
  911.  
  912. FUNCTION NewControlUserPaneDrawProc(userRoutine: ControlUserPaneDrawProcPtr): ControlUserPaneDrawUPP;
  913.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  914.     INLINE $2E9F;
  915.     {$ENDC}
  916.  
  917. FUNCTION NewControlUserPaneHitTestProc(userRoutine: ControlUserPaneHitTestProcPtr): ControlUserPaneHitTestUPP;
  918.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  919.     INLINE $2E9F;
  920.     {$ENDC}
  921.  
  922. FUNCTION NewControlUserPaneTrackingProc(userRoutine: ControlUserPaneTrackingProcPtr): ControlUserPaneTrackingUPP;
  923.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  924.     INLINE $2E9F;
  925.     {$ENDC}
  926.  
  927. FUNCTION NewControlUserPaneIdleProc(userRoutine: ControlUserPaneIdleProcPtr): ControlUserPaneIdleUPP;
  928.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  929.     INLINE $2E9F;
  930.     {$ENDC}
  931.  
  932. FUNCTION NewControlUserPaneKeyDownProc(userRoutine: ControlUserPaneKeyDownProcPtr): ControlUserPaneKeyDownUPP;
  933.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  934.     INLINE $2E9F;
  935.     {$ENDC}
  936.  
  937. FUNCTION NewControlUserPaneActivateProc(userRoutine: ControlUserPaneActivateProcPtr): ControlUserPaneActivateUPP;
  938.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  939.     INLINE $2E9F;
  940.     {$ENDC}
  941.  
  942. FUNCTION NewControlUserPaneFocusProc(userRoutine: ControlUserPaneFocusProcPtr): ControlUserPaneFocusUPP;
  943.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  944.     INLINE $2E9F;
  945.     {$ENDC}
  946.  
  947. FUNCTION NewControlUserPaneBackgroundProc(userRoutine: ControlUserPaneBackgroundProcPtr): ControlUserPaneBackgroundUPP;
  948.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  949.     INLINE $2E9F;
  950.     {$ENDC}
  951.  
  952. PROCEDURE CallControlUserPaneDrawProc(control: ControlHandle; part: SInt16; userRoutine: ControlUserPaneDrawUPP);
  953.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  954.     INLINE $205F, $4E90;
  955.     {$ENDC}
  956.  
  957. FUNCTION CallControlUserPaneHitTestProc(control: ControlHandle; where: Point; userRoutine: ControlUserPaneHitTestUPP): ControlPartCode;
  958.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  959.     INLINE $205F, $4E90;
  960.     {$ENDC}
  961.  
  962. FUNCTION CallControlUserPaneTrackingProc(control: ControlHandle; startPt: Point; actionProc: ControlActionUPP; userRoutine: ControlUserPaneTrackingUPP): ControlPartCode;
  963.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  964.     INLINE $205F, $4E90;
  965.     {$ENDC}
  966.  
  967. PROCEDURE CallControlUserPaneIdleProc(control: ControlHandle; userRoutine: ControlUserPaneIdleUPP);
  968.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  969.     INLINE $205F, $4E90;
  970.     {$ENDC}
  971.  
  972. FUNCTION CallControlUserPaneKeyDownProc(control: ControlHandle; keyCode: SInt16; charCode: SInt16; modifiers: SInt16; userRoutine: ControlUserPaneKeyDownUPP): ControlPartCode;
  973.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  974.     INLINE $205F, $4E90;
  975.     {$ENDC}
  976.  
  977. PROCEDURE CallControlUserPaneActivateProc(control: ControlHandle; activating: BOOLEAN; userRoutine: ControlUserPaneActivateUPP);
  978.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  979.     INLINE $205F, $4E90;
  980.     {$ENDC}
  981.  
  982. FUNCTION CallControlUserPaneFocusProc(control: ControlHandle; action: ControlFocusPart; userRoutine: ControlUserPaneFocusUPP): ControlPartCode;
  983.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  984.     INLINE $205F, $4E90;
  985.     {$ENDC}
  986.  
  987. PROCEDURE CallControlUserPaneBackgroundProc(control: ControlHandle; info: ControlBackgroundPtr; userRoutine: ControlUserPaneBackgroundUPP);
  988.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  989.     INLINE $205F, $4E90;
  990.     {$ENDC}
  991. {
  992.   ——————————————————————————————————————————————————————————————————————————————————————————
  993.       • EDIT TEXT (CDEF 17)
  994.   ——————————————————————————————————————————————————————————————————————————————————————————
  995. }
  996.  
  997. CONST
  998.                                                                 {  Edit Text proc IDs  }
  999.     kControlEditTextProc        = 272;
  1000.     kControlEditTextDialogProc    = 273;
  1001.     kControlEditTextPasswordProc = 274;
  1002.     kControlEditTextDialogPasswordProc = 275;
  1003.  
  1004.                                                                 {  Tagged data supported by edit text  }
  1005.     kControlEditTextStyleTag    = 'font';                        {  ControlFontStyleRec }
  1006.     kControlEditTextTextTag        = 'text';                        {  Buffer of chars - you supply the buffer }
  1007.     kControlEditTextTEHandleTag    = 'than';                        {  The TEHandle of the text edit record }
  1008.     kControlEditTextKeyFilterTag = 'fltr';
  1009.     kControlEditTextSelectionTag = 'sele';                        {  EditTextSelectionRec }
  1010.     kControlEditTextPasswordTag    = 'pass';                        {  The clear text password text }
  1011.  
  1012.  
  1013. TYPE
  1014.     ControlEditTextSelectionRecPtr = ^ControlEditTextSelectionRec;
  1015.     ControlEditTextSelectionRec = RECORD
  1016.                                                                         {  Structure for getting the edit text selection  }
  1017.         selStart:                SInt16;
  1018.         selEnd:                    SInt16;
  1019.     END;
  1020.  
  1021.     ControlEditTextSelectionPtr            = ^ControlEditTextSelectionRec;
  1022. {——————————————————————————————————————————————————————————————————————————————————————}
  1023. {    • STATIC TEXT (CDEF 18)                                                                }
  1024. {——————————————————————————————————————————————————————————————————————————————————————}
  1025. { Static Text proc IDs }
  1026.  
  1027. CONST
  1028.     kControlStaticTextProc        = 288;
  1029.  
  1030. { Tagged data supported by static text }
  1031.     kControlStaticTextStyleTag    = 'font';                        {  ControlFontStyleRec }
  1032.     kControlStaticTextTextTag    = 'text';                        {  Copy of text }
  1033.     kControlStaticTextTextHeightTag = 'thei';                    {  SInt16 }
  1034.  
  1035. {——————————————————————————————————————————————————————————————————————————————————————}
  1036. {    • PICTURE CONTROL (CDEF 19)                                                            }
  1037. {——————————————————————————————————————————————————————————————————————————————————————}
  1038. {    Value parameter should contain the ID of the picture you wish to display when        }
  1039. {    creating controls of this type. If you don't want the control tracked at all, use     }
  1040. {    the 'no track' variant.                                                                }
  1041.                                                                 {  Picture control proc IDs  }
  1042.     kControlPictureProc            = 304;
  1043.     kControlPictureNoTrackProc    = 305;                            {  immediately returns kControlPicturePart }
  1044.  
  1045. {——————————————————————————————————————————————————————————————————————————————————————}
  1046. {    • ICON CONTROL (CDEF 20)                                                            }
  1047. {——————————————————————————————————————————————————————————————————————————————————————}
  1048. {    Value parameter should contain the ID of the ICON or cicn you wish to display when    }
  1049. {    creating controls of this type. If you don't want the control tracked at all, use     }
  1050. {    the 'no track' variant.                                                                }
  1051. { Icon control proc IDs }
  1052.     kControlIconProc            = 320;
  1053.     kControlIconNoTrackProc        = 321;                            {  immediately returns kControlIconPart }
  1054.     kControlIconSuiteProc        = 322;
  1055.     kControlIconSuiteNoTrackProc = 323;                            {  immediately returns kControlIconPart }
  1056.  
  1057. { Tagged data supported by icon controls }
  1058.     kControlIconTransformTag    = 'trfm';                        {  IconTransformType }
  1059.     kControlIconAlignmentTag    = 'algn';                        {  IconAlignmentType }
  1060.  
  1061. {——————————————————————————————————————————————————————————————————————————————————————}
  1062. {    • WINDOW HEADER (CDEF 21)                                                            }
  1063. {——————————————————————————————————————————————————————————————————————————————————————}
  1064.                                                                 {  Window Header proc IDs  }
  1065.     kControlWindowHeaderProc    = 336;                            {  normal header }
  1066.     kControlWindowListViewHeaderProc = 337;                        {  variant for list views - no bottom line }
  1067.  
  1068. {——————————————————————————————————————————————————————————————————————————————————————}
  1069. {    • LIST BOX (CDEF 22)                                                                }
  1070. {——————————————————————————————————————————————————————————————————————————————————————}
  1071. {    Lists use an auxiliary resource to define their format. The resource type used is     }
  1072. {    'ldes' and a definition for it can be found in Appearance.r. The resource ID for     }
  1073. {    the ldes is passed in the 'value' parameter when creating the control. You may pass }
  1074. {    zero in value. This tells the List Box control to not use a resource. The list will }
  1075. {    be created with default values, and will use the standard LDEF (0). You can change    }
  1076. {    the list by getting the list handle. You can set the LDEF to use by using the tag    }
  1077. {    below (kControlListBoxLDEFTag)                                                        }
  1078.                                                                 {  List Box proc IDs  }
  1079.     kControlListBoxProc            = 352;
  1080.     kControlListBoxAutoSizeProc    = 353;
  1081.  
  1082.                                                                 {  Tagged data supported by list box  }
  1083.     kControlListBoxListHandleTag = 'lhan';                        {  ListHandle }
  1084.     kControlListBoxKeyFilterTag    = 'fltr';                        {  ControlKeyFilterUPP }
  1085.     kControlListBoxFontStyleTag    = 'font';                        {  ControlFontStyleRec }
  1086.  
  1087. { New tags in 1.0.1 or later }
  1088.     kControlListBoxDoubleClickTag = 'dblc';                        {  Boolean. Was last click a double-click? }
  1089.     kControlListBoxLDEFTag        = 'ldef';                        {  SInt16. ID of LDEF to use.  }
  1090.  
  1091. {——————————————————————————————————————————————————————————————————————————————————————}
  1092. {    • PUSH BUTTON (CDEF 23)                                                                }
  1093. {——————————————————————————————————————————————————————————————————————————————————————}
  1094. {    The new standard checkbox and radio button controls support a "mixed" value that    }
  1095. {    indicates that the current setting contains a mixed set of on and off values. The     }
  1096. {    control value used to display this indication is defined in Controls.h:                }
  1097. {                                                                                        }
  1098. {        kControlCheckBoxMixedValue = 2                                                    }
  1099. {                                                                                        }
  1100. {    Two new variants of the standard pushbutton have been added to the standard control    }
  1101. {    suite that draw a color icon next to the control title. One variant draws the icon    }
  1102. {    on the left side, the other draws it on the right side (when the system justifica-    }
  1103. {    tion is right to left, these are reversed).                                            }
  1104. {                                                                                        }
  1105. {    When either of the icon pushbuttons are created, the contrlMax field of the control }
  1106. {    record is used to determine the ID of the 'cicn' resource drawn in the pushbutton.    }
  1107. {                                                                                        }
  1108. {    In addition, a push button can now be told to draw with a default outline using the    }
  1109. {    SetControlData routine with the kPushButtonDefaultTag below.                        }
  1110. {                                                                                        }
  1111.                                                                 {  Theme Push Button/Check Box/Radio Button proc IDs  }
  1112.     kControlPushButtonProc        = 368;
  1113.     kControlCheckBoxProc        = 369;
  1114.     kControlRadioButtonProc        = 370;
  1115.     kControlPushButLeftIconProc    = 374;                            {  Standard pushbutton with left-side icon }
  1116.     kControlPushButRightIconProc = 375;                            {  Standard pushbutton with right-side icon }
  1117.  
  1118.                                                                 {  Tagged data supported by standard buttons  }
  1119.     kControlPushButtonDefaultTag = 'dflt';                        {  default ring flag }
  1120.  
  1121. {——————————————————————————————————————————————————————————————————————————————————————}
  1122. {    • SCROLL BAR (CDEF 24)                                                                }
  1123. {——————————————————————————————————————————————————————————————————————————————————————}
  1124. {    This is the new Appearance scroll bar.                                                }
  1125. {                                                                                        }
  1126.                                                                 {  Theme Scroll Bar proc IDs  }
  1127.     kControlScrollBarProc        = 384;                            {  normal scroll bar }
  1128.     kControlScrollBarLiveProc    = 386;                            {  live scrolling variant }
  1129.  
  1130. {——————————————————————————————————————————————————————————————————————————————————————}
  1131. {    • POPUP BUTTON (CDEF 25)                                                            }
  1132. {——————————————————————————————————————————————————————————————————————————————————————}
  1133. {    This is the new Appearance Popup Button. It takes the same variants and does the     }
  1134. {    same overloading as the previous popup menu control. There are some differences:    }
  1135. {                                                                                        }
  1136. {    Passing in a menu ID of -12345 causes the popup not to try and get the menu from a    }
  1137. {    resource. Instead, you can build the menu and later stuff the menuhandle field in     }
  1138. {    the popup data information.                                                            }
  1139. {                                                                                        }
  1140. {    You can pass -1 in the Max parameter to have the control calculate the width of the    }
  1141. {    title on its own instead of guessing and then tweaking to get it right. It adds the    }
  1142. {    appropriate amount of space between the title and the popup.                        }
  1143. {                                                                                        }
  1144.                                                                 {  Theme Popup Button proc IDs  }
  1145.     kControlPopupButtonProc        = 400;
  1146.     kControlPopupFixedWidthVariant = $01;
  1147.     kControlPopupVariableWidthVariant = $02;
  1148.     kControlPopupUseAddResMenuVariant = $04;
  1149.     kControlPopupUseWFontVariant = $08;                            {  kControlUsesOwningWindowsFontVariant }
  1150.  
  1151. { These tags are available in 1.0.1 or later of Appearance }
  1152.     kControlPopupButtonMenuHandleTag = 'mhan';                    {  MenuHandle }
  1153.     kControlPopupButtonMenuIDTag = 'mnid';                        {  SInt16 }
  1154.  
  1155. {——————————————————————————————————————————————————————————————————————————————————————}
  1156. {    • RADIO GROUP (CDEF 26)                                                                }
  1157. {——————————————————————————————————————————————————————————————————————————————————————}
  1158. {    This control implements a radio group. It is an embedding control and can therefore    }
  1159. {     only be used when a control hierarchy is established for its owning window. You        }
  1160. {    should only embed radio buttons within it. As radio buttons are embedded into it,    }
  1161. {    the group sets up its value, min, and max to represent the number of embedded items.}
  1162. {    The current value of the control is the index of the sub-control that is the current}
  1163. {    'on' radio button. To get the current radio button control handle, you can use the    }
  1164. {    control manager call GetIndSubControl, passing in the value of the radio group.        }
  1165. {                                                                                        }
  1166. {    NOTE: This control is only available with Appearance 1.0.1.                            }
  1167.     kControlRadioGroupProc        = 416;
  1168.  
  1169.  
  1170. {   —— end of stuff only available with Appearance 1.0 and later }
  1171.  
  1172.  
  1173. {——————————————————————————————————————————————————————————————————————————————————————}
  1174. {    • Control Variants                                                                    }
  1175. {——————————————————————————————————————————————————————————————————————————————————————}
  1176.  
  1177. TYPE
  1178.     ControlVariant                        = SInt16;
  1179.  
  1180. CONST
  1181.     kControlNoVariant            = 0;                            {  No variant }
  1182.     kControlUsesOwningWindowsFontVariant = $08;                    {  Control uses owning windows font to display text }
  1183.  
  1184. {——————————————————————————————————————————————————————————————————————————————————————}
  1185. {    • Control Part Codes                                                                }
  1186. {——————————————————————————————————————————————————————————————————————————————————————}
  1187.     kControlNoPart                = 0;
  1188.     kControlLabelPart            = 1;
  1189.     kControlMenuPart            = 2;
  1190.     kControlTrianglePart        = 4;
  1191.     kControlEditTextPart        = 5;                            {  Appearance 1.0 and later }
  1192.     kControlPicturePart            = 6;                            {  Appearance 1.0 and later }
  1193.     kControlIconPart            = 7;                            {  Appearance 1.0 and later }
  1194.     kControlClockPart            = 8;                            {  Appearance 1.0 and later }
  1195.     kControlListBoxPart            = 24;                            {  Appearance 1.0 and later }
  1196.     kControlListBoxDoubleClickPart = 25;                        {  Appearance 1.0 and later }
  1197.     kControlImageWellPart        = 26;                            {  Appearance 1.0 and later }
  1198.     kControlRadioGroupPart        = 27;                            {  Appearance 1.1 and later }
  1199.     kControlButtonPart            = 10;
  1200.     kControlCheckBoxPart        = 11;
  1201.     kControlRadioButtonPart        = 11;
  1202.     kControlUpButtonPart        = 20;
  1203.     kControlDownButtonPart        = 21;
  1204.     kControlPageUpPart            = 22;
  1205.     kControlPageDownPart        = 23;
  1206.     kControlIndicatorPart        = 129;
  1207.     kControlDisabledPart        = 254;
  1208.     kControlInactivePart        = 255;
  1209.  
  1210. {——————————————————————————————————————————————————————————————————————————————————————}
  1211. {    • Check Box Values                                                                    }
  1212. {——————————————————————————————————————————————————————————————————————————————————————}
  1213.     kControlCheckBoxUncheckedValue = 0;
  1214.     kControlCheckBoxCheckedValue = 1;
  1215.     kControlCheckBoxMixedValue    = 2;
  1216.  
  1217. {——————————————————————————————————————————————————————————————————————————————————————}
  1218. {    • Radio Button Values                                                                }
  1219. {——————————————————————————————————————————————————————————————————————————————————————}
  1220.     kControlRadioButtonUncheckedValue = 0;
  1221.     kControlRadioButtonCheckedValue = 1;
  1222.     kControlRadioButtonMixedValue = 2;
  1223.  
  1224. {——————————————————————————————————————————————————————————————————————————————————————}
  1225. {    • Pop-Up Menu Control Constants                                                        }
  1226. {——————————————————————————————————————————————————————————————————————————————————————}
  1227. {  Variant codes for the System 7 pop-up menu }
  1228.     popupFixedWidth                = $01;
  1229.     popupVariableWidth            = $02;
  1230.     popupUseAddResMenu            = $04;
  1231.     popupUseWFont                = $08;
  1232.  
  1233. {  Menu label styles for the System 7 pop-up menu  }
  1234.     popupTitleBold                = $0100;
  1235.     popupTitleItalic            = $0200;
  1236.     popupTitleUnderline            = $0400;
  1237.     popupTitleOutline            = $0800;
  1238.     popupTitleShadow            = $1000;
  1239.     popupTitleCondense            = $2000;
  1240.     popupTitleExtend            = $4000;
  1241.     popupTitleNoStyle            = $8000;
  1242.  
  1243. {  Menu label justifications for the System 7 pop-up menu }
  1244.     popupTitleLeftJust            = $00000000;
  1245.     popupTitleCenterJust        = $00000001;
  1246.     popupTitleRightJust            = $000000FF;
  1247.  
  1248. {——————————————————————————————————————————————————————————————————————————————————————}
  1249. {     • DragGrayRgn Constatns                                                                }
  1250. {                                                                                        }
  1251. {   For DragGrayRgnUPP used in TrackControl()                                             }
  1252. {——————————————————————————————————————————————————————————————————————————————————————}
  1253.     noConstraint                = 0;
  1254.     hAxisOnly                    = 1;
  1255.     vAxisOnly                    = 2;
  1256.  
  1257. {——————————————————————————————————————————————————————————————————————————————————————}
  1258. {    • Control Creation/Deletion                                                            }
  1259. {——————————————————————————————————————————————————————————————————————————————————————}
  1260. FUNCTION NewControl(owningWindow: WindowPtr; {CONST}VAR boundsRect: Rect; controlTitle: ConstStr255Param; initiallyVisible: BOOLEAN; initialValue: SInt16; minimumValue: SInt16; maximumValue: SInt16; procID: SInt16; controlReference: SInt32): ControlHandle;
  1261.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1262.     INLINE $A954;
  1263.     {$ENDC}
  1264. FUNCTION GetNewControl(resourceID: SInt16; owningWindow: WindowPtr): ControlHandle;
  1265.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1266.     INLINE $A9BE;
  1267.     {$ENDC}
  1268. PROCEDURE DisposeControl(theControl: ControlHandle);
  1269.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1270.     INLINE $A955;
  1271.     {$ENDC}
  1272. PROCEDURE KillControls(theWindow: WindowPtr);
  1273.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1274.     INLINE $A956;
  1275.     {$ENDC}
  1276. {——————————————————————————————————————————————————————————————————————————————————————}
  1277. {    • Control Visible State                                                                }
  1278. {——————————————————————————————————————————————————————————————————————————————————————}
  1279. PROCEDURE HiliteControl(theControl: ControlHandle; hiliteState: ControlPartCode);
  1280.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1281.     INLINE $A95D;
  1282.     {$ENDC}
  1283. PROCEDURE ShowControl(theControl: ControlHandle);
  1284.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1285.     INLINE $A957;
  1286.     {$ENDC}
  1287. PROCEDURE HideControl(theControl: ControlHandle);
  1288.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1289.     INLINE $A958;
  1290.     {$ENDC}
  1291.  
  1292. {  following state routines available only with Appearance 1.0 and later }
  1293. FUNCTION IsControlActive(inControl: ControlHandle): BOOLEAN;
  1294.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1295.     INLINE $303C, $0005, $AA73;
  1296.     {$ENDC}
  1297. FUNCTION IsControlVisible(inControl: ControlHandle): BOOLEAN;
  1298.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1299.     INLINE $303C, $0006, $AA73;
  1300.     {$ENDC}
  1301. FUNCTION ActivateControl(inControl: ControlHandle): OSErr;
  1302.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1303.     INLINE $303C, $0007, $AA73;
  1304.     {$ENDC}
  1305. FUNCTION DeactivateControl(inControl: ControlHandle): OSErr;
  1306.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1307.     INLINE $303C, $0008, $AA73;
  1308.     {$ENDC}
  1309. FUNCTION SetControlVisibility(inControl: ControlHandle; inIsVisible: BOOLEAN; inDoDraw: BOOLEAN): OSErr;
  1310.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1311.     INLINE $303C, $001E, $AA73;
  1312.     {$ENDC}
  1313.  
  1314. {——————————————————————————————————————————————————————————————————————————————————————}
  1315. {    • Control Imaging                                                                    }
  1316. {——————————————————————————————————————————————————————————————————————————————————————}
  1317. PROCEDURE DrawControls(theWindow: WindowPtr);
  1318.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1319.     INLINE $A969;
  1320.     {$ENDC}
  1321. PROCEDURE Draw1Control(theControl: ControlHandle);
  1322.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1323.     INLINE $A96D;
  1324.     {$ENDC}
  1325.  
  1326. PROCEDURE UpdateControls(theWindow: WindowPtr; updateRegion: RgnHandle);
  1327.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1328.     INLINE $A953;
  1329.     {$ENDC}
  1330.  
  1331. {  following imaging routines available only with Appearance 1.0 and later }
  1332. FUNCTION GetBestControlRect(inControl: ControlHandle; VAR outRect: Rect; VAR outBaseLineOffset: SInt16): OSErr;
  1333.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1334.     INLINE $303C, $001B, $AA73;
  1335.     {$ENDC}
  1336. FUNCTION SetControlFontStyle(inControl: ControlHandle; {CONST}VAR inStyle: ControlFontStyleRec): OSErr;
  1337.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1338.     INLINE $303C, $001C, $AA73;
  1339.     {$ENDC}
  1340. PROCEDURE DrawControlInCurrentPort(inControl: ControlHandle);
  1341.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1342.     INLINE $303C, $0018, $AA73;
  1343.     {$ENDC}
  1344. FUNCTION SetUpControlBackground(inControl: ControlHandle; inDepth: SInt16; inIsColorDevice: BOOLEAN): OSErr;
  1345.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1346.     INLINE $303C, $001D, $AA73;
  1347.     {$ENDC}
  1348.  
  1349. {——————————————————————————————————————————————————————————————————————————————————————}
  1350. {    • Control Mousing                                                                    }
  1351. {——————————————————————————————————————————————————————————————————————————————————————}
  1352. {
  1353.     NOTE ON CONTROL ACTION PROCS
  1354.     
  1355.     When using the TrackControl() call when tracking an indicator, the actionProc parameter
  1356.     (type ControlActionUPP) should be replaced by a parameter of type DragGrayRgnUPP
  1357.     (see Quickdraw.h).
  1358.     
  1359.     If, however, you are using the live feedback variants of scroll bars or sliders, you
  1360.     can pass a ControlActionUPP in when tracking the indicator as well. This functionality
  1361.     is available in Appearance 1.0 or later.
  1362. }
  1363. FUNCTION TrackControl(theControl: ControlHandle; startPoint: Point; actionProc: ControlActionUPP): ControlPartCode;
  1364.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1365.     INLINE $A968;
  1366.     {$ENDC}
  1367. PROCEDURE DragControl(theControl: ControlHandle; startPoint: Point; {CONST}VAR limitRect: Rect; {CONST}VAR slopRect: Rect; axis: DragConstraint);
  1368.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1369.     INLINE $A967;
  1370.     {$ENDC}
  1371. FUNCTION TestControl(theControl: ControlHandle; testPoint: Point): ControlPartCode;
  1372.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1373.     INLINE $A966;
  1374.     {$ENDC}
  1375. FUNCTION FindControl(testPoint: Point; theWindow: WindowPtr; VAR theControl: ControlHandle): ControlPartCode;
  1376.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1377.     INLINE $A96C;
  1378.     {$ENDC}
  1379. { The following mousing routines available only with Appearance 1.0 and later    }
  1380. {                                                                                }
  1381. { FindControlUnderMouse is preferrable to TrackControl when running under        }
  1382. { Appearance 1.0 as you can pass in modifiers, which some of the new controls    }
  1383. { use, such as edit text and list boxes.                                        }
  1384. FUNCTION FindControlUnderMouse(inWhere: Point; inWindow: WindowPtr; VAR outPart: SInt16): ControlHandle;
  1385.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1386.     INLINE $303C, $0009, $AA73;
  1387.     {$ENDC}
  1388. FUNCTION HandleControlClick(inControl: ControlHandle; inWhere: Point; inModifiers: SInt16; inAction: ControlActionUPP): SInt16;
  1389.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1390.     INLINE $303C, $000A, $AA73;
  1391.     {$ENDC}
  1392. { TrackControlRollover is available with Appearance 1.1 or later. Calling it    }
  1393. { tells the control manager to follow the mouse, sending mouse enter/exit/move }
  1394. { messages to any controls that want it for the window specified.                }
  1395. FUNCTION TrackControlRollover(window: WindowPtr): OSStatus;
  1396.  
  1397.  
  1398. {——————————————————————————————————————————————————————————————————————————————————————}
  1399. {    • Control Events (available only with Appearance 1.0 and later)                        }
  1400. {——————————————————————————————————————————————————————————————————————————————————————}
  1401. FUNCTION HandleControlKey(inControl: ControlHandle; inKeyCode: SInt16; inCharCode: SInt16; inModifiers: SInt16): SInt16;
  1402.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1403.     INLINE $303C, $000B, $AA73;
  1404.     {$ENDC}
  1405. PROCEDURE IdleControls(inWindow: WindowPtr);
  1406.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1407.     INLINE $303C, $000C, $AA73;
  1408.     {$ENDC}
  1409.  
  1410.  
  1411. {——————————————————————————————————————————————————————————————————————————————————————}
  1412. {    • Control Positioning                                                                }
  1413. {——————————————————————————————————————————————————————————————————————————————————————}
  1414. PROCEDURE MoveControl(theControl: ControlHandle; h: SInt16; v: SInt16);
  1415.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1416.     INLINE $A959;
  1417.     {$ENDC}
  1418. PROCEDURE SizeControl(theControl: ControlHandle; w: SInt16; h: SInt16);
  1419.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1420.     INLINE $A95C;
  1421.     {$ENDC}
  1422. {——————————————————————————————————————————————————————————————————————————————————————}
  1423. {    • Control Title                                                                        }
  1424. {——————————————————————————————————————————————————————————————————————————————————————}
  1425. PROCEDURE SetControlTitle(theControl: ControlHandle; title: ConstStr255Param);
  1426.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1427.     INLINE $A95F;
  1428.     {$ENDC}
  1429. PROCEDURE GetControlTitle(theControl: ControlHandle; VAR title: Str255);
  1430.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1431.     INLINE $A95E;
  1432.     {$ENDC}
  1433. {——————————————————————————————————————————————————————————————————————————————————————}
  1434. {    • Control Value                                                                        }
  1435. {——————————————————————————————————————————————————————————————————————————————————————}
  1436. FUNCTION GetControlValue(theControl: ControlHandle): SInt16;
  1437.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1438.     INLINE $A960;
  1439.     {$ENDC}
  1440. PROCEDURE SetControlValue(theControl: ControlHandle; newValue: SInt16);
  1441.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1442.     INLINE $A963;
  1443.     {$ENDC}
  1444. FUNCTION GetControlMinimum(theControl: ControlHandle): SInt16;
  1445.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1446.     INLINE $A961;
  1447.     {$ENDC}
  1448. PROCEDURE SetControlMinimum(theControl: ControlHandle; newMinimum: SInt16);
  1449.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1450.     INLINE $A964;
  1451.     {$ENDC}
  1452. FUNCTION GetControlMaximum(theControl: ControlHandle): SInt16;
  1453.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1454.     INLINE $A962;
  1455.     {$ENDC}
  1456. PROCEDURE SetControlMaximum(theControl: ControlHandle; newMaximum: SInt16);
  1457.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1458.     INLINE $A965;
  1459.     {$ENDC}
  1460. {——————————————————————————————————————————————————————————————————————————————————————}
  1461. {    • Control Variant                                                                    }
  1462. {——————————————————————————————————————————————————————————————————————————————————————}
  1463. FUNCTION GetControlVariant(theControl: ControlHandle): ControlVariant;
  1464.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1465.     INLINE $A809;
  1466.     {$ENDC}
  1467. {——————————————————————————————————————————————————————————————————————————————————————}
  1468. {    • Control Action                                                                    }
  1469. {——————————————————————————————————————————————————————————————————————————————————————}
  1470. PROCEDURE SetControlAction(theControl: ControlHandle; actionProc: ControlActionUPP);
  1471.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1472.     INLINE $A96B;
  1473.     {$ENDC}
  1474. FUNCTION GetControlAction(theControl: ControlHandle): ControlActionUPP;
  1475.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1476.     INLINE $A96A;
  1477.     {$ENDC}
  1478. {——————————————————————————————————————————————————————————————————————————————————————}
  1479. { • Control Accessors                                                                    }
  1480. {——————————————————————————————————————————————————————————————————————————————————————}
  1481. PROCEDURE SetControlReference(theControl: ControlHandle; data: SInt32);
  1482.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1483.     INLINE $A95B;
  1484.     {$ENDC}
  1485. FUNCTION GetControlReference(theControl: ControlHandle): SInt32;
  1486.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1487.     INLINE $A95A;
  1488.     {$ENDC}
  1489. FUNCTION GetAuxiliaryControlRecord(theControl: ControlHandle; VAR acHndl: AuxCtlHandle): BOOLEAN;
  1490.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1491.     INLINE $AA44;
  1492.     {$ENDC}
  1493. PROCEDURE SetControlColor(theControl: ControlHandle; newColorTable: CCTabHandle);
  1494.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1495.     INLINE $AA43;
  1496.     {$ENDC}
  1497. {——————————————————————————————————————————————————————————————————————————————————————}
  1498. {    • HELPERS (available only with Appearance 1.0 and later)                            }
  1499. {                                                                                        }
  1500. { These routines are available only thru the shared library/glue                        }
  1501. { Bevel button routines                                                                }
  1502. {——————————————————————————————————————————————————————————————————————————————————————}
  1503.  
  1504. FUNCTION GetBevelButtonMenuValue(inButton: ControlHandle; VAR outValue: SInt16): OSErr;
  1505. FUNCTION SetBevelButtonMenuValue(inButton: ControlHandle; inValue: SInt16): OSErr;
  1506. FUNCTION GetBevelButtonMenuHandle(inButton: ControlHandle; VAR outHandle: MenuHandle): OSErr;
  1507. FUNCTION GetBevelButtonContentInfo(inButton: ControlHandle; outContent: ControlButtonContentInfoPtr): OSErr;
  1508. FUNCTION SetBevelButtonContentInfo(inButton: ControlHandle; inContent: ControlButtonContentInfoPtr): OSErr;
  1509. FUNCTION SetBevelButtonTransform(inButton: ControlHandle; transform: IconTransformType): OSErr;
  1510. FUNCTION SetBevelButtonGraphicAlignment(inButton: ControlHandle; inAlign: ControlButtonGraphicAlignment; inHOffset: SInt16; inVOffset: SInt16): OSErr;
  1511. FUNCTION SetBevelButtonTextAlignment(inButton: ControlHandle; inAlign: ControlButtonTextAlignment; inHOffset: SInt16): OSErr;
  1512. FUNCTION SetBevelButtonTextPlacement(inButton: ControlHandle; inWhere: ControlButtonTextPlacement): OSErr;
  1513. {  Image well routines }
  1514.  
  1515. FUNCTION GetImageWellContentInfo(inButton: ControlHandle; outContent: ControlButtonContentInfoPtr): OSErr;
  1516. FUNCTION SetImageWellContentInfo(inButton: ControlHandle; inContent: ControlButtonContentInfoPtr): OSErr;
  1517. FUNCTION SetImageWellTransform(inButton: ControlHandle; inTransform: IconTransformType): OSErr;
  1518. {  Tab routines }
  1519.  
  1520. FUNCTION GetTabContentRect(inTabControl: ControlHandle; VAR outContentRect: Rect): OSErr;
  1521. FUNCTION SetTabEnabled(inTabControl: ControlHandle; inTabToHilite: SInt16; inEnabled: BOOLEAN): OSErr;
  1522. {  Disclosure triangles }
  1523.  
  1524. FUNCTION SetDisclosureTriangleLastValue(inTabControl: ControlHandle; inValue: SInt16): OSErr;
  1525. {——————————————————————————————————————————————————————————————————————————————————————}
  1526. {    • Control Hierarchy (Appearance 1.0 and later only)                                    }
  1527. {——————————————————————————————————————————————————————————————————————————————————————}
  1528. FUNCTION SendControlMessage(inControl: ControlHandle; inMessage: SInt16; inParam: SInt32): SInt32;
  1529.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1530.     INLINE $303C, $FFFE, $AA73;
  1531.     {$ENDC}
  1532. FUNCTION DumpControlHierarchy(inWindow: WindowPtr; {CONST}VAR inDumpFile: FSSpec): OSErr;
  1533.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1534.     INLINE $303C, $FFFF, $AA73;
  1535.     {$ENDC}
  1536. FUNCTION CreateRootControl(inWindow: WindowPtr; VAR outControl: ControlHandle): OSErr;
  1537.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1538.     INLINE $303C, $0001, $AA73;
  1539.     {$ENDC}
  1540. FUNCTION GetRootControl(inWindow: WindowPtr; VAR outControl: ControlHandle): OSErr;
  1541.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1542.     INLINE $303C, $0002, $AA73;
  1543.     {$ENDC}
  1544. FUNCTION EmbedControl(inControl: ControlHandle; inContainer: ControlHandle): OSErr;
  1545.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1546.     INLINE $303C, $0003, $AA73;
  1547.     {$ENDC}
  1548. FUNCTION AutoEmbedControl(inControl: ControlHandle; inWindow: WindowPtr): OSErr;
  1549.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1550.     INLINE $303C, $0004, $AA73;
  1551.     {$ENDC}
  1552. FUNCTION GetSuperControl(inControl: ControlHandle; VAR outParent: ControlHandle): OSErr;
  1553.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1554.     INLINE $303C, $0015, $AA73;
  1555.     {$ENDC}
  1556. FUNCTION CountSubControls(inControl: ControlHandle; VAR outNumChildren: SInt16): OSErr;
  1557.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1558.     INLINE $303C, $0016, $AA73;
  1559.     {$ENDC}
  1560. FUNCTION GetIndexedSubControl(inControl: ControlHandle; inIndex: SInt16; VAR outSubControl: ControlHandle): OSErr;
  1561.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1562.     INLINE $303C, $0017, $AA73;
  1563.     {$ENDC}
  1564. FUNCTION SetControlSupervisor(inControl: ControlHandle; inBoss: ControlHandle): OSErr;
  1565.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1566.     INLINE $303C, $001A, $AA73;
  1567.     {$ENDC}
  1568.  
  1569.  
  1570. {——————————————————————————————————————————————————————————————————————————————————————}
  1571. {    • Keyboard Focus (available only with Appearance 1.0 and later)                        }
  1572. {——————————————————————————————————————————————————————————————————————————————————————}
  1573. FUNCTION GetKeyboardFocus(inWindow: WindowPtr; VAR outControl: ControlHandle): OSErr;
  1574.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1575.     INLINE $303C, $000D, $AA73;
  1576.     {$ENDC}
  1577. FUNCTION SetKeyboardFocus(inWindow: WindowPtr; inControl: ControlHandle; inPart: ControlFocusPart): OSErr;
  1578.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1579.     INLINE $303C, $000E, $AA73;
  1580.     {$ENDC}
  1581. FUNCTION AdvanceKeyboardFocus(inWindow: WindowPtr): OSErr;
  1582.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1583.     INLINE $303C, $000F, $AA73;
  1584.     {$ENDC}
  1585. FUNCTION ReverseKeyboardFocus(inWindow: WindowPtr): OSErr;
  1586.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1587.     INLINE $303C, $0010, $AA73;
  1588.     {$ENDC}
  1589. FUNCTION ClearKeyboardFocus(inWindow: WindowPtr): OSErr;
  1590.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1591.     INLINE $303C, $0019, $AA73;
  1592.     {$ENDC}
  1593.  
  1594.  
  1595. {——————————————————————————————————————————————————————————————————————————————————————}
  1596. {    • Control Data (available only with Appearance 1.0 and later)                        }
  1597. {——————————————————————————————————————————————————————————————————————————————————————}
  1598.  
  1599. FUNCTION GetControlFeatures(inControl: ControlHandle; VAR outFeatures: UInt32): OSErr;
  1600.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1601.     INLINE $303C, $0011, $AA73;
  1602.     {$ENDC}
  1603. FUNCTION SetControlData(inControl: ControlHandle; inPart: ControlPartCode; inTagName: ResType; inSize: Size; inData: Ptr): OSErr;
  1604.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1605.     INLINE $303C, $0012, $AA73;
  1606.     {$ENDC}
  1607. FUNCTION GetControlData(inControl: ControlHandle; inPart: ControlPartCode; inTagName: ResType; inBufferSize: Size; inBuffer: Ptr; VAR outActualSize: Size): OSErr;
  1608.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1609.     INLINE $303C, $0013, $AA73;
  1610.     {$ENDC}
  1611. FUNCTION GetControlDataSize(inControl: ControlHandle; inPart: ControlPartCode; inTagName: ResType; VAR outMaxSize: Size): OSErr;
  1612.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1613.     INLINE $303C, $0014, $AA73;
  1614.     {$ENDC}
  1615.  
  1616.  
  1617.  
  1618. {——————————————————————————————————————————————————————————————————————————————————————}
  1619. {    • ‘CDEF’ messages                                                                    }
  1620. {——————————————————————————————————————————————————————————————————————————————————————}
  1621.  
  1622. TYPE
  1623.     ControlDefProcMessage                = SInt16;
  1624.  
  1625. CONST
  1626.     drawCntl                    = 0;
  1627.     testCntl                    = 1;
  1628.     calcCRgns                    = 2;
  1629.     initCntl                    = 3;
  1630.     dispCntl                    = 4;
  1631.     posCntl                        = 5;
  1632.     thumbCntl                    = 6;
  1633.     dragCntl                    = 7;
  1634.     autoTrack                    = 8;
  1635.     calcCntlRgn                    = 10;
  1636.     calcThumbRgn                = 11;
  1637.     drawThumbOutline            = 12;
  1638.  
  1639. {——————————————————————————————————————————————————————————————————————————————————————}
  1640. {    • ‘CDEF’ entrypoint                                                                    }
  1641. {——————————————————————————————————————————————————————————————————————————————————————}
  1642.  
  1643. TYPE
  1644.     ControlDefProcPtr = ProcPtr;  { FUNCTION ControlDef(varCode: SInt16; theControl: ControlHandle; message: ControlDefProcMessage; param: SInt32): SInt32; }
  1645.  
  1646.     ControlDefUPP = UniversalProcPtr;
  1647.  
  1648. CONST
  1649.     uppControlDefProcInfo = $00003BB0;
  1650.  
  1651. FUNCTION NewControlDefProc(userRoutine: ControlDefProcPtr): ControlDefUPP;
  1652.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1653.     INLINE $2E9F;
  1654.     {$ENDC}
  1655.  
  1656. FUNCTION CallControlDefProc(varCode: SInt16; theControl: ControlHandle; message: ControlDefProcMessage; param: SInt32; userRoutine: ControlDefUPP): SInt32;
  1657.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1658.     INLINE $205F, $4E90;
  1659.     {$ENDC}
  1660. {——————————————————————————————————————————————————————————————————————————————————————}
  1661. {    • Constants for drawCntl message (passed in param)                                    }
  1662. {——————————————————————————————————————————————————————————————————————————————————————}
  1663.  
  1664. CONST
  1665.     kDrawControlEntireControl    = 0;
  1666.     kDrawControlIndicatorOnly    = 129;
  1667.  
  1668. {——————————————————————————————————————————————————————————————————————————————————————}
  1669. {    • Constants for dragCntl message (passed in param)                                    }
  1670. {——————————————————————————————————————————————————————————————————————————————————————}
  1671.     kDragControlEntireControl    = 0;
  1672.     kDragControlIndicator        = 1;
  1673.  
  1674. {——————————————————————————————————————————————————————————————————————————————————————}
  1675. {    • Drag Constraint Structure for thumbCntl message (passed in param)                    }
  1676. {——————————————————————————————————————————————————————————————————————————————————————}
  1677.  
  1678. TYPE
  1679.     IndicatorDragConstraintPtr = ^IndicatorDragConstraint;
  1680.     IndicatorDragConstraint = RECORD
  1681.         limitRect:                Rect;
  1682.         slopRect:                Rect;
  1683.         axis:                    DragConstraint;
  1684.     END;
  1685.  
  1686.     IndicatorDragConstraintHandle        = ^IndicatorDragConstraintPtr;
  1687. {$IFC OLDROUTINENAMES }
  1688. {——————————————————————————————————————————————————————————————————————————————————————}
  1689. {    • OLDROUTINENAMES                                                                    }
  1690. {——————————————————————————————————————————————————————————————————————————————————————}
  1691. {  Variants applicable to all controls (at least ones with text) }
  1692.  
  1693. CONST
  1694.     useWFont                    = $08;
  1695.  
  1696.     inLabel                        = 1;
  1697.     inMenu                        = 2;
  1698.     inTriangle                    = 4;
  1699.     inButton                    = 10;
  1700.     inCheckBox                    = 11;
  1701.     inUpButton                    = 20;
  1702.     inDownButton                = 21;
  1703.     inPageUp                    = 22;
  1704.     inPageDown                    = 23;
  1705.     inThumb                        = 129;
  1706.  
  1707.     kNoHiliteControlPart        = 0;
  1708.     kInLabelControlPart            = 1;
  1709.     kInMenuControlPart            = 2;
  1710.     kInTriangleControlPart        = 4;
  1711.     kInButtonControlPart        = 10;
  1712.     kInCheckBoxControlPart        = 11;
  1713.     kInUpButtonControlPart        = 20;
  1714.     kInDownButtonControlPart    = 21;
  1715.     kInPageUpControlPart        = 22;
  1716.     kInPageDownControlPart        = 23;
  1717.     kInIndicatorControlPart        = 129;
  1718.     kReservedControlPart        = 254;
  1719.     kControlInactiveControlPart    = 255;
  1720.  
  1721. PROCEDURE SetCTitle(theControl: ControlHandle; title: Str255);
  1722.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1723.     INLINE $A95F;
  1724.     {$ENDC}
  1725. PROCEDURE GetCTitle(theControl: ControlHandle; VAR title: Str255);
  1726.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1727.     INLINE $A95E;
  1728.     {$ENDC}
  1729. PROCEDURE UpdtControl(theWindow: WindowPtr; updateRgn: RgnHandle);
  1730.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1731.     INLINE $A953;
  1732.     {$ENDC}
  1733. PROCEDURE SetCtlValue(theControl: ControlHandle; theValue: INTEGER);
  1734.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1735.     INLINE $A963;
  1736.     {$ENDC}
  1737. FUNCTION GetCtlValue(theControl: ControlHandle): INTEGER;
  1738.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1739.     INLINE $A960;
  1740.     {$ENDC}
  1741. PROCEDURE SetCtlMin(theControl: ControlHandle; minValue: INTEGER);
  1742.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1743.     INLINE $A964;
  1744.     {$ENDC}
  1745. FUNCTION GetCtlMin(theControl: ControlHandle): INTEGER;
  1746.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1747.     INLINE $A961;
  1748.     {$ENDC}
  1749. PROCEDURE SetCtlMax(theControl: ControlHandle; maxValue: INTEGER);
  1750.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1751.     INLINE $A965;
  1752.     {$ENDC}
  1753. FUNCTION GetCtlMax(theControl: ControlHandle): INTEGER;
  1754.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1755.     INLINE $A962;
  1756.     {$ENDC}
  1757. PROCEDURE SetCRefCon(theControl: ControlHandle; data: LONGINT);
  1758.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1759.     INLINE $A95B;
  1760.     {$ENDC}
  1761. FUNCTION GetCRefCon(theControl: ControlHandle): LONGINT;
  1762.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1763.     INLINE $A95A;
  1764.     {$ENDC}
  1765. PROCEDURE SetCtlAction(theControl: ControlHandle; actionProc: ControlActionUPP);
  1766.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1767.     INLINE $A96B;
  1768.     {$ENDC}
  1769. FUNCTION GetCtlAction(theControl: ControlHandle): ControlActionUPP;
  1770.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1771.     INLINE $A96A;
  1772.     {$ENDC}
  1773. PROCEDURE SetCtlColor(theControl: ControlHandle; newColorTable: CCTabHandle);
  1774.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1775.     INLINE $AA43;
  1776.     {$ENDC}
  1777. FUNCTION GetCVariant(theControl: ControlHandle): INTEGER;
  1778.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1779.     INLINE $A809;
  1780.     {$ENDC}
  1781. {$ENDC}  {OLDROUTINENAMES}
  1782.  
  1783.  
  1784.  
  1785.  
  1786. {$ALIGN RESET}
  1787. {$POP}
  1788.  
  1789. {$SETC UsingIncludes := ControlsIncludes}
  1790.  
  1791. {$ENDC} {__CONTROLS__}
  1792.  
  1793. {$IFC NOT UsingIncludes}
  1794.  END.
  1795. {$ENDC}
  1796.