Mac OS 9
Controls.h
Go to the documentation of this file.
1 
19 #ifndef __CONTROLS__
20 #define __CONTROLS__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #ifndef __QUICKDRAW__
27 #include <Quickdraw.h>
28 #endif
29 
30 #ifndef __MENUS__
31 #include <Menus.h>
32 #endif
33 
34 #ifndef __TEXTEDIT__
35 #include <TextEdit.h>
36 #endif
37 
38 #ifndef __DRAG__
39 #include <Drag.h>
40 #endif
41 
42 #ifndef __ICONS__
43 #include <Icons.h>
44 #endif
45 
46 #ifndef __COLLECTIONS__
47 #include <Collections.h>
48 #endif
49 
50 #ifndef __MACERRORS__
51 #include <MacErrors.h>
52 #endif
53 
54 #if PRAGMA_ONCE
55 #pragma once
56 #endif
57 
58 #ifdef __cplusplus
59 extern "C"
60 {
61 #endif
62 
63 #if PRAGMA_IMPORT
64 #pragma import on
65 #endif
66 
67 #if PRAGMA_STRUCT_ALIGN
68 #pragma options align = mac68k
69 #elif PRAGMA_STRUCT_PACKPUSH
70 #pragma pack(push, 2)
71 #elif PRAGMA_STRUCT_PACK
72 #pragma pack(2)
73 #endif
74 
75  /*������������������������������������������������������������������������������������������������������*/
76  /* � Resource Types */
77  /*������������������������������������������������������������������������������������������������������*/
78  enum
79  {
80  kControlDefProcType = FOUR_CHAR_CODE('CDEF'),
81  kControlTemplateResourceType = FOUR_CHAR_CODE('CNTL'),
82  kControlColorTableResourceType = FOUR_CHAR_CODE('cctb'),
83  kControlDefProcResourceType = FOUR_CHAR_CODE('CDEF')
84  };
85 
86  /*������������������������������������������������������������������������������������������������������*/
87  /* � Format of a �CNTL� resource */
88  /*������������������������������������������������������������������������������������������������������*/
90  {
91  Rect controlRect;
92  SInt16 controlValue;
93  Boolean controlVisible;
94  UInt8 fill;
95  SInt16 controlMaximum;
96  SInt16 controlMinimum;
97  SInt16 controlDefProcID;
98  SInt32 controlReference;
99  Str255 controlTitle;
100  };
101  typedef struct ControlTemplate ControlTemplate;
104 
105 #if !TARGET_OS_MAC
111  typedef UInt32 ControlNotification;
112  enum
113  {
114  controlNotifyNothing = FOUR_CHAR_CODE('nada'), /* No (null) notification*/
115  controlNotifyClick = FOUR_CHAR_CODE('clik'), /* Control was clicked*/
116  controlNotifyFocus = FOUR_CHAR_CODE('focu'), /* Control got keyboard focus*/
117  controlNotifyKey = FOUR_CHAR_CODE('key ') /* Control got a keypress*/
118  };
119 
120  typedef UInt32 ControlCapabilities;
121  enum
122  {
123  kControlCanAutoInvalidate =
124  1L << 0 /* Control component automatically invalidates areas left behind
125  after hide/move operation.*/
126  };
127 
128  /* procID's for our added "controls"*/
129  enum
130  {
131  staticTextProc = 256, /* static text*/
132  editTextProc = 272, /* editable text*/
133  iconProc = 288, /* icon*/
134  userItemProc = 304, /* user drawn item*/
135  pictItemProc = 320 /* pict*/
136  };
137 
138 #endif /* !TARGET_OS_MAC */
139 
140 /*������������������������������������������������������������������������������������������������������*/
141 /* � ControlRef */
142 /*������������������������������������������������������������������������������������������������������*/
143 #if !OPAQUE_TOOLBOX_STRUCTS
144  typedef struct ControlRecord ControlRecord;
145  typedef ControlRecord *ControlPtr;
146  typedef ControlPtr *ControlRef;
147 #else
148 typedef struct OpaqueControlRef *ControlRef;
149 #endif /* !OPAQUE_TOOLBOX_STRUCTS */
150 
151  /* ControlHandle is obsolete. Use ControlRef.*/
152  typedef ControlRef ControlHandle;
153  typedef SInt16 ControlPartCode;
154  /*������������������������������������������������������������������������������������������������������*/
155  /* � Control ActionProcPtr */
156  /*������������������������������������������������������������������������������������������������������*/
157  typedef CALLBACK_API(void, ControlActionProcPtr)(ControlRef theControl,
158  ControlPartCode partCode);
159  typedef STACK_UPP_TYPE(ControlActionProcPtr) ControlActionUPP;
160 /*������������������������������������������������������������������������������������������������������*/
161 /* � ControlRecord */
162 /*������������������������������������������������������������������������������������������������������*/
163 #if !OPAQUE_TOOLBOX_STRUCTS
165  {
166  ControlRef nextControl; /* in Carbon use embedding heirarchy functions*/
167  WindowRef contrlOwner; /* in Carbon use GetControlOwner or EmbedControl*/
168  Rect contrlRect; /* in Carbon use Get/SetControlBounds*/
169  UInt8 contrlVis; /* in Carbon use IsControlVisible, SetControlVisibility*/
170  UInt8 contrlHilite; /* in Carbon use GetControlHilite, HiliteControl*/
171  SInt16 contrlValue; /* in Carbon use Get/SetControlValue,
172  Get/SetControl32BitValue*/
173  SInt16 contrlMin; /* in Carbon use Get/SetControlMinimum,
174  Get/SetControl32BitMinimum*/
175  SInt16 contrlMax; /* in Carbon use Get/SetControlMaximum,
176  Get/SetControl32BitMaximum*/
177  Handle contrlDefProc; /* not supported in Carbon*/
178  Handle contrlData; /* in Carbon use Get/SetControlDataHandle*/
179  ControlActionUPP contrlAction; /* in Carbon use Get/SetControlAction*/
180  SInt32 contrlRfCon; /* in Carbon use Get/SetControlReference*/
181  Str255 contrlTitle; /* in Carbon use Get/SetControlTitle*/
182  };
183 
184 #endif /* !OPAQUE_TOOLBOX_STRUCTS */
185 
186  /*������������������������������������������������������������������������������������������������������*/
187  /* � Control ActionProcPtr : Epilogue */
188  /*������������������������������������������������������������������������������������������������������*/
197  ControlActionUPP
198  NewControlActionUPP(ControlActionProcPtr userRoutine);
199 #if !OPAQUE_UPP_TYPES
200  enum
201  {
202  uppControlActionProcInfo = 0x000002C0
203  }; /* pascal no_return_value Func(4_bytes, 2_bytes) */
204 #ifdef __cplusplus
205  inline ControlActionUPP NewControlActionUPP(ControlActionProcPtr userRoutine)
206  {
207  return (ControlActionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
208  uppControlActionProcInfo,
209  GetCurrentArchitecture());
210  }
211 #else
212 #define NewControlActionUPP(userRoutine) \
213  (ControlActionUPP) \
214  NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlActionProcInfo, \
215  GetCurrentArchitecture())
216 #endif
217 #endif
218 
227  void
228  DisposeControlActionUPP(ControlActionUPP userUPP);
229 #if !OPAQUE_UPP_TYPES
230 #ifdef __cplusplus
231  inline void DisposeControlActionUPP(ControlActionUPP userUPP)
232  {
233  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
234  }
235 #else
236 #define DisposeControlActionUPP(userUPP) DisposeRoutineDescriptor(userUPP)
237 #endif
238 #endif
239 
248  void
249  InvokeControlActionUPP(ControlRef theControl, ControlPartCode partCode,
250  ControlActionUPP userUPP);
251 #if !OPAQUE_UPP_TYPES
252 #ifdef __cplusplus
254  ControlPartCode partCode,
255  ControlActionUPP userUPP)
256  {
257  CALL_TWO_PARAMETER_UPP(userUPP, uppControlActionProcInfo, theControl,
258  partCode);
259  }
260 #else
261 #define InvokeControlActionUPP(theControl, partCode, userUPP) \
262  CALL_TWO_PARAMETER_UPP((userUPP), uppControlActionProcInfo, (theControl), \
263  (partCode))
264 #endif
265 #endif
266 
267 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
268 /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
269 #define NewControlActionProc(userRoutine) NewControlActionUPP(userRoutine)
270 #define CallControlActionProc(userRoutine, theControl, partCode) \
271  InvokeControlActionUPP(theControl, partCode, userRoutine)
272 #endif /* CALL_NOT_IN_CARBON */
273 
274  /*������������������������������������������������������������������������������������������������������*/
275  /* � Control Color Table */
276  /*������������������������������������������������������������������������������������������������������*/
277  enum
278  {
279  cFrameColor = 0,
280  cBodyColor = 1,
281  cTextColor = 2,
282  cThumbColor = 3,
283  kNumberCtlCTabEntries = 4
284  };
285 
286  struct CtlCTab
287  {
288  SInt32 ccSeed;
289  SInt16 ccRider;
290  SInt16 ctSize;
291  ColorSpec ctTable[4];
292  };
293  typedef struct CtlCTab CtlCTab;
294  typedef CtlCTab *CCTabPtr;
295  typedef CCTabPtr *CCTabHandle;
296 /*������������������������������������������������������������������������������������������������������*/
297 /* � Auxiliary Control Record */
298 /*������������������������������������������������������������������������������������������������������*/
299 #if !OPAQUE_TOOLBOX_STRUCTS
300  struct AuxCtlRec
301  {
302  Handle acNext; /* not supported in Carbon*/
303  ControlRef acOwner; /* not supported in Carbon*/
304  CCTabHandle acCTable; /* not supported in Carbon*/
305  SInt16 acFlags; /* not supported in Carbon*/
306  SInt32 acReserved; /* not supported in Carbon*/
307  SInt32 acRefCon; /* in Carbon use Get/SetControlProperty if you need more
308  refCons*/
309  };
310  typedef struct AuxCtlRec AuxCtlRec;
311  typedef AuxCtlRec *AuxCtlPtr;
312  typedef AuxCtlPtr *AuxCtlHandle;
313 #endif /* !OPAQUE_TOOLBOX_STRUCTS */
314 
315  /*��������������������������������������������������������������������������������������*/
316  /* � Control Variants */
317  /*��������������������������������������������������������������������������������������*/
318  typedef SInt16 ControlVariant;
319  enum
320  {
321  kControlNoVariant = 0, /* No variant*/
322  kControlUsesOwningWindowsFontVariant =
323  1 << 3 /* Control uses owning windows font to display text*/
324  };
325 
326  /*��������������������������������������������������������������������������������������*/
327  /* � Control Part Codes */
328  /*��������������������������������������������������������������������������������������*/
329  /* Basic part codes */
330  enum
331  {
332  kControlNoPart = 0,
333  kControlIndicatorPart = 129,
334  kControlDisabledPart = 254,
335  kControlInactivePart = 255
336  };
337 
338  /* Use this constant in Get/SetControlData when the data referred to is not */
339  /* specific to a part, but rather the entire control, e.g. the list handle of a
340  */
341  /* list box control. */
342  enum
343  {
344  kControlEntireControl = 0
345  };
346 
347  /* Meta-Parts */
348  /* */
349  /* If you haven't guessed from looking at other toolbox headers. We like the
350  * word */
351  /* 'meta'. It's cool. So here's one more for you. A meta-part is a part used in
352  * a call */
353  /* to the GetControlRegion API. These parts are parts that might be defined by
354  * a */
355  /* control, but should not be returned from calls like TestControl, et al. They
356  * define */
357  /* a region of a control, presently the structure and the content region. The
358  * content */
359  /* region is only defined by controls that can embed other controls. It is the
360  * area */
361  /* that embedded content can live. */
362  /* */
363  /* Along with these parts, you can also pass in normal part codes to get the
364  * regions */
365  /* of the parts. Not all controls fully support this at the time this was
366  * written. */
367  enum
368  {
369  kControlStructureMetaPart = -1,
370  kControlContentMetaPart = -2
371  };
372 
373  /* focusing part codes */
374  enum
375  {
376  kControlFocusNoPart = 0, /* tells control to clear its focus*/
377  kControlFocusNextPart = -1, /* tells control to focus on the next part*/
378  kControlFocusPrevPart = -2 /* tells control to focus on the previous part*/
379  };
380 
381  typedef SInt16 ControlFocusPart;
382  /*������������������������������������������������������������������������������������������������������*/
383  /* � Control Collection Tags */
384  /*������������������������������������������������������������������������������������������������������*/
385  /* These are standard tags that you will find in the initial data Collection
386  * that is passed in the */
387  /* 'param' parameter to the initCntl message (Carbon only). */
388  /* */
389  /* All tags at ID zero in a Control's Collection are reserved for Control
390  * Manager use. */
391  /* Custom control definitions should use other IDs. */
392  /* */
393  /* Most of these tags are interpreted when you call CreateCustomControl; the
394  * Control Manager will */
395  /* put value in the right place before calling the Control Definition with the
396  * initialization message. */
397  enum
398  {
399  kControlCollectionTagBounds =
400  FOUR_CHAR_CODE('boun'), /* Rect - the bounding rectangle*/
401  kControlCollectionTagValue = FOUR_CHAR_CODE('valu'), /* SInt32 - the value*/
402  kControlCollectionTagMinimum =
403  FOUR_CHAR_CODE('min '), /* SInt32 - the minimum*/
404  kControlCollectionTagMaximum =
405  FOUR_CHAR_CODE('max '), /* SInt32 - the maximum*/
406  kControlCollectionTagViewSize =
407  FOUR_CHAR_CODE('view'), /* SInt32 - the view size*/
408  kControlCollectionTagVisibility =
409  FOUR_CHAR_CODE('visi'), /* Boolean - the visible state*/
410  kControlCollectionTagRefCon = FOUR_CHAR_CODE('refc'), /* SInt32 - the refCon*/
411  kControlCollectionTagTitle =
412  FOUR_CHAR_CODE('titl'), /* arbitrarily sized character array - the title*/
413  kControlCollectionTagUnicodeTitle = FOUR_CHAR_CODE(
414  'uttl'), /* bytes as received via CFStringCreateExternalRepresentation*/
415  kControlCollectionTagIDSignature =
416  FOUR_CHAR_CODE('idsi'), /* OSType - the ControlID signature*/
417  kControlCollectionTagIDID =
418  FOUR_CHAR_CODE('idid'), /* SInt32 - the ControlID id*/
419  kControlCollectionTagCommand =
420  FOUR_CHAR_CODE('cmd '), /* UInt32 - the command*/
421  kControlCollectionTagVarCode =
422  FOUR_CHAR_CODE('varc') /* SInt16 - the variant*/
423  };
424 
425  /*������������������������������������������������������������������������������������������������������*/
426  /* � Control Image Content */
427  /*������������������������������������������������������������������������������������������������������*/
428  enum
429  {
430  kControlContentTextOnly = 0,
431  kControlNoContent = 0,
432  kControlContentIconSuiteRes = 1,
433  kControlContentCIconRes = 2,
434  kControlContentPictRes = 3,
435  kControlContentICONRes = 4,
436  kControlContentIconSuiteHandle = 129,
437  kControlContentCIconHandle = 130,
438  kControlContentPictHandle = 131,
439  kControlContentIconRef = 132,
440  kControlContentICON = 133
441  };
442 
443  typedef SInt16 ControlContentType;
445  {
446  ControlContentType contentType;
447  union
448  {
449  SInt16 resID;
450  CIconHandle cIconHandle;
451  Handle iconSuite;
452  IconRef iconRef;
453  PicHandle picture;
454  Handle ICONHandle;
455  } u;
456  };
461  /*������������������������������������������������������������������������������������������������������*/
462  /* � Control Key Script Behavior */
463  /*������������������������������������������������������������������������������������������������������*/
464  enum
465  {
466  kControlKeyScriptBehaviorAllowAnyScript =
467  FOUR_CHAR_CODE('any '), /* leaves the current keyboard alone and allows
468  user to change the keyboard.*/
469  kControlKeyScriptBehaviorPrefersRoman =
470  FOUR_CHAR_CODE('prmn'), /* switches the keyboard to roman, but allows them
471  to change it as desired.*/
472  kControlKeyScriptBehaviorRequiresRoman =
473  FOUR_CHAR_CODE('rrmn') /* switches the keyboard to roman and prevents the
474  user from changing it.*/
475  };
476 
477  typedef UInt32 ControlKeyScriptBehavior;
478  /*������������������������������������������������������������������������������������������������������*/
479  /* � Control Font Style */
480  /*������������������������������������������������������������������������������������������������������*/
481  /* SPECIAL FONT USAGE NOTES: You can specify the font to use for many control
482  types. The constants below are meta-font numbers which you can use to set a
483  particular control's font usage. There are essentially two modes you can use:
484  1) default, which is essentially the same as it always has been, i.e. it uses
485  the system font, unless directed to use the window font via a control
486  variant. 2) you can specify to use the big or small system font in a generic
487  manner. The Big system font is the font used in menus, etc. Chicago has
488  filled that role for some time now. Small system font is currently Geneva 10.
489  The meta-font number implies the size and style.
490 
491  NOTE: Not all font attributes are used by all controls. Most, in fact,
492  ignore the fore and back color (Static Text is the only one that does, for
493  backwards compatibility). Also size, face, and addFontSize are
494  ignored when using the meta-font numbering.
495  */
496  /* Meta-font numbering - see note above */
497  enum
498  {
499  kControlFontBigSystemFont = -1, /* force to big system font*/
500  kControlFontSmallSystemFont = -2, /* force to small system font*/
501  kControlFontSmallBoldSystemFont = -3, /* force to small bold system font*/
502  kControlFontViewSystemFont =
503  -4 /* force to views system font (DataBrowser control only)*/
504  };
505 
506  /* Add these masks together to set the flags field of a ControlFontStyleRec */
507  /* They specify which fields to apply to the text. It is important to make */
508  /* sure that you specify only the fields that you wish to set. */
509  enum
510  {
511  kControlUseFontMask = 0x0001,
512  kControlUseFaceMask = 0x0002,
513  kControlUseSizeMask = 0x0004,
514  kControlUseForeColorMask = 0x0008,
515  kControlUseBackColorMask = 0x0010,
516  kControlUseModeMask = 0x0020,
517  kControlUseJustMask = 0x0040,
518  kControlUseAllMask = 0x00FF,
519  kControlAddFontSizeMask = 0x0100
520  };
521 
522  /* AddToMetaFont indicates that we want to start with a standard system */
523  /* font, but then we'd like to add the other attributes. Normally, the meta */
524  /* font ignores all other flags */
525  enum
526  {
527  kControlAddToMetaFontMask = 0x0200 /* Available in Appearance 1.1 or later*/
528  };
529 
530  /* UseThemeFontID indicates that the font field of the ControlFontStyleRec */
531  /* should be interpreted as a ThemeFontID (see Appearance.h). In all other */
532  /* ways, specifying a ThemeFontID is just like using one of the control */
533  /* meta-fonts IDs. */
534  enum
535  {
536  kControlUseThemeFontIDMask = 0x0080 /* Available in Mac OS X or later*/
537  };
538 
540  {
541  SInt16 flags;
542  SInt16 font;
543  SInt16 size;
544  SInt16 style;
545  SInt16 mode;
546  SInt16 just;
547  RGBColor foreColor;
548  RGBColor backColor;
549  };
552  /*������������������������������������������������������������������������������������������������������*/
553  /* � Click Activation Results */
554  /*������������������������������������������������������������������������������������������������������*/
555  /* These are for use with GetControlClickActivation. The enumerated values
556  * should be pretty */
557  /* self-explanatory, but just in case: */
558  /* � Activate/DoNotActivate indicates whether or not to change the owning
559  * window's z-ordering before */
560  /* processing the click. If activation is requested, you may also want to
561  * immediately redraw the */
562  /* newly exposed portion of the window. */
563  /* � Ignore/Handle Click indicates whether or not to call an appropriate click
564  * handling API (like */
565  /* HandleControlClick) in respose to the event. */
566  enum
567  {
568  kDoNotActivateAndIgnoreClick =
569  0, /* probably never used. here for completeness.*/
570  kDoNotActivateAndHandleClick = 1, /* let the control handle the click while
571  the window is still in the background.*/
572  kActivateAndIgnoreClick =
573  2, /* control doesn't want to respond directly to the click, but window
574  should still be brought forward.*/
575  kActivateAndHandleClick = 3 /* control wants to respond to the click, but only
576  after the window has been activated.*/
577  };
578 
579  typedef UInt32 ClickActivationResult;
580  /*������������������������������������������������������������������������������������������������������*/
581  /* � Common data tags for Get/SetControlData */
582  /*������������������������������������������������������������������������������������������������������*/
583 
588  enum
589  {
590  kControlFontStyleTag = FOUR_CHAR_CODE('font'),
591  kControlKeyFilterTag = FOUR_CHAR_CODE('fltr'),
592 
597  kControlKindTag = FOUR_CHAR_CODE('kind'),
598 
603  kControlSizeTag = FOUR_CHAR_CODE('size')
604  };
605 
606  /*������������������������������������������������������������������������������������������������������*/
607  /* � Control Feature Bits */
608  /*������������������������������������������������������������������������������������������������������*/
609  enum
610  {
611  /* Control feature bits - returned by GetControlFeatures */
612  kControlSupportsGhosting = 1 << 0,
613  kControlSupportsEmbedding = 1 << 1,
614  kControlSupportsFocus = 1 << 2,
615  kControlWantsIdle = 1 << 3,
616  kControlWantsActivate = 1 << 4,
617  kControlHandlesTracking = 1 << 5,
618  kControlSupportsDataAccess = 1 << 6,
619  kControlHasSpecialBackground = 1 << 7,
620  kControlGetsFocusOnClick = 1 << 8,
621  kControlSupportsCalcBestRect = 1 << 9,
622  kControlSupportsLiveFeedback = 1 << 10,
623  kControlHasRadioBehavior = 1
624  << 11, /* Available in Appearance 1.0.1 or later*/
625  kControlSupportsDragAndDrop = 1 << 12, /* Available in Carbon*/
626  kControlAutoToggles = 1 << 14, /* Available in Appearance 1.1 or later*/
627  kControlSupportsGetRegion = 1 << 17, /* Available in Appearance 1.1 or later*/
628  kControlSupportsFlattening = 1 << 19, /* Available in Carbon*/
629  kControlSupportsSetCursor = 1 << 20, /* Available in Carbon*/
630  kControlSupportsContextualMenus = 1 << 21, /* Available in Carbon*/
631  kControlSupportsClickActivation = 1 << 22, /* Available in Carbon*/
632  kControlIdlesWithTimer = 1 << 23 /* Available in Carbon - this bit indicates
633  that the control animates automatically*/
634  };
635 
636  /*������������������������������������������������������������������������������������������������������*/
637  /* � Control Messages */
638  /*������������������������������������������������������������������������������������������������������*/
639  enum
640  {
641  drawCntl = 0,
642  testCntl = 1,
643  calcCRgns = 2,
644  initCntl = 3, /* Param is Collection, result is OSStatus*/
645  dispCntl = 4,
646  posCntl = 5,
647  thumbCntl = 6,
648  dragCntl = 7,
649  autoTrack = 8,
650  calcCntlRgn = 10,
651  calcThumbRgn = 11,
652  drawThumbOutline = 12,
653  kControlMsgDrawGhost = 13,
654  kControlMsgCalcBestRect =
655  14, /* Calculate best fitting rectangle for control*/
656  kControlMsgHandleTracking = 15,
657  kControlMsgFocus = 16, /* param indicates action.*/
658  kControlMsgKeyDown = 17,
659  kControlMsgIdle = 18,
660  kControlMsgGetFeatures = 19,
661  kControlMsgSetData = 20,
662  kControlMsgGetData = 21,
663  kControlMsgActivate = 22,
664  kControlMsgSetUpBackground = 23,
665  kControlMsgCalcValueFromPos = 26,
666  kControlMsgTestNewMsgSupport =
667  27, /* See if this control supports new messaging*/
668  kControlMsgSubValueChanged = 25, /* Available in Appearance 1.0.1 or later*/
669  kControlMsgSubControlAdded = 28, /* Available in Appearance 1.0.1 or later*/
670  kControlMsgSubControlRemoved = 29, /* Available in Appearance 1.0.1 or later*/
671  kControlMsgApplyTextColor = 30, /* Available in Appearance 1.1 or later*/
672  kControlMsgGetRegion = 31, /* Available in Appearance 1.1 or later*/
673  kControlMsgFlatten = 32, /* Available in Carbon. Param is Collection.*/
674  kControlMsgSetCursor =
675  33, /* Available in Carbon. Param is ControlSetCursorRec*/
676  kControlMsgDragEnter = 38, /* Available in Carbon. Param is DragRef, result is
677  boolean indicating acceptibility of drag.*/
678  kControlMsgDragLeave = 39, /* Available in Carbon. As above.*/
679  kControlMsgDragWithin = 40, /* Available in Carbon. As above.*/
680  kControlMsgDragReceive = 41, /* Available in Carbon. Param is DragRef, result
681  is OSStatus indicating success/failure.*/
682  kControlMsgDisplayDebugInfo = 46, /* Available in Carbon on X.*/
683  kControlMsgContextualMenuClick =
684  47, /* Available in Carbon. Param is ControlContextualMenuClickRec*/
685  kControlMsgGetClickActivation =
686  48 /* Available in Carbon. Param is ControlClickActivationRec*/
687  };
688 
689  typedef SInt16 ControlDefProcMessage;
690  /*��������������������������������������������������������������������������������������*/
691  /* � Control Sizes */
692  /*��������������������������������������������������������������������������������������*/
693  enum
694  {
695  kControlSizeNormal = 0,
696  kControlSizeSmall = 1,
697  kControlSizeLarge = 2,
698  kControlSizeAuto = 0xFFFF
699  };
700 
701  typedef UInt16 ControlSize;
702  /*��������������������������������������������������������������������������������������*/
703  /* � Constants for drawCntl message (passed in param) */
704  /*��������������������������������������������������������������������������������������*/
705  enum
706  {
707  kDrawControlEntireControl = 0,
708  kDrawControlIndicatorOnly = 129
709  };
710 
711  /*��������������������������������������������������������������������������������������*/
712  /* � Constants for dragCntl message (passed in param) */
713  /*��������������������������������������������������������������������������������������*/
714  enum
715  {
716  kDragControlEntireControl = 0,
717  kDragControlIndicator = 1
718  };
719 
720  /*��������������������������������������������������������������������������������������*/
721  /* � Drag Constraint Structure for thumbCntl message (passed in param) */
722  /*��������������������������������������������������������������������������������������*/
724  {
725  Rect limitRect;
726  Rect slopRect;
727  DragConstraint axis;
728  };
731  /*��������������������������������������������������������������������������������������*/
732  /* CDEF should return as result of kControlMsgTestNewMsgSupport */
733  /*��������������������������������������������������������������������������������������*/
734  enum
735  {
736  kControlSupportsNewMessages = FOUR_CHAR_CODE(' ok ')
737  };
738 
739  /*��������������������������������������������������������������������������������������*/
740  /* This structure is passed into a CDEF when called with the
741  * kControlMsgHandleTracking */
742  /* message */
743  /*��������������������������������������������������������������������������������������*/
745  {
746  Point startPt;
747  EventModifiers modifiers;
748  ControlActionUPP action;
749  };
750  typedef struct ControlTrackingRec ControlTrackingRec;
752  /*��������������������������������������������������������������������������������������*/
753  /* This structure is passed into a CDEF when called with the kControlMsgKeyDown
754  * message */
755  /*��������������������������������������������������������������������������������������*/
757  {
758  EventModifiers modifiers;
759  SInt16 keyCode;
760  SInt16 charCode;
761  };
762  typedef struct ControlKeyDownRec ControlKeyDownRec;
764  /*��������������������������������������������������������������������������������������*/
765  /* This structure is passed into a CDEF when called with the kControlMsgGetData
766  * or */
767  /* kControlMsgSetData message */
768  /*��������������������������������������������������������������������������������������*/
770  {
771  ResType tag;
772  ResType part;
773  Size size;
774  Ptr dataPtr;
775  };
778  /*��������������������������������������������������������������������������������������*/
779  /* This structure is passed into a CDEF when called with the
780  * kControlCalcBestRect msg */
781  /*��������������������������������������������������������������������������������������*/
783  {
784  SInt16 height;
785  SInt16 width;
786  SInt16 baseLine;
787  };
788  typedef struct ControlCalcSizeRec ControlCalcSizeRec;
790  /*��������������������������������������������������������������������������������������*/
791  /* This structure is passed into a CDEF when called with the
792  * kControlMsgSetUpBackground */
793  /* message is sent */
794  /*��������������������������������������������������������������������������������������*/
796  {
797  SInt16 depth;
798  Boolean colorDevice;
799  };
802  /*��������������������������������������������������������������������������������������*/
803  /* This structure is passed into a CDEF when called with the
804  * kControlMsgApplyTextColor */
805  /* message is sent */
806  /*��������������������������������������������������������������������������������������*/
808  {
809  SInt16 depth;
810  Boolean colorDevice;
811  Boolean active;
812  };
815  /*��������������������������������������������������������������������������������������*/
816  /* This structure is passed into a CDEF when called with the
817  * kControlMsgGetRegion */
818  /* message is sent */
819  /*��������������������������������������������������������������������������������������*/
821  {
822  RgnHandle region;
823  ControlPartCode part;
824  };
827  /*��������������������������������������������������������������������������������������*/
828  /* This structure is passed into a CDEF when the kControlMsgSetCursor message is
829  * sent */
830  /* Only sent on Carbon */
831  /*��������������������������������������������������������������������������������������*/
833  {
834  Point localPoint;
835  EventModifiers modifiers;
836  Boolean cursorWasSet; /* your CDEF must set this to true if you set the
837  cursor, or false otherwise*/
838  };
841  /*��������������������������������������������������������������������������������������*/
842  /* This structure is passed into a CDEF when the kControlMsgContextualMenuClick
843  * message */
844  /* is sent */
845  /* Only sent on Carbon */
846  /*��������������������������������������������������������������������������������������*/
848  {
849  Point localPoint;
850  Boolean menuDisplayed; /* your CDEF must set this to true if you displayed a
851  menu, or false otherwise*/
852  };
855  /*��������������������������������������������������������������������������������������*/
856  /* This structure is passed into a CDEF when the kControlMsgGetClickActivation
857  * message */
858  /* is sent */
859  /* Only sent on Carbon */
860  /*��������������������������������������������������������������������������������������*/
862  {
863  Point localPoint;
864  EventModifiers modifiers;
865  ClickActivationResult result; /* your CDEF must pass the desired result back*/
866  };
869  /*��������������������������������������������������������������������������������������*/
870  /* � �CDEF� entrypoint */
871  /*��������������������������������������������������������������������������������������*/
872  typedef CALLBACK_API(SInt32, ControlDefProcPtr)(SInt16 varCode,
874  ControlDefProcMessage message,
875  SInt32 param);
876  typedef STACK_UPP_TYPE(ControlDefProcPtr) ControlDefUPP;
885  ControlDefUPP
886  NewControlDefUPP(ControlDefProcPtr userRoutine);
887 #if !OPAQUE_UPP_TYPES
888  enum
889  {
890  uppControlDefProcInfo = 0x00003BB0
891  }; /* pascal 4_bytes Func(2_bytes, 4_bytes, 2_bytes, 4_bytes) */
892 #ifdef __cplusplus
893  inline ControlDefUPP NewControlDefUPP(ControlDefProcPtr userRoutine)
894  {
895  return (ControlDefUPP)NewRoutineDescriptor(
896  (ProcPtr)(userRoutine), uppControlDefProcInfo, GetCurrentArchitecture());
897  }
898 #else
899 #define NewControlDefUPP(userRoutine) \
900  (ControlDefUPP) NewRoutineDescriptor( \
901  (ProcPtr)(userRoutine), uppControlDefProcInfo, GetCurrentArchitecture())
902 #endif
903 #endif
904 
913  void
914  DisposeControlDefUPP(ControlDefUPP userUPP);
915 #if !OPAQUE_UPP_TYPES
916 #ifdef __cplusplus
917  inline void DisposeControlDefUPP(ControlDefUPP userUPP)
918  {
919  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
920  }
921 #else
922 #define DisposeControlDefUPP(userUPP) DisposeRoutineDescriptor(userUPP)
923 #endif
924 #endif
925 
934  SInt32
936  ControlDefProcMessage message, SInt32 param,
937  ControlDefUPP userUPP);
938 #if !OPAQUE_UPP_TYPES
939 #ifdef __cplusplus
940  inline SInt32 InvokeControlDefUPP(SInt16 varCode, ControlRef theControl,
941  ControlDefProcMessage message, SInt32 param,
942  ControlDefUPP userUPP)
943  {
944  return (SInt32)CALL_FOUR_PARAMETER_UPP(userUPP, uppControlDefProcInfo,
945  varCode, theControl, message, param);
946  }
947 #else
948 #define InvokeControlDefUPP(varCode, theControl, message, param, userUPP) \
949  (SInt32) \
950  CALL_FOUR_PARAMETER_UPP((userUPP), uppControlDefProcInfo, (varCode), \
951  (theControl), (message), (param))
952 #endif
953 #endif
954 
955 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
956 /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
957 #define NewControlDefProc(userRoutine) NewControlDefUPP(userRoutine)
958 #define CallControlDefProc(userRoutine, varCode, theControl, message, param) \
959  InvokeControlDefUPP(varCode, theControl, message, param, userRoutine)
960 #endif /* CALL_NOT_IN_CARBON */
961 
962  /*��������������������������������������������������������������������������������������*/
963  /* Control Key Filter */
964  /*��������������������������������������������������������������������������������������*/
965  /* Certain controls can have a keyfilter attached to them. */
966  /* Definition of a key filter for intercepting and possibly changing keystrokes
967  */
968  /* which are destined for a control. */
969  /* Key Filter Result Codes */
970  /* The filter proc should return one of the two constants below. If */
971  /* kKeyFilterBlockKey is returned, the key is blocked and never makes it to the
972  */
973  /* control. If kKeyFilterPassKey is returned, the control receives the
974  * keystroke. */
975  enum
976  {
977  kControlKeyFilterBlockKey = 0,
978  kControlKeyFilterPassKey = 1
979  };
980 
981  typedef SInt16 ControlKeyFilterResult;
982  typedef CALLBACK_API(ControlKeyFilterResult,
983  ControlKeyFilterProcPtr)(ControlRef theControl,
984  SInt16 *keyCode, SInt16 *charCode,
985  EventModifiers *modifiers);
986  typedef STACK_UPP_TYPE(ControlKeyFilterProcPtr) ControlKeyFilterUPP;
995  ControlKeyFilterUPP
996  NewControlKeyFilterUPP(ControlKeyFilterProcPtr userRoutine);
997 #if !OPAQUE_UPP_TYPES
998  enum
999  {
1000  uppControlKeyFilterProcInfo = 0x00003FE0
1001  }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
1002 #ifdef __cplusplus
1003  inline ControlKeyFilterUPP
1004  NewControlKeyFilterUPP(ControlKeyFilterProcPtr userRoutine)
1005  {
1006  return (ControlKeyFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
1007  uppControlKeyFilterProcInfo,
1008  GetCurrentArchitecture());
1009  }
1010 #else
1011 #define NewControlKeyFilterUPP(userRoutine) \
1012  (ControlKeyFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), \
1013  uppControlKeyFilterProcInfo, \
1014  GetCurrentArchitecture())
1015 #endif
1016 #endif
1017 
1026  void
1027  DisposeControlKeyFilterUPP(ControlKeyFilterUPP userUPP);
1028 #if !OPAQUE_UPP_TYPES
1029 #ifdef __cplusplus
1030  inline void DisposeControlKeyFilterUPP(ControlKeyFilterUPP userUPP)
1031  {
1032  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
1033  }
1034 #else
1035 #define DisposeControlKeyFilterUPP(userUPP) DisposeRoutineDescriptor(userUPP)
1036 #endif
1037 #endif
1038 
1047  ControlKeyFilterResult
1049  SInt16 *charCode, EventModifiers *modifiers,
1050  ControlKeyFilterUPP userUPP);
1051 #if !OPAQUE_UPP_TYPES
1052 #ifdef __cplusplus
1053  inline ControlKeyFilterResult
1055  SInt16 *charCode, EventModifiers *modifiers,
1056  ControlKeyFilterUPP userUPP)
1057  {
1058  return (ControlKeyFilterResult)CALL_FOUR_PARAMETER_UPP(
1059  userUPP, uppControlKeyFilterProcInfo, theControl, keyCode, charCode,
1060  modifiers);
1061  }
1062 #else
1063 #define InvokeControlKeyFilterUPP(theControl, keyCode, charCode, modifiers, \
1064  userUPP) \
1065  (ControlKeyFilterResult) CALL_FOUR_PARAMETER_UPP( \
1066  (userUPP), uppControlKeyFilterProcInfo, (theControl), (keyCode), \
1067  (charCode), (modifiers))
1068 #endif
1069 #endif
1070 
1071 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
1072 /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
1073 #define NewControlKeyFilterProc(userRoutine) NewControlKeyFilterUPP(userRoutine)
1074 #define CallControlKeyFilterProc(userRoutine, theControl, keyCode, charCode, \
1075  modifiers) \
1076  InvokeControlKeyFilterUPP(theControl, keyCode, charCode, modifiers, \
1077  userRoutine)
1078 #endif /* CALL_NOT_IN_CARBON */
1079 
1080  /*��������������������������������������������������������������������������������������*/
1081  /* � DragGrayRgn Constatns */
1082  /* */
1083  /* For DragGrayRgnUPP used in TrackControl() */
1084  /*��������������������������������������������������������������������������������������*/
1085  enum
1086  {
1087  noConstraint = kNoConstraint,
1088  hAxisOnly = 1,
1089  vAxisOnly = 2
1090  };
1091 
1092  /*��������������������������������������������������������������������������������������*/
1093  /* � Control Creation/Deletion/Persistence */
1094  /*��������������������������������������������������������������������������������������*/
1095  /* CreateCustomControl is only available as part of Carbon */
1096  enum
1097  {
1098  kControlDefProcPtr = 0, /* raw proc-ptr based access*/
1099  kControlDefObjectClass = 1 /* event-based definition (Mac OS X only)*/
1100  };
1101 
1102  typedef UInt32 ControlDefType;
1104  {
1105  ControlDefType defType;
1106  union
1107  {
1108  ControlDefUPP defProc;
1109  void *classRef;
1110  } u;
1111  };
1112  typedef struct ControlDefSpec ControlDefSpec;
1121  OSStatus
1122  CreateCustomControl(WindowRef owningWindow, const Rect *contBounds,
1123  const ControlDefSpec *def, Collection initData,
1124  ControlRef *outControl);
1125 
1134  ControlRef
1135  NewControl(WindowRef owningWindow, const Rect *boundsRect,
1136  ConstStr255Param controlTitle, Boolean initiallyVisible,
1137  SInt16 initialValue, SInt16 minimumValue, SInt16 maximumValue,
1138  SInt16 procID, SInt32 controlReference);
1139 
1148  ControlRef
1149  GetNewControl(SInt16 resourceID, WindowRef owningWindow);
1150 
1159  void
1161 
1170  void
1172 
1173  /*��������������������������������������������������������������������������������������*/
1174  /* � Control Definition Registration */
1175  /*��������������������������������������������������������������������������������������*/
1176  typedef CALLBACK_API(OSStatus, ControlCNTLToCollectionProcPtr)(
1177  const Rect *bounds, SInt16 value, Boolean visible, SInt16 max, SInt16 min,
1178  SInt16 procID, SInt32 refCon, ConstStr255Param title,
1179  Collection collection);
1180  typedef STACK_UPP_TYPE(ControlCNTLToCollectionProcPtr)
1181  ControlCNTLToCollectionUPP;
1190  ControlCNTLToCollectionUPP
1191  NewControlCNTLToCollectionUPP(ControlCNTLToCollectionProcPtr userRoutine);
1192 #if !OPAQUE_UPP_TYPES
1193  enum
1194  {
1195  uppControlCNTLToCollectionProcInfo = 0x00FEA6F0
1196  }; /* pascal 4_bytes Func(4_bytes, 2_bytes, 1_byte, 2_bytes, 2_bytes, 2_bytes,
1197  4_bytes, 4_bytes, 4_bytes) */
1198 #ifdef __cplusplus
1199  inline ControlCNTLToCollectionUPP
1200  NewControlCNTLToCollectionUPP(ControlCNTLToCollectionProcPtr userRoutine)
1201  {
1202  return (ControlCNTLToCollectionUPP)NewRoutineDescriptor(
1203  (ProcPtr)(userRoutine), uppControlCNTLToCollectionProcInfo,
1204  GetCurrentArchitecture());
1205  }
1206 #else
1207 #define NewControlCNTLToCollectionUPP(userRoutine) \
1208  (ControlCNTLToCollectionUPP) NewRoutineDescriptor( \
1209  (ProcPtr)(userRoutine), uppControlCNTLToCollectionProcInfo, \
1210  GetCurrentArchitecture())
1211 #endif
1212 #endif
1213 
1222  void
1223  DisposeControlCNTLToCollectionUPP(ControlCNTLToCollectionUPP userUPP);
1224 #if !OPAQUE_UPP_TYPES
1225 #ifdef __cplusplus
1226  inline void
1227  DisposeControlCNTLToCollectionUPP(ControlCNTLToCollectionUPP userUPP)
1228  {
1229  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
1230  }
1231 #else
1232 #define DisposeControlCNTLToCollectionUPP(userUPP) \
1233  DisposeRoutineDescriptor(userUPP)
1234 #endif
1235 #endif
1236 
1245  OSStatus
1246  InvokeControlCNTLToCollectionUPP(const Rect *bounds, SInt16 value,
1247  Boolean visible, SInt16 max, SInt16 min,
1248  SInt16 procID, SInt32 refCon,
1249  ConstStr255Param title, Collection collection,
1250  ControlCNTLToCollectionUPP userUPP);
1251 #if !OPAQUE_UPP_TYPES
1252 #ifdef __cplusplus
1253  inline OSStatus InvokeControlCNTLToCollectionUPP(
1254  const Rect *bounds, SInt16 value, Boolean visible, SInt16 max, SInt16 min,
1255  SInt16 procID, SInt32 refCon, ConstStr255Param title, Collection collection,
1256  ControlCNTLToCollectionUPP userUPP)
1257  {
1258  return (OSStatus)CALL_NINE_PARAMETER_UPP(
1259  userUPP, uppControlCNTLToCollectionProcInfo, bounds, value, visible, max,
1260  min, procID, refCon, title, collection);
1261  }
1262 #else
1263 #define InvokeControlCNTLToCollectionUPP(bounds, value, visible, max, min, \
1264  procID, refCon, title, collection, \
1265  userUPP) \
1266  (OSStatus) CALL_NINE_PARAMETER_UPP( \
1267  (userUPP), uppControlCNTLToCollectionProcInfo, (bounds), (value), \
1268  (visible), (max), (min), (procID), (refCon), (title), (collection))
1269 #endif
1270 #endif
1271 
1272 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
1273 /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
1274 #define NewControlCNTLToCollectionProc(userRoutine) \
1275  NewControlCNTLToCollectionUPP(userRoutine)
1276 #define CallControlCNTLToCollectionProc(userRoutine, bounds, value, visible, \
1277  max, min, procID, refCon, title, \
1278  collection) \
1279  InvokeControlCNTLToCollectionUPP(bounds, value, visible, max, min, procID, \
1280  refCon, title, collection, userRoutine)
1281 #endif /* CALL_NOT_IN_CARBON */
1282 
1333  OSStatus
1334  RegisterControlDefinition(SInt16 inCDEFResID,
1335  const ControlDefSpec *inControlDef,
1336  ControlCNTLToCollectionUPP inConversionProc);
1337 
1338  /*��������������������������������������������������������������������������������������*/
1339  /* � Control Visible State */
1340  /*��������������������������������������������������������������������������������������*/
1349  void
1350  HiliteControl(ControlRef theControl, ControlPartCode hiliteState);
1351 
1360  void
1362 
1371  void
1373 
1374  /* following state routines available only with Appearance 1.0 and later*/
1383  Boolean
1385 
1394  Boolean
1396 
1405  OSErr
1407 
1416  OSErr
1418 
1427  OSErr
1428  SetControlVisibility(ControlRef inControl, Boolean inIsVisible,
1429  Boolean inDoDraw);
1430 
1431  /* following state routines available only on Mac OS X and later*/
1441  Boolean
1443 
1453  OSStatus
1455 
1465  OSStatus
1467 
1468  /*��������������������������������������������������������������������������������������*/
1469  /* � Control Imaging */
1470  /*��������������������������������������������������������������������������������������*/
1471 
1500  EndUpdate(updtWin);
1501  SetPort(savePort) break;
1502 case mouseDown:
1503  .....etc...
1504  .
1505 }
1506 }
1507 The ’size icon' (if used) is also part of the content region of a window and will need to be redrawn when it is uncovered.</ pre>
1508  * \copyright THINK Reference © 1991 -
1509  1992 Symantec Corporation
1510  * \non_carbon_cfm in InterfaceLib 7.1 and
1511  later
1512  * \carbon_lib in CarbonLib 1.0 and
1513  later
1514  * \mac_os_x in version 10.0 and
1515  later
1516  * /
1517  void
1518  DrawControls(WindowRef theWindow);
1519 
1528 void Draw1Control(ControlRef theControl);
1529 
1530 #define DrawOneControl(theControl) Draw1Control(theControl)
1531 
1555 void UpdateControls(
1556  WindowRef inWindow,
1557  RgnHandle inUpdateRegion) /* can be NULL */;
1558 
1559 /* following imaging routines available only with Appearance 1.0 and later*/
1568 OSErr GetBestControlRect(ControlRef inControl, Rect *outRect,
1569  SInt16 *outBaseLineOffset);
1570 
1579 OSErr SetControlFontStyle(ControlRef inControl, const ControlFontStyleRec *inStyle);
1580 
1589 void DrawControlInCurrentPort(ControlRef inControl);
1590 
1640 OSErr SetUpControlBackground(ControlRef inControl, SInt16 inDepth,
1641  Boolean inIsColorDevice);
1642 
1691 OSErr SetUpControlTextColor(ControlRef inControl, SInt16 inDepth,
1692  Boolean inIsColorDevice);
1693 
1746 typedef CALLBACK_API(OSStatus, ControlColorProcPtr)(ControlRef inControl,
1747  SInt16 inMessage,
1748  SInt16 inDrawDepth,
1749  Boolean inDrawInColor);
1750 typedef STACK_UPP_TYPE(ControlColorProcPtr) ControlColorUPP;
1759 ControlColorUPP
1760 NewControlColorUPP(ControlColorProcPtr userRoutine);
1761 #if !OPAQUE_UPP_TYPES
1762 enum
1763 {
1764  uppControlColorProcInfo = 0x00001AF0
1765 }; /* pascal 4_bytes Func(4_bytes, 2_bytes, 2_bytes, 1_byte) */
1766 #ifdef __cplusplus
1767 inline ControlColorUPP NewControlColorUPP(ControlColorProcPtr userRoutine)
1768 {
1769  return (ControlColorUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
1770  uppControlColorProcInfo,
1771  GetCurrentArchitecture());
1772 }
1773 #else
1774 #define NewControlColorUPP(userRoutine) \
1775  (ControlColorUPP) \
1776  NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlColorProcInfo, \
1777  GetCurrentArchitecture())
1778 #endif
1779 #endif
1780 
1789 void DisposeControlColorUPP(ControlColorUPP userUPP);
1790 #if !OPAQUE_UPP_TYPES
1791 #ifdef __cplusplus
1792 inline void DisposeControlColorUPP(ControlColorUPP userUPP)
1793 {
1794  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
1795 }
1796 #else
1797 #define DisposeControlColorUPP(userUPP) DisposeRoutineDescriptor(userUPP)
1798 #endif
1799 #endif
1800 
1809 OSStatus
1810 InvokeControlColorUPP(ControlRef inControl, SInt16 inMessage,
1811  SInt16 inDrawDepth, Boolean inDrawInColor,
1812  ControlColorUPP userUPP);
1813 #if !OPAQUE_UPP_TYPES
1814 #ifdef __cplusplus
1815 inline OSStatus InvokeControlColorUPP(ControlRef inControl, SInt16 inMessage,
1816  SInt16 inDrawDepth, Boolean inDrawInColor,
1817  ControlColorUPP userUPP)
1818 {
1819  return (OSStatus)CALL_FOUR_PARAMETER_UPP(userUPP, uppControlColorProcInfo,
1820  inControl, inMessage, inDrawDepth,
1821  inDrawInColor);
1822 }
1823 #else
1824 #define InvokeControlColorUPP(inControl, inMessage, inDrawDepth, \
1825  inDrawInColor, userUPP) \
1826  (OSStatus) \
1827  CALL_FOUR_PARAMETER_UPP((userUPP), uppControlColorProcInfo, (inControl), \
1828  (inMessage), (inDrawDepth), (inDrawInColor))
1829 #endif
1830 #endif
1831 
1832 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
1833 /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
1834 #define NewControlColorProc(userRoutine) NewControlColorUPP(userRoutine)
1835 #define CallControlColorProc(userRoutine, inControl, inMessage, inDrawDepth, \
1836  inDrawInColor) \
1837  InvokeControlColorUPP(inControl, inMessage, inDrawDepth, inDrawInColor, \
1838  userRoutine)
1839 #endif /* CALL_NOT_IN_CARBON */
1840 
1887 OSStatus
1888 SetControlColorProc(ControlRef inControl, ControlColorUPP inProc);
1889 
1890 /*��������������������������������������������������������������������������������������*/
1891 /* � Control Mousing */
1892 /*��������������������������������������������������������������������������������������*/
1912 ControlPartCode
1913 TrackControl(
1914  ControlRef theControl, Point startPoint,
1915  ControlActionUPP actionProc) /* can be NULL */;
1916 
1925 void DragControl(ControlRef theControl, Point startPoint, const Rect *limitRect,
1926  const Rect *slopRect, DragConstraint axis);
1927 
1936 ControlPartCode
1937 TestControl(ControlRef theControl, Point testPoint);
1938 
1947 ControlPartCode
1948 FindControl(Point testPoint, WindowRef theWindow, ControlRef *theControl);
1949 
1950 /* The following mousing routines available only with Appearance 1.0 and later
1951  */
1952 /* */
1953 /* HandleControlClick is preferable to TrackControl when running under */
1954 /* Appearance 1.0 as you can pass in modifiers, which some of the new controls
1955  */
1956 /* use, such as edit text and list boxes. */
1965 ControlRef
1966 FindControlUnderMouse(Point inWhere, WindowRef inWindow,
1967  ControlPartCode *outPart);
1968 
1977 ControlPartCode
1978 HandleControlClick(
1979  ControlRef inControl, Point inWhere, EventModifiers inModifiers,
1980  ControlActionUPP inAction) /* can be NULL */;
1981 
1982 /* Contextual Menu support in the Control Manager is only available on Carbon.
1983  */
1984 /* If the control didn't display a contextual menu (possibly because the point
1985  */
1986 /* was in a non-interesting part), the menuDisplayed output parameter will be */
1987 /* false. If the control did display a menu, menuDisplayed will be true. */
1988 /* This in on Carbon only */
1997 OSStatus
1999  Boolean *menuDisplayed);
2000 
2001 /* Some complex controls (like Data Browser) require proper sequencing of */
2002 /* window activation and click processing. In some cases, the control might */
2003 /* want the window to be left inactive yet still handle the click, or vice- */
2004 /* versa. The GetControlClickActivation routine lets a control client ask the */
2005 /* control how it wishes to behave for a particular click. */
2006 /* This in on Carbon only. */
2015 OSStatus
2017  EventModifiers inModifiers,
2018  ClickActivationResult *outResult);
2019 
2020 /*��������������������������������������������������������������������������������������*/
2021 /* � Control Events (available only with Appearance 1.0 and later) */
2022 /*��������������������������������������������������������������������������������������*/
2031 ControlPartCode
2032 HandleControlKey(ControlRef inControl, SInt16 inKeyCode, SInt16 inCharCode,
2033  EventModifiers inModifiers);
2034 
2043 void IdleControls(WindowRef inWindow);
2044 
2045 /*��������������������������������������������������������������������������������������*/
2046 /* � Control Mouse Tracking (available with Carbon) */
2047 /*��������������������������������������������������������������������������������������*/
2048 /* The HandleControlSetCursor routine requests that a given control set the
2049  * cursor to */
2050 /* something appropriate based on the mouse location. */
2051 /* If the control didn't want to set the cursor (because the point was in a */
2052 /* non-interesting part), the cursorWasSet output parameter will be false. If
2053  * the */
2054 /* control did set the cursor, cursorWasSet will be true. */
2055 /* Carbon only. */
2064 OSStatus
2066  EventModifiers modifiers, Boolean *cursorWasSet);
2067 
2068 /*��������������������������������������������������������������������������������������*/
2069 /* � Control Positioning */
2070 /*��������������������������������������������������������������������������������������*/
2079 void MoveControl(ControlRef theControl, SInt16 h, SInt16 v);
2080 
2089 void SizeControl(ControlRef theControl, SInt16 w, SInt16 h);
2090 
2091 /*��������������������������������������������������������������������������������������*/
2092 /* � Control Title */
2093 /*��������������������������������������������������������������������������������������*/
2102 void SetControlTitle(ControlRef theControl, ConstStr255Param title);
2103 
2113 
2122 OSStatus
2123 SetControlTitleWithCFString(ControlRef inControl, CFStringRef inString);
2124 
2133 OSStatus
2134 CopyControlTitleAsCFString(ControlRef inControl, CFStringRef *outString);
2135 
2136 /*��������������������������������������������������������������������������������������*/
2137 /* � Control Value */
2138 /*��������������������������������������������������������������������������������������*/
2147 SInt16
2149 
2158 void SetControlValue(ControlRef theControl, SInt16 newValue);
2159 
2168 SInt16
2170 
2179 void SetControlMinimum(ControlRef theControl, SInt16 newMinimum);
2180 
2189 SInt16
2191 
2200 void SetControlMaximum(ControlRef theControl, SInt16 newMaximum);
2201 
2202 /* proportional scrolling/32-bit value support is new with Appearance 1.1*/
2203 
2212 SInt32
2214 
2223 void SetControlViewSize(ControlRef theControl, SInt32 newViewSize);
2224 
2233 SInt32
2235 
2245 
2254 SInt32
2256 
2266 
2275 SInt32
2277 
2287 
2302 Boolean
2304 
2305 /*��������������������������������������������������������������������������������������*/
2306 /* � Control IDs */
2307 /* Carbon only. */
2308 /*��������������������������������������������������������������������������������������*/
2310 {
2311  OSType signature;
2312  SInt32 id;
2313 };
2314 typedef struct ControlID ControlID;
2323 OSStatus
2324 SetControlID(ControlRef inControl, const ControlID *inID);
2325 
2334 OSStatus
2335 GetControlID(ControlRef inControl, ControlID *outID);
2336 
2345 OSStatus
2346 GetControlByID(WindowRef inWindow, const ControlID *inID,
2347  ControlRef *outControl);
2348 
2349 /*��������������������������������������������������������������������������������������*/
2350 /* � Control Command IDs */
2351 /* Carbon only. */
2352 /*��������������������������������������������������������������������������������������*/
2361 OSStatus
2362 SetControlCommandID(ControlRef inControl, UInt32 inCommandID);
2363 
2372 OSStatus
2373 GetControlCommandID(ControlRef inControl, UInt32 *outCommandID);
2374 
2375 /*��������������������������������������������������������������������������������������*/
2376 /* � Control Identification */
2377 /* Carbon only. */
2378 /*��������������������������������������������������������������������������������������*/
2380 {
2381  OSType signature;
2382  OSType kind;
2383 };
2384 typedef struct ControlKind ControlKind;
2385 
2390 enum
2391 {
2392 
2396  kControlKindSignatureApple = FOUR_CHAR_CODE('appl')
2397 };
2398 
2424 OSStatus
2425 GetControlKind(ControlRef inControl, ControlKind *outControlKind);
2426 
2427 /*��������������������������������������������������������������������������������������*/
2428 /* � Properties */
2429 /*��������������������������������������������������������������������������������������*/
2430 enum
2431 {
2432  kControlPropertyPersistent = 0x00000001 /* whether this property gets saved
2433  when flattening the control*/
2434 };
2435 
2444 OSStatus
2445 GetControlProperty(ControlRef control, OSType propertyCreator,
2446  OSType propertyTag, UInt32 bufferSize, UInt32 *actualSize,
2447  void *propertyBuffer);
2448 
2457 OSStatus
2458 GetControlPropertySize(ControlRef control, OSType propertyCreator,
2459  OSType propertyTag, UInt32 *size);
2460 
2469 OSStatus
2470 SetControlProperty(ControlRef control, OSType propertyCreator,
2471  OSType propertyTag, UInt32 propertySize, void *propertyData);
2472 
2481 OSStatus
2482 RemoveControlProperty(ControlRef control, OSType propertyCreator,
2483  OSType propertyTag);
2484 
2493 OSStatus
2494 GetControlPropertyAttributes(ControlRef control, OSType propertyCreator,
2495  OSType propertyTag, UInt32 *attributes);
2496 
2505 OSStatus
2506 ChangeControlPropertyAttributes(ControlRef control, OSType propertyCreator,
2507  OSType propertyTag, UInt32 attributesToSet,
2508  UInt32 attributesToClear);
2509 
2510 /*��������������������������������������������������������������������������������������*/
2511 /* � Control Regions (Appearance 1.1 or later) */
2512 /* */
2513 /* See the discussion on meta-parts in this header for more information */
2514 /*��������������������������������������������������������������������������������������*/
2523 OSStatus
2524 GetControlRegion(ControlRef inControl, ControlPartCode inPart,
2525  RgnHandle outRegion);
2526 
2527 /*��������������������������������������������������������������������������������������*/
2528 /* � Control Variant */
2529 /*��������������������������������������������������������������������������������������*/
2538 ControlVariant
2540 
2541 /*��������������������������������������������������������������������������������������*/
2542 /* � Control Action */
2543 /*��������������������������������������������������������������������������������������*/
2552 void SetControlAction(ControlRef theControl, ControlActionUPP actionProc);
2553 
2562 ControlActionUPP
2564 
2565 /*��������������������������������������������������������������������������������������*/
2566 /* � Control Accessors */
2567 /*��������������������������������������������������������������������������������������*/
2577 
2586 SInt32
2588 
2589 #if !OPAQUE_TOOLBOX_STRUCTS
2590 #if CALL_NOT_IN_CARBON
2599 Boolean
2601 
2602 #endif /* CALL_NOT_IN_CARBON */
2603 
2604 #endif /* !OPAQUE_TOOLBOX_STRUCTS */
2605 
2606 #if CALL_NOT_IN_CARBON
2616 
2617 /*��������������������������������������������������������������������������������������*/
2618 /* � Control Hierarchy (Appearance 1.0 and later only) */
2619 /*��������������������������������������������������������������������������������������*/
2620 #endif /* CALL_NOT_IN_CARBON */
2621 
2630 SInt32
2631 SendControlMessage(ControlRef inControl, SInt16 inMessage, void *inParam);
2632 
2641 OSErr DumpControlHierarchy(WindowRef inWindow, const FSSpec *inDumpFile);
2642 
2669  WindowRef inWindow,
2670  ControlRef *outControl) /* can be NULL */;
2671 
2680 OSErr GetRootControl(WindowRef inWindow, ControlRef *outControl);
2681 
2690 OSErr EmbedControl(ControlRef inControl, ControlRef inContainer);
2691 
2700 OSErr AutoEmbedControl(ControlRef inControl, WindowRef inWindow);
2701 
2710 OSErr GetSuperControl(ControlRef inControl, ControlRef *outParent);
2711 
2720 OSErr CountSubControls(ControlRef inControl, UInt16 *outNumChildren);
2721 
2730 OSErr GetIndexedSubControl(ControlRef inControl, UInt16 inIndex,
2731  ControlRef *outSubControl);
2732 
2741 OSErr SetControlSupervisor(ControlRef inControl, ControlRef inBoss);
2742 
2743 /*��������������������������������������������������������������������������������������*/
2744 /* � Keyboard Focus (available only with Appearance 1.0 and later) */
2745 /*��������������������������������������������������������������������������������������*/
2754 OSErr GetKeyboardFocus(WindowRef inWindow, ControlRef *outControl);
2755 
2764 OSErr SetKeyboardFocus(WindowRef inWindow, ControlRef inControl,
2765  ControlFocusPart inPart);
2766 
2776 
2786 
2796 
2797 /*��������������������������������������������������������������������������������������*/
2798 /* � Control Data (available only with Appearance 1.0 and later) */
2799 /*��������������������������������������������������������������������������������������*/
2800 
2809 OSErr GetControlFeatures(ControlRef inControl, UInt32 *outFeatures);
2810 
2819 OSErr SetControlData(ControlRef inControl, ControlPartCode inPart, ResType inTagName,
2820  Size inSize, const void *inData);
2821 
2830 OSErr GetControlData(ControlRef inControl, ControlPartCode inPart, ResType inTagName,
2831  Size inBufferSize, void *inBuffer, Size *outActualSize);
2832 
2841 OSErr GetControlDataSize(ControlRef inControl, ControlPartCode inPart,
2842  ResType inTagName, Size *outMaxSize);
2843 
2844 /*��������������������������������������������������������������������������������������*/
2845 /* � Control Drag & Drop */
2846 /* Carbon only. */
2847 /*��������������������������������������������������������������������������������������*/
2848 /* some simple redefinitions of the similar values found in the Drag header*/
2849 enum
2850 {
2851  kDragTrackingEnterControl = 2,
2852  kDragTrackingInControl = 3,
2853  kDragTrackingLeaveControl = 4
2854 };
2855 
2864 OSStatus
2866  DragReference inDrag, Boolean *outLikesDrag);
2867 
2876 OSStatus
2878 
2887 OSStatus
2889 
2898 OSStatus
2900 
2909 OSStatus
2911  Boolean tracks);
2912 
2921 OSStatus
2923  Boolean *tracks);
2924 
2925 #if !TARGET_OS_MAC
2926 /*��������������������������������������������������������������������������������������*/
2927 /* � QuickTime 3.0 Win32/unix notification mechanism */
2928 /*��������������������������������������������������������������������������������������*/
2929 /* Proc used to notify window that something happened to the control*/
2930 typedef CALLBACK_API_C(void, ControlNotificationProcPtr)(
2932  ControlNotification notification, long param1, long param2);
2939 typedef CALLBACK_API_C(Boolean, PreFilterEventProc)(ControlRef theControl,
2941 #if CALL_NOT_IN_CARBON
2951 
2960 ControlRef
2962 
2963 #define GetControlRefFromCookie GetControlHandleFromCookie
2972 void SetControlDefProc(short resID, ControlDefProcPtr proc);
2973 
2974 #endif /* CALL_NOT_IN_CARBON */
2975 
2976 typedef ControlNotificationProcPtr ControlNotificationUPP;
2977 #endif /* !TARGET_OS_MAC */
2978 
2979 /*��������������������������������������������������������������������������������������*/
2980 /* � C Glue */
2981 /*��������������������������������������������������������������������������������������*/
2982 #if CALL_NOT_IN_CARBON
2983 #if CALL_NOT_IN_CARBON
2993  const Rect *slopRect, short axis);
2994 
3003 ControlRef
3004 newcontrol(WindowRef theWindow, const Rect *boundsRect, const char *title,
3005  Boolean visible, short value, short min, short max, short procID,
3006  long refCon);
3007 
3017 
3027 
3036 void setcontroltitle(ControlRef theControl, const char *title);
3037 
3047  ControlActionUPP actionProc);
3048 
3058 
3059 #endif /* CALL_NOT_IN_CARBON */
3060 
3061 #endif /* CALL_NOT_IN_CARBON */
3062 
3063 #if OLDROUTINENAMES
3064 /*��������������������������������������������������������������������������������������*/
3065 /* � OLDROUTINENAMES */
3066 /*��������������������������������������������������������������������������������������*/
3067 enum
3068 {
3069  useWFont = kControlUsesOwningWindowsFontVariant
3070 };
3071 
3072 enum
3073 {
3074  inThumb = kControlIndicatorPart,
3075  kNoHiliteControlPart = kControlNoPart,
3076  kInIndicatorControlPart = kControlIndicatorPart,
3077  kReservedControlPart = kControlDisabledPart,
3078  kControlInactiveControlPart = kControlInactivePart
3079 };
3080 
3081 #define SetCTitle(theControl, title) SetControlTitle(theControl, title)
3082 #define GetCTitle(theControl, title) GetControlTitle(theControl, title)
3083 #define UpdtControl(theWindow, updateRgn) UpdateControls(theWindow, updateRgn)
3084 #define SetCtlValue(theControl, theValue) SetControlValue(theControl, theValue)
3085 #define GetCtlValue(theControl) GetControlValue(theControl)
3086 #define SetCtlMin(theControl, minValue) SetControlMinimum(theControl, minValue)
3087 #define GetCtlMin(theControl) GetControlMinimum(theControl)
3088 #define SetCtlMax(theControl, maxValue) SetControlMaximum(theControl, maxValue)
3089 #define GetCtlMax(theControl) GetControlMaximum(theControl)
3090 #define GetAuxCtl(theControl, acHndl) \
3091  GetAuxiliaryControlRecord(theControl, acHndl)
3092 #define SetCRefCon(theControl, data) SetControlReference(theControl, data)
3093 #define GetCRefCon(theControl) GetControlReference(theControl)
3094 #define SetCtlAction(theControl, actionProc) \
3095  SetControlAction(theControl, actionProc)
3096 #define GetCtlAction(theControl) GetControlAction(theControl)
3097 #define SetCtlColor(theControl, newColorTable) \
3098  SetControlColor(theControl, newColorTable)
3099 #define GetCVariant(theControl) GetControlVariant(theControl)
3100 #define getctitle(theControl, title) getcontroltitle(theControl, title)
3101 #define setctitle(theControl, title) setcontroltitle(theControl, title)
3102 #endif /* OLDROUTINENAMES */
3103 
3104 #if ACCESSOR_CALLS_ARE_FUNCTIONS
3105 /* Getters */
3114 Rect *
3115 GetControlBounds(ControlRef control, Rect *bounds);
3116 
3125 Boolean
3126 IsControlHilited(ControlRef control);
3127 
3136 UInt16
3137 GetControlHilite(ControlRef control);
3138 
3147 WindowRef
3148 GetControlOwner(ControlRef control);
3149 
3158 Handle
3159 GetControlDataHandle(ControlRef control);
3160 
3169 MenuRef
3170 GetControlPopupMenuHandle(ControlRef control);
3171 
3172 #define GetControlPopupMenuRef GetControlPopupMenuHandle
3181 short GetControlPopupMenuID(ControlRef control);
3182 
3183 /* Setters */
3192 void SetControlDataHandle(ControlRef control, Handle dataHandle);
3193 
3202 void SetControlBounds(ControlRef control, const Rect *bounds);
3203 
3212 void SetControlPopupMenuHandle(ControlRef control, MenuRef popupMenu);
3213 
3214 #define SetControlPopupMenuRef SetControlPopupMenuHandle
3223 void SetControlPopupMenuID(ControlRef control, short menuID);
3224 
3225 #endif /* ACCESSOR_CALLS_ARE_FUNCTIONS */
3226 
3227 #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
3228 #define GetControlListFromWindow(theWindow) \
3229  (*(ControlRef *)(((UInt8 *)theWindow) + sizeof(GrafPort) + 0x20))
3230 #define GetControlOwningWindowControlList(theWindow) \
3231  (*(ControlRef *)(((UInt8 *)theWindow) + sizeof(GrafPort) + 0x20))
3232 #endif /* !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS */
3233 
3234 #if PRAGMA_STRUCT_ALIGN
3235 #pragma options align = reset
3236 #elif PRAGMA_STRUCT_PACKPUSH
3237 #pragma pack(pop)
3238 #elif PRAGMA_STRUCT_PACK
3239 #pragma pack()
3240 #endif
3241 
3242 #ifdef PRAGMA_IMPORT_OFF
3243 #pragma import off
3244 #elif PRAGMA_IMPORT
3245 #pragma import reset
3246 #endif
3247 
3248 #ifdef __cplusplus
3249 }
3250 #endif
3251 
3252 #endif /* __CONTROLS__ */
3253 */);
3254 
3263 void SetControlBounds(ControlRef control, const Rect *bounds);
3264 
3274 
3275 #define SetControlPopupMenuRef SetControlPopupMenuHandle
3284 void SetControlPopupMenuID(ControlRef control, short menuID);
3285 
3286 #endif /* ACCESSOR_CALLS_ARE_FUNCTIONS */
3287 
3288 #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
3289 #define GetControlListFromWindow(theWindow) \
3290  (*(ControlRef *)(((UInt8 *)theWindow) + sizeof(GrafPort) + 0x20))
3291 #define GetControlOwningWindowControlList(theWindow) \
3292  (*(ControlRef *)(((UInt8 *)theWindow) + sizeof(GrafPort) + 0x20))
3293 #endif /* !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS */
3294 
3295 #if PRAGMA_STRUCT_ALIGN
3296 #pragma options align = reset
3297 #elif PRAGMA_STRUCT_PACKPUSH
3298 #pragma pack(pop)
3299 #elif PRAGMA_STRUCT_PACK
3300 #pragma pack()
3301 #endif
3302 
3303 #ifdef PRAGMA_IMPORT_OFF
3304 #pragma import off
3305 #elif PRAGMA_IMPORT
3306 #pragma import reset
3307 #endif
3308 
3309 #ifdef __cplusplus
3310 }
3311 #endif
3312 
3313 #endif /* __CONTROLS__ */
Collection Manager Interfaces.
struct OpaqueCollection * Collection
Definition: Collections.h:158
OSStatus GetControlPropertyAttributes(ControlRef control, OSType propertyCreator, OSType propertyTag, UInt32 *attributes)
OSErr CountSubControls(ControlRef inControl, UInt16 *outNumChildren)
EndUpdate(updtWin)
Draw all controls visible in a window.
OSStatus CreateCustomControl(WindowRef owningWindow, const Rect *contBounds, const ControlDefSpec *def, Collection initData, ControlRef *outControl)
OSStatus GetControlKind(ControlRef inControl, ControlKind *outControlKind)
OSStatus SetControlProperty(ControlRef control, OSType propertyCreator, OSType propertyTag, UInt32 propertySize, void *propertyData)
void SetControlReference(ControlRef theControl, SInt32 data)
OSErr GetControlFeatures(ControlRef inControl, UInt32 *outFeatures)
OSErr EmbedControl(ControlRef inControl, ControlRef inContainer)
void SetControlMinimum(ControlRef theControl, SInt16 newMinimum)
void HiliteControl(ControlRef theControl, ControlPartCode hiliteState)
short trackcontrol(ControlRef theControl, Point *thePoint, ControlActionUPP actionProc)
typedef CALLBACK_API(OSStatus, ControlColorProcPtr)(ControlRef inControl
SInt32 GetControl32BitMaximum(ControlRef theControl)
OSErr ActivateControl(ControlRef inControl)
OSErr GetControlData(ControlRef inControl, ControlPartCode inPart, ResType inTagName, Size inBufferSize, void *inBuffer, Size *outActualSize)
void SetControlColor(ControlRef theControl, CCTabHandle newColorTable)
ControlKeyFilterResult InvokeControlKeyFilterUPP(ControlRef theControl, SInt16 *keyCode, SInt16 *charCode, EventModifiers *modifiers, ControlKeyFilterUPP userUPP)
OSStatus HandleControlDragReceive(ControlRef inControl, DragReference inDrag)
void SetControlTitle(ControlRef theControl, ConstStr255Param title)
OSErr ClearKeyboardFocus(WindowRef inWindow)
OSErr SetControlVisibility(ControlRef inControl, Boolean inIsVisible, Boolean inDoDraw)
OSErr AutoEmbedControl(ControlRef inControl, WindowRef inWindow)
ControlActionUPP NewControlActionUPP(ControlActionProcPtr userRoutine)
void KillControls(WindowRef theWindow)
SInt32 SendControlMessage(ControlRef inControl, SInt16 inMessage, void *inParam)
void getcontroltitle(ControlRef theControl, char *title)
SInt32 InvokeControlDefUPP(SInt16 varCode, ControlRef theControl, ControlDefProcMessage message, SInt32 param, ControlDefUPP userUPP)
OSStatus SetControlDragTrackingEnabled(ControlRef theControl, Boolean tracks)
short findcontrol(Point *thePoint, WindowRef theWindow, ControlRef *theControl)
void SetControlPopupMenuID(ControlRef control, short menuID)
void setcontroltitle(ControlRef theControl, const char *title)
void DisposeControlDefUPP(ControlDefUPP userUPP)
OSErr ReverseKeyboardFocus(WindowRef inWindow)
OSStatus GetControlPropertySize(ControlRef control, OSType propertyCreator, OSType propertyTag, UInt32 *size)
SInt32 GetControlViewSize(ControlRef theControl)
void ShowControl(ControlRef theControl)
SInt16 GetControlMinimum(ControlRef theControl)
UInt32 ControlNotification
Definition: Controls.h:111
OSErr GetRootControl(WindowRef inWindow, ControlRef *outControl)
OSErr GetKeyboardFocus(WindowRef inWindow, ControlRef *outControl)
SInt32 GetControl32BitMinimum(ControlRef theControl)
ControlCNTLToCollectionUPP NewControlCNTLToCollectionUPP(ControlCNTLToCollectionProcPtr userRoutine)
OSStatus InvokeControlCNTLToCollectionUPP(const Rect *bounds, SInt16 value, Boolean visible, SInt16 max, SInt16 min, SInt16 procID, SInt32 refCon, ConstStr255Param title, Collection collection, ControlCNTLToCollectionUPP userUPP)
Boolean GetAuxiliaryControlRecord(ControlRef theControl, AuxCtlHandle *acHndl)
void SetControlViewSize(ControlRef theControl, SInt32 newViewSize)
void HideControl(ControlRef theControl)
OSErr AdvanceKeyboardFocus(WindowRef inWindow)
SInt32 GetControl32BitValue(ControlRef theControl)
SInt32 GetControlReference(ControlRef theControl)
void SetControl32BitMaximum(ControlRef theControl, SInt32 newMaximum)
OSStatus SetControlID(ControlRef inControl, const ControlID *inID)
OSStatus SetControlCommandID(ControlRef inControl, UInt32 inCommandID)
OSStatus DisableControl(ControlRef inControl)
short testcontrol(ControlRef theControl, Point *thePt)
OSStatus EnableControl(ControlRef inControl)
void SizeControl(ControlRef theControl, SInt16 w, SInt16 h)
ControlRef GetControlHandleFromCookie(long cookie)
OSStatus SetControlTitleWithCFString(ControlRef inControl, CFStringRef inString)
OSStatus GetControlProperty(ControlRef control, OSType propertyCreator, OSType propertyTag, UInt32 bufferSize, UInt32 *actualSize, void *propertyBuffer)
void SetControlPopupMenuHandle(ControlRef control, MenuRef popupMenu)
@ kControlKindSignatureApple
Definition: Controls.h:2396
OSErr GetIndexedSubControl(ControlRef inControl, UInt16 inIndex, ControlRef *outSubControl)
OSStatus SetAutomaticControlDragTrackingEnabledForWindow(WindowRef theWindow, Boolean tracks)
OSErr GetSuperControl(ControlRef inControl, ControlRef *outParent)
OSStatus HandleControlSetCursor(ControlRef control, Point localPoint, EventModifiers modifiers, Boolean *cursorWasSet)
OSStatus GetControlID(ControlRef inControl, ControlID *outID)
OSStatus CopyControlTitleAsCFString(ControlRef inControl, CFStringRef *outString)
void GetControlTitle(ControlRef theControl, Str255 title)
void SetControl32BitMinimum(ControlRef theControl, SInt32 newMinimum)
void SetControlAction(ControlRef theControl, ControlActionUPP actionProc)
Boolean IsControlActive(ControlRef inControl)
ControlKeyFilterUPP NewControlKeyFilterUPP(ControlKeyFilterProcPtr userRoutine)
ControlRef NewControl(WindowRef owningWindow, const Rect *boundsRect, ConstStr255Param controlTitle, Boolean initiallyVisible, SInt16 initialValue, SInt16 minimumValue, SInt16 maximumValue, SInt16 procID, SInt32 controlReference)
OSErr DumpControlHierarchy(WindowRef inWindow, const FSSpec *inDumpFile)
Boolean IsValidControlHandle(ControlRef theControl)
OSStatus HandleControlContextualMenuClick(ControlRef inControl, Point inWhere, Boolean *menuDisplayed)
void dragcontrol(ControlRef theControl, Point *startPt, const Rect *limitRect, const Rect *slopRect, short axis)
ControlVariant GetControlVariant(ControlRef theControl)
ControlPartCode HandleControlKey(ControlRef inControl, SInt16 inKeyCode, SInt16 inCharCode, EventModifiers inModifiers)
ControlActionUPP GetControlAction(ControlRef theControl)
Boolean IsControlVisible(ControlRef inControl)
OSStatus GetControlClickActivation(ControlRef inControl, Point inWhere, EventModifiers inModifiers, ClickActivationResult *outResult)
OSStatus IsControlDragTrackingEnabled(ControlRef theControl, Boolean *tracks)
void SetControl32BitValue(ControlRef theControl, SInt32 newValue)
void SetControlDefProc(short resID, ControlDefProcPtr proc)
OSStatus GetControlCommandID(ControlRef inControl, UInt32 *outCommandID)
*void SetControlBounds(ControlRef control, const Rect *bounds)
void IdleControls(WindowRef inWindow)
OSStatus RemoveControlProperty(ControlRef control, OSType propertyCreator, OSType propertyTag)
void DisposeControlKeyFilterUPP(ControlKeyFilterUPP userUPP)
void DisposeControl(ControlRef theControl)
OSStatus GetControlByID(WindowRef inWindow, const ControlID *inID, ControlRef *outControl)
OSErr SetControlSupervisor(ControlRef inControl, ControlRef inBoss)
OSErr SetControlData(ControlRef inControl, ControlPartCode inPart, ResType inTagName, Size inSize, const void *inData)
OSErr SetKeyboardFocus(WindowRef inWindow, ControlRef inControl, ControlFocusPart inPart)
void DisposeControlActionUPP(ControlActionUPP userUPP)
void SetControlMaximum(ControlRef theControl, SInt16 newMaximum)
void DisposeControlCNTLToCollectionUPP(ControlCNTLToCollectionUPP userUPP)
ControlRef newcontrol(WindowRef theWindow, const Rect *boundsRect, const char *title, Boolean visible, short value, short min, short max, short procID, long refCon)
SInt16 GetControlMaximum(ControlRef theControl)
void SetControlValue(ControlRef theControl, SInt16 newValue)
void InvokeControlActionUPP(ControlRef theControl, ControlPartCode partCode, ControlActionUPP userUPP)
OSErr GetControlDataSize(ControlRef inControl, ControlPartCode inPart, ResType inTagName, Size *outMaxSize)
ControlRef GetNewControl(SInt16 resourceID, WindowRef owningWindow)
@ kControlKindTag
Definition: Controls.h:597
@ kControlSizeTag
Definition: Controls.h:603
typedef CALLBACK_API_C(Boolean, PreFilterEventProc)(ControlRef theControl
OSStatus IsAutomaticControlDragTrackingEnabledForWindow(WindowRef theWindow, Boolean *tracks)
OSErr CreateRootControl(WindowRef inWindow, ControlRef *outControl)
OSStatus RegisterControlDefinition(SInt16 inCDEFResID, const ControlDefSpec *inControlDef, ControlCNTLToCollectionUPP inConversionProc)
OSStatus GetControlRegion(ControlRef inControl, ControlPartCode inPart, RgnHandle outRegion)
OSStatus ChangeControlPropertyAttributes(ControlRef control, OSType propertyCreator, OSType propertyTag, UInt32 attributesToSet, UInt32 attributesToClear)
SInt16 GetControlValue(ControlRef theControl)
void MoveControl(ControlRef theControl, SInt16 h, SInt16 v)
long GetControlComponentInstance(ControlRef theControl)
OSErr DeactivateControl(ControlRef inControl)
ControlDefUPP NewControlDefUPP(ControlDefProcPtr userRoutine)
OSStatus HandleControlDragTracking(ControlRef inControl, DragTrackingMessage inMessage, DragReference inDrag, Boolean *outLikesDrag)
Boolean IsControlEnabled(ControlRef inControl)
Drag and Drop Interfaces.
DragRef DragReference
Definition: Drag.h:1472
SInt16 DragTrackingMessage
Definition: Drag.h:254
UInt16 EventModifiers
Definition: Events.h:145
Icon Utilities and Icon Services Interfaces.
OSErr codes.
Basic Macintosh data types.
unsigned char Boolean
Definition: MacTypes.h:318
Menu Manager Interfaces.
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
Interface to Quickdraw Graphics.
TextEdit Interfaces.
Definition: Controls.h:301
Definition: Icons.h:537
Definition: Quickdraw.h:1960
Definition: Controls.h:808
Definition: Controls.h:796
Definition: Controls.h:445
Definition: Controls.h:783
Definition: Controls.h:862
Definition: Controls.h:848
Definition: Controls.h:770
Definition: Controls.h:1104
Definition: Controls.h:540
Definition: Controls.h:821
Definition: Controls.h:2310
Definition: Controls.h:757
Definition: Controls.h:2380
Definition: Controls.h:165
Definition: Controls.h:833
Definition: Controls.h:90
Definition: Controls.h:745
Definition: Controls.h:287
Definition: Events.h:224
Definition: Quickdraw.h:1648
Definition: Controls.h:724
Definition: Quickdraw.h:306
Definition: Menus.h:753
Definition: Quickdraw.h:326
Definition: MacTypes.h:520
Definition: Quickdraw.h:1710
Definition: MacTypes.h:527
Definition: RAVE.h:426