1 {
2 File: HIToolbox/Controls.h
3
4 Contains: Control Manager interfaces
5
6 Version: HIToolbox-624~3
7
8 Copyright: � 1985-2008 by Apple Computer, Inc., all rights reserved
9
10 Bugs?: For bug reports, consult the following page on
11 the World Wide Web:
12
13 http://bugs.freepascal.org
14
15 }
16 { Pascal Translation Updated: Peter N Lewis, <peter@stairways.com.au>, August 2005 }
17 { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2009 }
18 { Pascal Translation Updated: Gorazd Krosl, <gorazd_1957@yahoo.ca>, October 2009 }
19 { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2012 }
20 {
21 Modified for use with Free Pascal
22 Version 308
23 Please report any bugs to <gpc@microbizz.nl>
24 }
25
26 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
27 {$mode macpas}
28 {$modeswitch cblocks}
29 {$packenum 1}
30 {$macro on}
31 {$inline on}
32 {$calling mwpascal}
33
34 unit Controls;
35 interface
36 {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
37 {$setc GAP_INTERFACES_VERSION := $0308}
38
39 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
40 {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
41 {$endc}
42
43 {$ifc defined CPUPOWERPC and defined CPUI386}
44 {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
45 {$endc}
46 {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
47 {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
48 {$endc}
49
50 {$ifc not defined __ppc__ and defined CPUPOWERPC32}
51 {$setc __ppc__ := 1}
52 {$elsec}
53 {$setc __ppc__ := 0}
54 {$endc}
55 {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
56 {$setc __ppc64__ := 1}
57 {$elsec}
58 {$setc __ppc64__ := 0}
59 {$endc}
60 {$ifc not defined __i386__ and defined CPUI386}
61 {$setc __i386__ := 1}
62 {$elsec}
63 {$setc __i386__ := 0}
64 {$endc}
65 {$ifc not defined __x86_64__ and defined CPUX86_64}
66 {$setc __x86_64__ := 1}
67 {$elsec}
68 {$setc __x86_64__ := 0}
69 {$endc}
70 {$ifc not defined __arm__ and defined CPUARM}
71 {$setc __arm__ := 1}
72 {$elsec}
73 {$setc __arm__ := 0}
74 {$endc}
75 {$ifc not defined __arm64__ and defined CPUAARCH64}
76 {$setc __arm64__ := 1}
77 {$elsec}
78 {$setc __arm64__ := 0}
79 {$endc}
80
81 {$ifc defined cpu64}
82 {$setc __LP64__ := 1}
83 {$elsec}
84 {$setc __LP64__ := 0}
85 {$endc}
86
87
88 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
89 {$error Conflicting definitions for __ppc__ and __i386__}
90 {$endc}
91
92 {$ifc defined __ppc__ and __ppc__}
93 {$setc TARGET_CPU_PPC := TRUE}
94 {$setc TARGET_CPU_PPC64 := FALSE}
95 {$setc TARGET_CPU_X86 := FALSE}
96 {$setc TARGET_CPU_X86_64 := FALSE}
97 {$setc TARGET_CPU_ARM := FALSE}
98 {$setc TARGET_CPU_ARM64 := FALSE}
99 {$setc TARGET_OS_MAC := TRUE}
100 {$setc TARGET_OS_IPHONE := FALSE}
101 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
102 {$setc TARGET_OS_EMBEDDED := FALSE}
103 {$elifc defined __ppc64__ and __ppc64__}
104 {$setc TARGET_CPU_PPC := FALSE}
105 {$setc TARGET_CPU_PPC64 := TRUE}
106 {$setc TARGET_CPU_X86 := FALSE}
107 {$setc TARGET_CPU_X86_64 := FALSE}
108 {$setc TARGET_CPU_ARM := FALSE}
109 {$setc TARGET_CPU_ARM64 := FALSE}
110 {$setc TARGET_OS_MAC := TRUE}
111 {$setc TARGET_OS_IPHONE := FALSE}
112 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
113 {$setc TARGET_OS_EMBEDDED := FALSE}
114 {$elifc defined __i386__ and __i386__}
115 {$setc TARGET_CPU_PPC := FALSE}
116 {$setc TARGET_CPU_PPC64 := FALSE}
117 {$setc TARGET_CPU_X86 := TRUE}
118 {$setc TARGET_CPU_X86_64 := FALSE}
119 {$setc TARGET_CPU_ARM := FALSE}
120 {$setc TARGET_CPU_ARM64 := FALSE}
121 {$ifc defined iphonesim}
122 {$setc TARGET_OS_MAC := FALSE}
123 {$setc TARGET_OS_IPHONE := TRUE}
124 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
125 {$elsec}
126 {$setc TARGET_OS_MAC := TRUE}
127 {$setc TARGET_OS_IPHONE := FALSE}
128 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
129 {$endc}
130 {$setc TARGET_OS_EMBEDDED := FALSE}
131 {$elifc defined __x86_64__ and __x86_64__}
132 {$setc TARGET_CPU_PPC := FALSE}
133 {$setc TARGET_CPU_PPC64 := FALSE}
134 {$setc TARGET_CPU_X86 := FALSE}
135 {$setc TARGET_CPU_X86_64 := TRUE}
136 {$setc TARGET_CPU_ARM := FALSE}
137 {$setc TARGET_CPU_ARM64 := FALSE}
138 {$ifc defined iphonesim}
139 {$setc TARGET_OS_MAC := FALSE}
140 {$setc TARGET_OS_IPHONE := TRUE}
141 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
142 {$elsec}
143 {$setc TARGET_OS_MAC := TRUE}
144 {$setc TARGET_OS_IPHONE := FALSE}
145 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
146 {$endc}
147 {$setc TARGET_OS_EMBEDDED := FALSE}
148 {$elifc defined __arm__ and __arm__}
149 {$setc TARGET_CPU_PPC := FALSE}
150 {$setc TARGET_CPU_PPC64 := FALSE}
151 {$setc TARGET_CPU_X86 := FALSE}
152 {$setc TARGET_CPU_X86_64 := FALSE}
153 {$setc TARGET_CPU_ARM := TRUE}
154 {$setc TARGET_CPU_ARM64 := FALSE}
155 {$setc TARGET_OS_MAC := FALSE}
156 {$setc TARGET_OS_IPHONE := TRUE}
157 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
158 {$setc TARGET_OS_EMBEDDED := TRUE}
159 {$elifc defined __arm64__ and __arm64__}
160 {$setc TARGET_CPU_PPC := FALSE}
161 {$setc TARGET_CPU_PPC64 := FALSE}
162 {$setc TARGET_CPU_X86 := FALSE}
163 {$setc TARGET_CPU_X86_64 := FALSE}
164 {$setc TARGET_CPU_ARM := FALSE}
165 {$setc TARGET_CPU_ARM64 := TRUE}
166 {$ifc defined ios}
167 {$setc TARGET_OS_MAC := FALSE}
168 {$setc TARGET_OS_IPHONE := TRUE}
169 {$setc TARGET_OS_EMBEDDED := TRUE}
170 {$elsec}
171 {$setc TARGET_OS_MAC := TRUE}
172 {$setc TARGET_OS_IPHONE := FALSE}
173 {$setc TARGET_OS_EMBEDDED := FALSE}
174 {$endc}
175 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
176 {$elsec}
177 {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
178 {$endc}
179
180 {$ifc defined __LP64__ and __LP64__ }
181 {$setc TARGET_CPU_64 := TRUE}
182 {$elsec}
183 {$setc TARGET_CPU_64 := FALSE}
184 {$endc}
185
186 {$ifc defined FPC_BIG_ENDIAN}
187 {$setc TARGET_RT_BIG_ENDIAN := TRUE}
188 {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
189 {$elifc defined FPC_LITTLE_ENDIAN}
190 {$setc TARGET_RT_BIG_ENDIAN := FALSE}
191 {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
192 {$elsec}
193 {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
194 {$endc}
195 {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
196 {$setc CALL_NOT_IN_CARBON := FALSE}
197 {$setc OLDROUTINENAMES := FALSE}
198 {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
199 {$setc OPAQUE_UPP_TYPES := TRUE}
200 {$setc OTCARBONAPPLICATION := TRUE}
201 {$setc OTKERNEL := FALSE}
202 {$setc PM_USE_SESSION_APIS := TRUE}
203 {$setc TARGET_API_MAC_CARBON := TRUE}
204 {$setc TARGET_API_MAC_OS8 := FALSE}
205 {$setc TARGET_API_MAC_OSX := TRUE}
206 {$setc TARGET_CARBON := TRUE}
207 {$setc TARGET_CPU_68K := FALSE}
208 {$setc TARGET_CPU_MIPS := FALSE}
209 {$setc TARGET_CPU_SPARC := FALSE}
210 {$setc TARGET_OS_UNIX := FALSE}
211 {$setc TARGET_OS_WIN32 := FALSE}
212 {$setc TARGET_RT_MAC_68881 := FALSE}
213 {$setc TARGET_RT_MAC_CFM := FALSE}
214 {$setc TARGET_RT_MAC_MACHO := TRUE}
215 {$setc TYPED_FUNCTION_POINTERS := TRUE}
216 {$setc TYPE_BOOL := FALSE}
217 {$setc TYPE_EXTENDED := FALSE}
218 {$setc TYPE_LONGLONG := TRUE}
219 uses MacTypes,Appearance,Collections,Drag,Events,Files,IconsCore,Icons,Menus,QuickdrawTypes,CFBase,CGImage,HIObject;
220 {$endc} {not MACOSALLINCLUDE}
221
222
223 {$ifc TARGET_OS_MAC}
224
225 {$ALIGN MAC68K}
226
227 {������������������������������������������������������������������������������������������������������}
228 { � Resource Types }
229 {������������������������������������������������������������������������������������������������������}
230 const
231 kControlDefProcType = FourCharCode('CDEF');
232 kControlTemplateResourceType = FourCharCode('CNTL');
233 kControlColorTableResourceType = FourCharCode('cctb');
234 kControlDefProcResourceType = FourCharCode('CDEF');
235
236 {������������������������������������������������������������������������������������������������������}
237 { � Format of a �CNTL� resource }
238 {������������������������������������������������������������������������������������������������������}
239 type
240 ControlTemplate = record
241 controlRect: Rect;
242 controlValue: SInt16;
243 controlVisible: Boolean;
244 fill: UInt8;
245 controlMaximum: SInt16;
246 controlMinimum: SInt16;
247 controlDefProcID: SInt16;
248 controlReference: SInt32;
249 controlTitle: Str255;
250 end;
251 ControlTemplatePtr = ^ControlTemplate;
252 type
253 ControlTemplateHandle = ^ControlTemplatePtr;
254
255
256 type
257 ControlPartCode = SInt16;
258 ControlPartCodePtr = ^ControlPartCode; { when a var xx:ControlPartCode parameter can be nil, it is changed to xx: ControlPartCodePtr }
259 {������������������������������������������������������������������������������������������������������}
260 { � Control ActionProcPtr }
261 {������������������������������������������������������������������������������������������������������}
262 type
263 ControlActionProcPtr = procedure( theControl: ControlRef; partCode: ControlPartCode );
264 type
265 ControlActionUPP = ControlActionProcPtr;
266
267 {������������������������������������������������������������������������������������������������������}
268 { � Control ActionProcPtr : Epilogue }
269 {������������������������������������������������������������������������������������������������������}
270 {
271 * NewControlActionUPP()
272 *
273 * Availability:
274 * Mac OS X: in version 10.0 and later in Carbon.framework
275 * CarbonLib: in CarbonLib 1.0 and later
276 * Non-Carbon CFM: available as macro/inline
277 }
NewControlActionUPPnull278 function NewControlActionUPP( userRoutine: ControlActionProcPtr ): ControlActionUPP; external name '_NewControlActionUPP';
279 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
280
281 {
282 * DisposeControlActionUPP()
283 *
284 * Availability:
285 * Mac OS X: in version 10.0 and later in Carbon.framework
286 * CarbonLib: in CarbonLib 1.0 and later
287 * Non-Carbon CFM: available as macro/inline
288 }
289 procedure DisposeControlActionUPP( userUPP: ControlActionUPP ); external name '_DisposeControlActionUPP';
290 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
291
292 {
293 * InvokeControlActionUPP()
294 *
295 * Availability:
296 * Mac OS X: in version 10.0 and later in Carbon.framework
297 * CarbonLib: in CarbonLib 1.0 and later
298 * Non-Carbon CFM: available as macro/inline
299 }
300 procedure InvokeControlActionUPP( theControl: ControlRef; partCode: ControlPartCode; userUPP: ControlActionUPP ); external name '_InvokeControlActionUPP';
301 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
302
303 {������������������������������������������������������������������������������������������������������}
304 { � Control Color Table }
305 {������������������������������������������������������������������������������������������������������}
306 const
307 cFrameColor = 0;
308 cBodyColor = 1;
309 cTextColor = 2;
310 cThumbColor = 3;
311 kNumberCtlCTabEntries = 4;
312
313 type
314 CtlCTabPtr = ^CtlCTab;
315 CtlCTab = record
316 ccSeed: SInt32;
317 ccRider: SInt16;
318 ctSize: SInt16;
319 ctTable: array [0..3] of ColorSpec;
320 end;
321 type
322 CCTabPtr = CtlCTabPtr;
323 type
324 CCTabHandle = ^CCTabPtr;
325
326 {��������������������������������������������������������������������������������������}
327 { � Control Variants }
328 {��������������������������������������������������������������������������������������}
329 type
330 ControlVariant = SInt16;
331 const
332 kControlNoVariant = 0; { No variant}
333 kControlUsesOwningWindowsFontVariant = 1 shl 3; { Control uses owning windows font to display text}
334
335
336 {��������������������������������������������������������������������������������������}
337 { � Control Part Codes }
338 {��������������������������������������������������������������������������������������}
339 { Basic part codes }
340 const
341 kControlNoPart = kAppearancePartMetaNone;
342 kControlIndicatorPart = kAppearancePartIndicator;
343 kControlDisabledPart = kAppearancePartMetaDisabled;
344 kControlInactivePart = kAppearancePartMetaInactive;
345
346 { Use this constant in Get/SetControlData when the data referred to is not }
347 { specific to a part, but rather the entire control, e.g. the list handle of a }
348 { list box control. }
349 const
350 kControlEntireControl = kControlNoPart;
351
352
353 {
354 * Control meta-parts
355 *
356 * Discussion:
357 * If you haven't guessed from looking at other toolbox headers, we
358 * like the word 'meta'. It's cool. So here's one more for you. A
359 * meta-part is a part used in a call to the GetControlRegion API.
360 * These parts might be defined by a control, but should not be
361 * returned from calls such as TestControl, et al. They define a
362 * region of a control.
363 *
364 * Along with these parts, you can also pass in normal part codes to
365 * get the regions of the parts. Not all controls fully support this
366 * at the time this was written.
367 }
368 const
369 {
370 * The entire area that the control will draw into. When a composited
371 * control is drawn, the Control Manager clips the control's drawing
372 * to the structure area. This area may extend beyond the bounds of
373 * the control (for example, if the control draws a focus ring
374 * outside of its bounds). You may return a superset of the drawn
375 * area if this is computationally easier to construct. This area is
376 * used to determine the area of a window that should be invalidated
377 * and redrawn when a control is invalidated. It is not necessary for
378 * a control to return a shape that precisely describes the structure
379 * area; for example, a control whose structure is an oval may simply
380 * return the oval's bounding rectangle. The default handler for the
381 * kEventControlGetPartRegion event will return the control's bounds
382 * when this part is requested.
383 }
384 kControlStructureMetaPart = -1;
385
386 {
387 * The area of the control in which embedded controls should be
388 * positioned. This part is only defined for controls that can
389 * contain other controls (for example, the group box). This area is
390 * largely informational and is not used by the Control Manager
391 * itself. The default handler for the kEventControlGetPartRegion
392 * event will return errInvalidPartCode when this part is requested.
393 }
394 kControlContentMetaPart = -2;
395
396 {
397 * The area of the control that, when drawn, is filled with opaque
398 * pixels. You may also return a subset of the opaque area if this is
399 * computationally easier to construct. If a control is contained in
400 * a composited window, the Control Manager will use this area to
401 * optimize drawing of other controls that intersect this area;
402 * controls that are entirely contained within the opaque area, and
403 * that are z-ordered underneath this control, will not be drawn at
404 * all, since any drawing would be completely overwritten by this
405 * control. The default handler for the kEventControlGetPartRegion
406 * event will return an empty area when this part is requested. This
407 * meta-part is available in Mac OS X 10.2 or later.
408 }
409 kControlOpaqueMetaPart = -3;
410
411 {
412 * The area of the control that causes a mouse event to be captured
413 * by that control. If a mouse event falls inside the control bounds
414 * but outside of this area, then the Control Manager will allow the
415 * event to pass through the control to the next control behind it in
416 * z-order. This area is used to determine which parts of a window
417 * should allow async window dragging when clicked (the draggable
418 * area is computed by subtracting the clickable areas of controls in
419 * the window from the window's total area). You can also customize
420 * the clickable area of a control if you want the control to have an
421 * effectively transparent area (for example, a control that draws
422 * multiple tabs might want clicks in the space between the tabs to
423 * fall through to the next control rather than be captured by the
424 * tab-drawing control). The default handler for the
425 * kEventControlGetPartRegion event will return the control's bounds
426 * when this part is requested. This meta-part is available in Mac OS
427 * X 10.3 or later.
428 }
429 kControlClickableMetaPart = -4;
430
431 { focusing part codes }
432 const
433 kControlFocusNoPart = kControlNoPart; { tells control to clear its focus}
434 kControlFocusNextPart = -1; { tells control to focus on the next part}
435 kControlFocusPrevPart = -2; { tells control to focus on the previous part}
436
437 type
438 ControlFocusPart = ControlPartCode;
439 {������������������������������������������������������������������������������������������������������}
440 { � Control Collection Tags }
441 {������������������������������������������������������������������������������������������������������}
442 { These are standard tags that you will find in the initial data Collection that is passed in the }
443 { 'param' parameter to the initCntl message, and in the kEventParamInitCollection parameter to the }
444 { kEventControlInitialize event (Carbon only). }
445 { All tags at ID zero in a control's Collection are reserved for Control Manager use. }
446 { Custom control definitions should use other IDs. }
447 { Most of these tags are interpreted when you call CreateCustomControl; the Control Manager will put }
448 { the value in the right place before calling the control definition with the initialization message. }
449
450
451 {
452 * Discussion:
453 * Control Collection Tags
454 }
455 const
456 {
457 * Rect - the bounding rectangle.
458 }
459 kControlCollectionTagBounds = FourCharCode('boun');
460
461 {
462 * SInt32 - the value
463 }
464 kControlCollectionTagValue = FourCharCode('valu');
465
466 {
467 * SInt32 - the minimum
468 }
469 kControlCollectionTagMinimum = FourCharCode('min ');
470
471 {
472 * SInt32 - the maximum
473 }
474 kControlCollectionTagMaximum = FourCharCode('max ');
475
476 {
477 * SInt32 - the view size
478 }
479 kControlCollectionTagViewSize = FourCharCode('view');
480
481 {
482 * Boolean - the visible state. Only interpreted on CarbonLib
483 * versions up through 1.5.x and Mac OS X versions 10.0.x. Not
484 * interpreted on CarbonLib 1.6 and later. Not interpreted on Mac OS
485 * 10.1 and later. We recommend you do not use this tag at all.
486 }
487 kControlCollectionTagVisibility = FourCharCode('visi');
488
489 {
490 * SRefCon - the refCon
491 }
492 kControlCollectionTagRefCon = FourCharCode('refc');
493
494 {
495 * arbitrarily sized character array - the title
496 }
497 kControlCollectionTagTitle = FourCharCode('titl');
498
499 {
500 * bytes as received via CFStringCreateExternalRepresentation
501 }
502 kControlCollectionTagUnicodeTitle = FourCharCode('uttl');
503
504 {
505 * OSType - the ControlID signature
506 }
507 kControlCollectionTagIDSignature = FourCharCode('idsi');
508
509 {
510 * SInt32 - the ControlID id
511 }
512 kControlCollectionTagIDID = FourCharCode('idid');
513
514 {
515 * UInt32 - the command
516 }
517 kControlCollectionTagCommand = FourCharCode('cmd ');
518
519 {
520 * SInt16 - the variant
521 }
522 kControlCollectionTagVarCode = FourCharCode('varc');
523
524
525 {������������������������������������������������������������������������������������������������������}
526 { � Control Image Content }
527 {������������������������������������������������������������������������������������������������������}
528
529 {
530 * Summary:
531 * Control image content types
532 }
533 const
534 {
535 * The control has no content other than text.
536 }
537 kControlContentTextOnly = 0;
538
539 {
540 * The control has no content.
541 }
542 kControlNoContent = 0;
543
544 {
545 * The control's content is an icon suite identified by a resource
546 * ID. The resource ID of the 'icns' resource should be placed in
547 * ControlImageContentInfo.u.resID .
548 }
549 kControlContentIconSuiteRes = 1;
550
551 {
552 * The control's content is a color icon identified by a resource ID.
553 * The resource ID of the 'cicn' resource should be placed in
554 * ControlImageContentInfo.u.resID .
555 }
556 kControlContentCIconRes = 2;
557
558 {
559 * The control's content is a picture identified by a resource ID.
560 * The resource ID of the 'PICT' resource should be placed in
561 * ControlImageContentInfo.u.resID .
562 }
563 kControlContentPictRes = 3;
564
565 {
566 * The control's content is an icon identified by a resource ID. The
567 * resource ID of the 'ICON' resource should be placed in
568 * ControlImageContentInfo.u.resID .
569 }
570 kControlContentICONRes = 4;
571
572 {
573 * The control's content is a note, caution, or stop icon identified
574 * by a resource ID. The resource ID should be placed in
575 * ControlImageContentInfo.u.resID. The resource ID must be one of
576 * kStopIcon, kNoteIcon, or kCautionIcon. When the icon is drawn, it
577 * may be modified to correspond to the current Mac OS X user
578 * interface guidelines. This content type is supported on Mac OS X
579 * 10.1 and later by the Icon control.
580 }
581 kControlContentAlertIconRes = 5;
582
583 {
584 * The control's content is an IconSuiteHandle. The icon suite handle
585 * should be placed in HIViewContentInfo.u.iconSuite.
586 }
587 kControlContentIconSuiteHandle = 129;
588
589 {
590 * The control's content is a CIconHandle. The color icon handle
591 * should be placed in HIViewContentInfo.u.cIconHandle.
592 }
593 kControlContentCIconHandle = 130;
594
595 {
596 * The control's content is a PicHandle. The picture handle should be
597 * placed in HIViewContentInfo.u.picture.
598 }
599 kControlContentPictHandle = 131;
600
601 {
602 * The control's content is an IconRef. The IconRef should be placed
603 * in HIViewContentInfo.u.iconRef.
604 }
605 kControlContentIconRef = 132;
606
607 {
608 * The control's content is a handle to a monochrome icon. The icon
609 * handle should be placed in HIViewContentInfo.u.ICONHandle.
610 }
611 kControlContentICON = 133;
612
613 {
614 * The control's content is a CGImageRef. The CGImageRef should be
615 * placed in HIViewContentInfo.u.imageRef. This content type is
616 * supported on Mac OS X 10.4 and later.
617 }
618 kControlContentCGImageRef = 134;
619
620 type
621 ControlContentType = SInt16;
622 type
623 ControlButtonContentInfo = record
624 contentType: ControlContentType;
625 case SInt16 of
626 0: (
627 resID: SInt16;
628 );
629 1: (
630 iconRef: IconRef_fix;
631 );
632 2: (
633 imageRef: CGImageRef;
634 );
635 {$ifc not TARGET_CPU_64}
636 3: (
637 cIconHandle: CIconHandle_fix;
638 );
639 4: (
640 iconSuite: Handle;
641 );
642 5: (
643 picture: PicHandle;
644 );
645 6: (
646 ICONHandle: Handle;
647 );
648 {$endc} {not TARGET_CPU_64}
649 end;
650 ControlButtonContentInfoPtr = ^ControlButtonContentInfo;
651 type
652 ControlImageContentInfo = ControlButtonContentInfo;
653 ControlImageContentInfoPtr = ControlButtonContentInfoPtr;
654 {������������������������������������������������������������������������������������������������������}
655 { � Control Key Script Behavior }
656 {������������������������������������������������������������������������������������������������������}
657 const
658 kControlKeyScriptBehaviorAllowAnyScript = FourCharCode('any '); { leaves the current keyboard alone and allows user to change the keyboard.}
659 kControlKeyScriptBehaviorPrefersRoman = FourCharCode('prmn'); { switches the keyboard to roman, but allows them to change it as desired.}
660 kControlKeyScriptBehaviorRequiresRoman = FourCharCode('rrmn'); { switches the keyboard to roman and prevents the user from changing it.}
661
662 type
663 ControlKeyScriptBehavior = UInt32;
664 {������������������������������������������������������������������������������������������������������}
665 { � Control Font Style }
666 {������������������������������������������������������������������������������������������������������}
667 { SPECIAL FONT USAGE NOTES: You can specify the font to use for many control types.
668 The constants below are meta-font numbers which you can use to set a particular
669 control's font usage. There are essentially two modes you can use: 1) default,
670 which is essentially the same as it always has been, i.e. it uses the system font, unless
671 directed to use the window font via a control variant. 2) you can specify to use
672 the big or small system font in a generic manner. The Big system font is the font
673 used in menus, etc. Chicago has filled that role for some time now. Small system
674 font is currently Geneva 10. The meta-font number implies the size and style.
675
676 NOTE: Not all font attributes are used by all controls. Most, in fact, ignore
677 the fore and back color (Static Text is the only one that does, for
678 backwards compatibility). Also size, face, and addFontSize are ignored
679 when using the meta-font numbering.
680 }
681 { Meta-font numbering - see note above }
682 const
683 kControlFontBigSystemFont = -1; { force to big system font}
684 kControlFontSmallSystemFont = -2; { force to small system font}
685 kControlFontSmallBoldSystemFont = -3; { force to small bold system font}
686 kControlFontViewSystemFont = -4; { force to views system font (DataBrowser control only)}
687 kControlFontMiniSystemFont = -5; { force to mini system font}
688
689 { Add these masks together to set the flags field of a ControlFontStyleRec }
690 { They specify which fields to apply to the text. It is important to make }
691 { sure that you specify only the fields that you wish to set. }
692 const
693 kControlUseFontMask = $0001;
694 kControlUseFaceMask = $0002;
695 kControlUseSizeMask = $0004;
696 kControlUseForeColorMask = $0008;
697 kControlUseBackColorMask = $0010;
698 kControlUseModeMask = $0020;
699 kControlUseJustMask = $0040;
700 kControlUseAllMask = $00FF;
701 kControlAddFontSizeMask = $0100;
702
703 { AddToMetaFont indicates that we want to start with a standard system }
704 { font, but then we'd like to add the other attributes. Normally, the meta }
705 { font ignores all other flags }
706 const
707 kControlAddToMetaFontMask = $0200; { Available in Appearance 1.1 or later}
708
709 { UseThemeFontID indicates that the font field of the ControlFontStyleRec }
710 { should be interpreted as a ThemeFontID (see Appearance.h). In all other }
711 { ways, specifying a ThemeFontID is just like using one of the control }
712 { meta-fonts IDs. kControlUseThemeFontIDMask and kControlUseFontMask are }
713 { mutually exclusive; you can only specify one of them. If you specify }
714 { both of them, the behavior is undefined. }
715 const
716 kControlUseThemeFontIDMask = $0080; { Available in Mac OS X or later}
717
718 type
719 ControlFontStyleRecPtr = ^ControlFontStyleRec;
720 ControlFontStyleRec = record
721 flags: SInt16;
722 font: SInt16;
723 size: SInt16;
724 style: SInt16;
725 mode: SInt16;
726 just: SInt16;
727 foreColor: RGBColor;
728 backColor: RGBColor;
729 end;
730 type
731 ControlFontStylePtr = ControlFontStyleRecPtr;
732 {������������������������������������������������������������������������������������������������������}
733 { � Click Activation Results }
734 {������������������������������������������������������������������������������������������������������}
735 { These are for use with GetControlClickActivation. The enumerated values should be pretty }
736 { self-explanatory, but just in case: }
737 { � Activate/DoNotActivate indicates whether or not to change the owning window's z-ordering before }
738 { processing the click. If activation is requested, you may also want to immediately redraw the }
739 { newly exposed portion of the window. }
740 { � Ignore/Handle Click indicates whether or not to call an appropriate click handling API (like }
741 { HandleControlClick) in respose to the event. }
742 const
743 kDoNotActivateAndIgnoreClick = 0; { probably never used. here for completeness.}
744 kDoNotActivateAndHandleClick = 1; { let the control handle the click while the window is still in the background.}
745 kActivateAndIgnoreClick = 2; { control doesn't want to respond directly to the click, but window should still be brought forward.}
746 kActivateAndHandleClick = 3; { control wants to respond to the click, but only after the window has been activated.}
747
748 type
749 ClickActivationResult = UInt32;
750 {������������������������������������������������������������������������������������������������������}
751 { � Common data tags for Get/SetControlData }
752 {������������������������������������������������������������������������������������������������������}
753
754 {
755 * Summary:
756 * Get/SetControlData Common Tags
757 }
758 const
759 kControlFontStyleTag = FourCharCode('font');
760 kControlKeyFilterTag = FourCharCode('fltr');
761
762 {
763 * Sent with a pointer to a ControlKind record to be filled in. Only
764 * valid for GetControlData.
765 }
766 kControlKindTag = FourCharCode('kind');
767
768 {
769 * Sent with a pointer to a ControlSize. Only valid with explicitly
770 * sizeable controls. Supported in 10.2 by the check box, combo box,
771 * progress bar, indeterminate progress bar, radio button, round
772 * button, scroll bar, slider and the tab. Check your return value
773 * from SetControlData to determine if the control supports the size
774 * that you requested.
775 *
776 * As of 10.2.5, the push button and DataBrowser accept this tag. The
777 * DataBrowser only changes the size of its scrollbars.
778 *
779 * As of 10.3, the chasing arrows, disclosure button, popup button,
780 * scroll view, search field and little arrows controls also accept
781 * this tag.
782 *
783 * As of 10.4, if the font of the editable text has not been
784 * overridden, the font size of the combo box and search field will
785 * adjust to respect the size of the control. Also, if the font of a
786 * static text control has not been overridden, the font size of the
787 * static text control will respect the size of the control. Note,
788 * however, that if the font _has_ been overridden (using
789 * SetControlFontStyle), then these controls may return a control
790 * size in response to GetControlData that is different from the
791 * effective font size.
792 *
793 * As of 10.5, the bevel button control now supports the small
794 * control size, and uses its control size to determine the size of
795 * its popup menu arrow (if it has a menu associated with the
796 * control). The default behavior is to use the width of the button
797 * to determine whether to use a small or normal-sized arrow. This
798 * behavior can be explicitly requested using kControlSizeAuto.
799 * However, you may also use kControlSizeSmall and kControlSizeNormal
800 * to explicitly request a small or normal-sized popup arrow.
801 *
802 *
803 * Also as of 10.5, the group box now supports the normal, small, and
804 * mini sizes. <BR><BR> Still check your return values!
805 }
806 kControlSizeTag = FourCharCode('size');
807
808 {
809 * Sent with a pointer to a ControlImageContentInfo (or
810 * HIViewContentInfo) structure. Valid for both GetControlData and
811 * SetControlData. All controls that support this tag will retain
812 * refcountable image content when SetControlData is used to supply
813 * new image content. Most controls that support this tag will not
814 * retain refcountable image content when GetControlData is used to
815 * retrieve image content; the exception is the tab control, which
816 * does retain IconRef and CGImageRef content in response to
817 * GetControlData. If you are implementing support for this tag in a
818 * new view, you should retain refcountable image content when new
819 * content is provided with SetControlData, but should not retain
820 * refcountable image content when returning current image content in
821 * response to GetControlData.
822 }
823 kControlContentTag = FourCharCode('cont');
824
825 {
826 * Sent with a pointer to a CTFontRef. Valid for both GetControlData
827 * and SetControlData. The value of this CTFontRef must be retained
828 * by the view when SetControlData is used and the view must retain
829 * it when passing it back as a result of GetControlData. It is up to
830 * the caller to release this value when it is no longer needed.
831 }
832 kControlThemeTextFontTag = FourCharCode('thft');
833
834 {
835 * Sent with a pointer to an HIThemeTextHorizontalFlush. Valid for
836 * both GetControlData and SetControlData.
837 }
838 kControlThemeTextHorizontalFlushTag = FourCharCode('thhf');
839
840 {
841 * Sent with a pointer to an HIThemeTextVerticalFlush. Valid for both
842 * GetControlData and SetControlData.
843 }
844 kControlThemeTextVerticalFlushTag = FourCharCode('thvf');
845
846 {
847 * Sent with a pointer to an HIThemeTextTruncation. Valid for both
848 * GetControlData and SetControlData.
849 }
850 kControlThemeTextTruncationTag = FourCharCode('thtt');
851
852 {
853 * Sent with a pointer to an HIThemeTextInfo. Valid for
854 * GetControlData. The version field of the HIThemeTextInfo must be
855 * initialized to the version number of the structure that the client
856 * is requesting the information for. When being requested with the
857 * API HIViewGetThemeTextInfo, the version field will be initialized
858 * to that which is given in the inVersion parameter.
859 }
860 kControlThemeTextInfoTag = FourCharCode('thti');
861
862 {������������������������������������������������������������������������������������������������������}
863 { � Control Feature Bits }
864 {������������������������������������������������������������������������������������������������������}
865
866 {
867 * Discussion:
868 * Control Feature Bits - Returned by GetControlFeatures
869 *
870 * This list is similar to the list of HIView features in HIView.h.
871 * Historical note: This list is longer because some of these
872 * constants were introduced to enable the Control Manager to tell
873 * whether a CDEF supported a new CDEF message.
874 }
875 const
876 kControlSupportsGhosting = 1 shl 0;
877 kControlSupportsEmbedding = 1 shl 1;
878 kControlSupportsFocus = 1 shl 2;
879 kControlWantsIdle = 1 shl 3;
880 kControlWantsActivate = 1 shl 4;
881 kControlHandlesTracking = 1 shl 5;
882 kControlSupportsDataAccess = 1 shl 6;
883 kControlHasSpecialBackground = 1 shl 7;
884 kControlGetsFocusOnClick = 1 shl 8;
885 kControlSupportsCalcBestRect = 1 shl 9;
886 kControlSupportsLiveFeedback = 1 shl 10;
887 kControlHasRadioBehavior = 1 shl 11; { Available in Appearance 1.0.1 or later}
888 kControlSupportsDragAndDrop = 1 shl 12; { Available in Carbon}
889 kControlAutoToggles = 1 shl 14; { Available in Appearance 1.1 or later}
890 kControlSupportsGetRegion = 1 shl 17; { Available in Appearance 1.1 or later}
891 kControlSupportsFlattening = 1 shl 19; { Available in Carbon}
892 kControlSupportsSetCursor = 1 shl 20; { Available in Carbon}
893 kControlSupportsContextualMenus = 1 shl 21; { Available in Carbon}
894 kControlSupportsClickActivation = 1 shl 22; { Available in Carbon}
895 kControlIdlesWithTimer = 1 shl 23; { Available in Carbon - this bit indicates that the control animates automatically}
896
897 {
898 * Reported by controls that expect clients to use an action proc
899 * that increments its value when the up button is pressed and
900 * decrement its value when the down button is pressed. (Most
901 * controls, such as scroll bars and sliders, expect the opposite).
902 * This allows the Control Manager to calculate the proper amount of
903 * sleep time during a tracking loop. This is only respected in Mac
904 * OS X 10.3 and later.
905 }
906 kControlInvertsUpDownValueMeaning = 1 shl 24;
907
908 {������������������������������������������������������������������������������������������������������}
909 { � Control Messages }
910 {������������������������������������������������������������������������������������������������������}
911 {$ifc not TARGET_CPU_64}
912 const
913 drawCntl = 0;
914 testCntl = 1;
915 calcCRgns = 2;
916 initCntl = 3; { Param is Collection, result is OSStatus}
917 dispCntl = 4;
918 posCntl = 5;
919 thumbCntl = 6;
920 dragCntl = 7;
921 autoTrack = 8;
922 calcCntlRgn = 10;
923 calcThumbRgn = 11;
924 drawThumbOutline = 12;
925 kControlMsgDrawGhost = 13;
926 kControlMsgCalcBestRect = 14; { Calculate best fitting rectangle for control}
927 kControlMsgHandleTracking = 15;
928 kControlMsgFocus = 16; { param indicates action.}
929 kControlMsgKeyDown = 17;
930 kControlMsgIdle = 18;
931 kControlMsgGetFeatures = 19;
932 kControlMsgSetData = 20;
933 kControlMsgGetData = 21;
934 kControlMsgActivate = 22;
935 kControlMsgSetUpBackground = 23;
936 kControlMsgCalcValueFromPos = 26;
937 kControlMsgTestNewMsgSupport = 27; { See if this control supports new messaging}
938 kControlMsgSubValueChanged = 25; { Available in Appearance 1.0.1 or later}
939 kControlMsgSubControlAdded = 28; { Available in Appearance 1.0.1 or later}
940 kControlMsgSubControlRemoved = 29; { Available in Appearance 1.0.1 or later}
941 kControlMsgApplyTextColor = 30; { Available in Appearance 1.1 or later}
942 kControlMsgGetRegion = 31; { Available in Appearance 1.1 or later}
943 kControlMsgFlatten = 32; { Available in Carbon. Param is Collection.}
944 kControlMsgSetCursor = 33; { Available in Carbon. Param is ControlSetCursorRec}
945 kControlMsgDragEnter = 38; { Available in Carbon. Param is DragRef, result is boolean indicating acceptibility of drag.}
946 kControlMsgDragLeave = 39; { Available in Carbon. As above.}
947 kControlMsgDragWithin = 40; { Available in Carbon. As above.}
948 kControlMsgDragReceive = 41; { Available in Carbon. Param is DragRef, result is OSStatus indicating success/failure.}
949 kControlMsgDisplayDebugInfo = 46; { Available in Carbon on X.}
950 kControlMsgContextualMenuClick = 47; { Available in Carbon. Param is ControlContextualMenuClickRec}
951 kControlMsgGetClickActivation = 48; { Available in Carbon. Param is ControlClickActivationRec}
952
953 type
954 ControlDefProcMessage = SInt16;
955 {$endc} {not TARGET_CPU_64}
956
957 {��������������������������������������������������������������������������������������}
958 { � Control Sizes }
959 {��������������������������������������������������������������������������������������}
960
961 {
962 * Discussion:
963 * ControlSize values to be used in conjunction with SetControlData
964 * and the kControlSizeTag constant.
965 }
966 const
967 {
968 * Use the control's default drawing variant. This does not apply to
969 * Scroll Bars, for which Normal is Large.
970 }
971 kControlSizeNormal = 0;
972
973 {
974 * Use the control's small drawing variant. Supported in 10.4 by the
975 * Check Box, Combo Box, Disclosure Button, HIScrollView,
976 * HISearchField, HISegmentedView, Little Arrows, Popup Button, Push
977 * Button, Radio Button, Scroll Bar, Slider, Static Text, and Tab
978 * controls. Supported in 10.5 by the Bevel Button and Group Box.
979 }
980 kControlSizeSmall = 1;
981
982 {
983 * Use the control's large drawing variant. Supported in 10.4 by the
984 * Indeterminate Progress Bar, Progress Bar, Round Button, and Static
985 * Text controls. Supported in 10.5 by the Chasing Arrows control.
986 }
987 kControlSizeLarge = 2;
988
989 {
990 * Use the control's miniature drawing variant. Supported in 10.4 by
991 * the Check Box, Combo Box, Disclosure Button, HISearchField, Little
992 * Arrows, Popup Button, Push Button, Radio Button, Slider, Static
993 * Text, and Tabs controls. Supported in 10.5 by the Group Box
994 * control.
995 }
996 kControlSizeMini = 3;
997
998 {
999 * Used by certain controls to support their legacy behavior of
1000 * drawing differently based on the control's bounds. Supported in
1001 * 10.4 by the Scroll Bar, Popup Button, Push Button, and Static Text
1002 * controls. Supported in 10.5 by the Bevel Button and Chasing Arrows
1003 * controls. It is preferred to explicitly use one of the available
1004 * control sizes.
1005 }
1006 kControlSizeAuto = $FFFF;
1007
1008 type
1009 ControlSize = UInt16;
1010 {��������������������������������������������������������������������������������������}
1011 { � Constants for drawCntl message (passed in param) }
1012 {��������������������������������������������������������������������������������������}
1013 const
1014 kDrawControlEntireControl = 0;
1015 kDrawControlIndicatorOnly = 129;
1016
1017 {$ifc not TARGET_CPU_64}
1018 {��������������������������������������������������������������������������������������}
1019 { � Constants for dragCntl message (passed in param) }
1020 {��������������������������������������������������������������������������������������}
1021 const
1022 kDragControlEntireControl = 0;
1023 kDragControlIndicator = 1;
1024
1025 {$endc} {not TARGET_CPU_64}
1026 {��������������������������������������������������������������������������������������}
1027 { � Drag Constraint Structure for thumbCntl message (passed in param) }
1028 {��������������������������������������������������������������������������������������}
1029 type
1030 IndicatorDragConstraint = record
1031 limitRect: Rect;
1032 slopRect: Rect;
1033 axis: DragConstraint;
1034 end;
1035 IndicatorDragConstraintPtr = ^IndicatorDragConstraint;
1036 {$ifc not TARGET_CPU_64}
1037 {��������������������������������������������������������������������������������������}
1038 { CDEF should return as result of kControlMsgTestNewMsgSupport }
1039 {��������������������������������������������������������������������������������������}
1040 const
1041 kControlSupportsNewMessages = FourCharCode(' ok ');
1042
1043 {��������������������������������������������������������������������������������������}
1044 { This structure is passed into a CDEF when called with the kControlMsgHandleTracking }
1045 { message }
1046 {��������������������������������������������������������������������������������������}
1047 type
1048 ControlTrackingRecPtr = ^ControlTrackingRec;
1049 ControlTrackingRec = record
1050 startPt: Point;
1051 modifiers: EventModifiers;
1052 action: ControlActionUPP;
1053 end;
1054 type
1055 ControlTrackingPtr = ControlTrackingRecPtr;
1056 {��������������������������������������������������������������������������������������}
1057 { This structure is passed into a CDEF when called with the kControlMsgKeyDown message }
1058 {��������������������������������������������������������������������������������������}
1059 type
1060 ControlKeyDownRecPtr = ^ControlKeyDownRec;
1061 ControlKeyDownRec = record
1062 modifiers: EventModifiers;
1063 keyCode: SInt16;
1064 charCode: SInt16;
1065 end;
1066 type
1067 ControlKeyDownPtr = ControlKeyDownRecPtr;
1068 {��������������������������������������������������������������������������������������}
1069 { This structure is passed into a CDEF when called with the kControlMsgGetData or }
1070 { kControlMsgSetData message }
1071 {��������������������������������������������������������������������������������������}
1072 type
1073 ControlDataAccessRecPtr = ^ControlDataAccessRec;
1074 ControlDataAccessRec = record
1075 tag: ResType;
1076 part: ResType;
1077 size: Size_fix;
1078 dataPtr: Ptr;
1079 end;
1080 type
1081 ControlDataAccessPtr = ControlDataAccessRecPtr;
1082 {��������������������������������������������������������������������������������������}
1083 { This structure is passed into a CDEF when called with the kControlCalcBestRect msg }
1084 {��������������������������������������������������������������������������������������}
1085 type
1086 ControlCalcSizeRecPtr = ^ControlCalcSizeRec;
1087 ControlCalcSizeRec = record
1088 height: SInt16;
1089 width: SInt16;
1090 baseLine: SInt16;
1091 end;
1092 type
1093 ControlCalcSizePtr = ControlCalcSizeRecPtr;
1094 {��������������������������������������������������������������������������������������}
1095 { This structure is passed into a CDEF when called with the kControlMsgSetUpBackground }
1096 { message is sent }
1097 {��������������������������������������������������������������������������������������}
1098 type
1099 ControlBackgroundRecPtr = ^ControlBackgroundRec;
1100 ControlBackgroundRec = record
1101 depth: SInt16;
1102 colorDevice: Boolean;
1103 end;
1104 type
1105 ControlBackgroundPtr = ControlBackgroundRecPtr;
1106 {��������������������������������������������������������������������������������������}
1107 { This structure is passed into a CDEF when called with the kControlMsgApplyTextColor }
1108 { message is sent }
1109 {��������������������������������������������������������������������������������������}
1110 type
1111 ControlApplyTextColorRecPtr = ^ControlApplyTextColorRec;
1112 ControlApplyTextColorRec = record
1113 depth: SInt16;
1114 colorDevice: Boolean;
1115 active: Boolean;
1116 end;
1117 type
1118 ControlApplyTextColorPtr = ControlApplyTextColorRecPtr;
1119 {��������������������������������������������������������������������������������������}
1120 { This structure is passed into a CDEF when called with the kControlMsgGetRegion }
1121 { message is sent }
1122 {��������������������������������������������������������������������������������������}
1123 type
1124 ControlGetRegionRecPtr = ^ControlGetRegionRec;
1125 ControlGetRegionRec = record
1126 region: RgnHandle;
1127 part: ControlPartCode;
1128 end;
1129 type
1130 ControlGetRegionPtr = ControlGetRegionRecPtr;
1131 {��������������������������������������������������������������������������������������}
1132 { This structure is passed into a CDEF when the kControlMsgSetCursor message is sent }
1133 { Only sent on Carbon }
1134 {��������������������������������������������������������������������������������������}
1135 type
1136 ControlSetCursorRecPtr = ^ControlSetCursorRec;
1137 ControlSetCursorRec = record
1138 localPoint: Point;
1139 modifiers: EventModifiers;
1140 cursorWasSet: Boolean; { your CDEF must set this to true if you set the cursor, or false otherwise}
1141 end;
1142 type
1143 ControlSetCursorPtr = ControlSetCursorRecPtr;
1144 {��������������������������������������������������������������������������������������}
1145 { This structure is passed into a CDEF when the kControlMsgContextualMenuClick message }
1146 { is sent }
1147 { Only sent on Carbon }
1148 {��������������������������������������������������������������������������������������}
1149 type
1150 ControlContextualMenuClickRecPtr = ^ControlContextualMenuClickRec;
1151 ControlContextualMenuClickRec = record
1152 localPoint: Point;
1153 menuDisplayed: Boolean; { your CDEF must set this to true if you displayed a menu, or false otherwise}
1154 end;
1155 type
1156 ControlContextualMenuClickPtr = ControlContextualMenuClickRecPtr;
1157 {��������������������������������������������������������������������������������������}
1158 { This structure is passed into a CDEF when the kControlMsgGetClickActivation message }
1159 { is sent }
1160 { Only sent on Carbon }
1161 {��������������������������������������������������������������������������������������}
1162 type
1163 ControlClickActivationRecPtr = ^ControlClickActivationRec;
1164 ControlClickActivationRec = record
1165 localPoint: Point;
1166 modifiers: EventModifiers;
1167 result: ClickActivationResult; { your CDEF must pass the desired result back}
1168 end;
1169 type
1170 ControlClickActivationPtr = ControlClickActivationRecPtr;
1171 {��������������������������������������������������������������������������������������}
1172 { � �CDEF� entrypoint }
1173 {��������������������������������������������������������������������������������������}
1174
1175 {
1176 * ControlDefProcPtr
1177 *
1178 * Summary:
1179 * Callback function for a custom control definition.
1180 }
1181 type
varCodenull1182 ControlDefProcPtr = function( varCode: SInt16; theControl: ControlRef; message: ControlDefProcMessage; param: SInt32 ): SInt32;
1183 type
1184 ControlDefUPP = ControlDefProcPtr;
1185 {
1186 * NewControlDefUPP()
1187 *
1188 * Availability:
1189 * Mac OS X: in version 10.0 and later in Carbon.framework
1190 * CarbonLib: in CarbonLib 1.0 and later
1191 * Non-Carbon CFM: available as macro/inline
1192 }
NewControlDefUPPnull1193 function NewControlDefUPP( userRoutine: ControlDefProcPtr ): ControlDefUPP; external name '_NewControlDefUPP';
1194 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
1195
1196 {
1197 * DisposeControlDefUPP()
1198 *
1199 * Availability:
1200 * Mac OS X: in version 10.0 and later in Carbon.framework
1201 * CarbonLib: in CarbonLib 1.0 and later
1202 * Non-Carbon CFM: available as macro/inline
1203 }
1204 procedure DisposeControlDefUPP( userUPP: ControlDefUPP ); external name '_DisposeControlDefUPP';
1205 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
1206
1207 {
1208 * InvokeControlDefUPP()
1209 *
1210 * Availability:
1211 * Mac OS X: in version 10.0 and later in Carbon.framework
1212 * CarbonLib: in CarbonLib 1.0 and later
1213 * Non-Carbon CFM: available as macro/inline
1214 }
InvokeControlDefUPPnull1215 function InvokeControlDefUPP( varCode: SInt16; theControl: ControlRef; message: ControlDefProcMessage; param: SInt32; userUPP: ControlDefUPP ): SInt32; external name '_InvokeControlDefUPP';
1216 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
1217
1218 {$endc} {not TARGET_CPU_64}
1219
1220 {��������������������������������������������������������������������������������������}
1221 { Control Key Filter }
1222 {��������������������������������������������������������������������������������������}
1223 { Certain controls can have a keyfilter attached to them. }
1224 { Definition of a key filter for intercepting and possibly changing keystrokes }
1225 { which are destined for a control. }
1226 { IMPORTANT! Because this filter provides WorldScript-encoded text in its parameters, }
1227 { it provides no meaningful information for key events generated when a Unicode }
1228 { keyboard layout or input method is active; these layouts and input methods generate }
1229 { Unicode text that often cannot be translated into any WorldScript encoding. On }
1230 { Mac OS X, you should avoid using this filter, or at most, use the filter as an }
1231 { indication that the text is changing but do not depend on the charCode parameter to }
1232 { the filter. Use a kEventTextInputUnicodeForKeyEvent Carbon event handler as a }
1233 { replacement for the ControlKeyFilter callback; on Mac OS X 10.4 and later, you can }
1234 { also use a kEventTextShouldChangeInRange or kEventTextDidChange event handler. }
1235 { Key Filter Result Codes }
1236 { The filter proc should return one of the two constants below. If }
1237 { kKeyFilterBlockKey is returned, the key is blocked and never makes it to the }
1238 { control. If kKeyFilterPassKey is returned, the control receives the keystroke. }
1239 const
1240 kControlKeyFilterBlockKey = 0;
1241 kControlKeyFilterPassKey = 1;
1242
1243 type
1244 ControlKeyFilterResult = SInt16;
theControlnull1245 ControlKeyFilterProcPtr = function( theControl: ControlRef; var keyCode: SInt16; var charCode: SInt16; var modifiers: EventModifiers ): ControlKeyFilterResult;
1246 ControlKeyFilterUPP = ControlKeyFilterProcPtr;
1247 {
1248 * NewControlKeyFilterUPP()
1249 *
1250 * Availability:
1251 * Mac OS X: in version 10.0 and later in Carbon.framework
1252 * CarbonLib: in CarbonLib 1.0 and later
1253 * Non-Carbon CFM: available as macro/inline
1254 }
NewControlKeyFilterUPPnull1255 function NewControlKeyFilterUPP( userRoutine: ControlKeyFilterProcPtr ): ControlKeyFilterUPP; external name '_NewControlKeyFilterUPP';
1256 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1257
1258 {
1259 * DisposeControlKeyFilterUPP()
1260 *
1261 * Availability:
1262 * Mac OS X: in version 10.0 and later in Carbon.framework
1263 * CarbonLib: in CarbonLib 1.0 and later
1264 * Non-Carbon CFM: available as macro/inline
1265 }
1266 procedure DisposeControlKeyFilterUPP( userUPP: ControlKeyFilterUPP ); external name '_DisposeControlKeyFilterUPP';
1267 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1268
1269 {
1270 * InvokeControlKeyFilterUPP()
1271 *
1272 * Availability:
1273 * Mac OS X: in version 10.0 and later in Carbon.framework
1274 * CarbonLib: in CarbonLib 1.0 and later
1275 * Non-Carbon CFM: available as macro/inline
1276 }
InvokeControlKeyFilterUPPnull1277 function InvokeControlKeyFilterUPP( theControl: ControlRef; var keyCode: SInt16; var charCode: SInt16; var modifiers: EventModifiers; userUPP: ControlKeyFilterUPP ): ControlKeyFilterResult; external name '_InvokeControlKeyFilterUPP';
1278 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1279
1280
1281 {��������������������������������������������������������������������������������������}
1282 { � DragGrayRgn Constatns }
1283 { For DragGrayRgnUPP used in TrackControl() }
1284 {��������������������������������������������������������������������������������������}
1285 const
1286 noConstraint = kNoConstraint;
1287 hAxisOnly = 1;
1288 vAxisOnly = 2;
1289
1290 {��������������������������������������������������������������������������������������}
1291 { � Control Creation/Deletion/Persistence }
1292 {��������������������������������������������������������������������������������������}
1293 {$ifc not TARGET_CPU_64}
1294 const
1295 kControlDefProcPtr = 0; { raw proc-ptr based access}
1296 kControlDefObjectClass = 1; { event-based definition (Mac OS X only)}
1297
1298 type
1299 ControlDefType = UInt32;
1300 type
1301 ControlDefSpecPtr = ^ControlDefSpec;
1302 ControlDefSpec = record
1303 defType: ControlDefType;
1304 case SInt16 of
1305 0: (
1306 defProc: ControlDefUPP;
1307 );
1308 1: (
1309 classRef: UnivPtr;
1310 );
1311 end;
1312 {$endc} {not TARGET_CPU_64}
1313
1314 {$ifc not TARGET_CPU_64}
1315 {
1316 * CreateCustomControl() *** DEPRECATED ***
1317 *
1318 * Deprecated:
1319 * On Mac OS X 10.2 and later, register your own custom subclass of
1320 * the HIView class and create an instance of your class using
1321 * HIObjectCreate.
1322 *
1323 * Summary:
1324 * Creates a control using a custom ControlDefProcPtr or
1325 * ToolboxObjectClassRef.
1326 *
1327 * Mac OS X threading:
1328 * Not thread safe
1329 *
1330 * Availability:
1331 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
1332 * CarbonLib: in CarbonLib 1.0 and later
1333 * Non-Carbon CFM: not available
1334 }
CreateCustomControlnull1335 function CreateCustomControl( owningWindow: WindowRef; const (*var*) contBounds: Rect; const (*var*) def: ControlDefSpec; initData: Collection; var outControl: ControlRef ): OSStatus; external name '_CreateCustomControl';
1336 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
1337
1338
1339 {
1340 * NewControl() *** DEPRECATED ***
1341 *
1342 * Deprecated:
1343 * Use one of the Create*Control APIs (CreatePushButtonControl,
1344 * CreateIconControl, etc) instead.
1345 *
1346 * Summary:
1347 * Creates a new control.
1348 *
1349 * Discussion:
1350 * The parameters to this API are overloaded with different meanings
1351 * depending on the control proc ID. See the "Settings Values for
1352 * Standard Controls" section of the Mac OS 8 Control Manager
1353 * reference documentation at
1354 * oolbox/ControlManager/ControlMgr8Ref/ControlMgrRef.11.html#28136>
1355 * for documentation on the parameter semantics for each type of
1356 * control proc.
1357 *
1358 * Mac OS X threading:
1359 * Not thread safe
1360 *
1361 * Availability:
1362 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
1363 * CarbonLib: in CarbonLib 1.0 and later
1364 * Non-Carbon CFM: in InterfaceLib 7.1 and later
1365 }
NewControlnull1366 function NewControl( owningWindow: WindowRef; const (*var*) boundsRect: Rect; const (*var*) controlTitle: Str255; initiallyVisible: Boolean; initialValue: SInt16; minimumValue: SInt16; maximumValue: SInt16; procID: SInt16; controlReference: SRefCon ): ControlRef; external name '_NewControl';
1367 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
1368
1369
1370 {
1371 * GetNewControl()
1372 *
1373 * Mac OS X threading:
1374 * Not thread safe
1375 *
1376 * Availability:
1377 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1378 * CarbonLib: in CarbonLib 1.0 and later
1379 * Non-Carbon CFM: in InterfaceLib 7.1 and later
1380 }
GetNewControlnull1381 function GetNewControl( resourceID: SInt16; owningWindow: WindowRef ): ControlRef; external name '_GetNewControl';
1382 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1383
1384
1385 {
1386 * DisposeControl()
1387 *
1388 * Mac OS X threading:
1389 * Not thread safe
1390 *
1391 * Availability:
1392 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1393 * CarbonLib: in CarbonLib 1.0 and later
1394 * Non-Carbon CFM: in InterfaceLib 7.1 and later
1395 }
1396 procedure DisposeControl( theControl: ControlRef ); external name '_DisposeControl';
1397 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1398
1399
1400 {
1401 * KillControls()
1402 *
1403 * Mac OS X threading:
1404 * Not thread safe
1405 *
1406 * Availability:
1407 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1408 * CarbonLib: in CarbonLib 1.0 and later
1409 * Non-Carbon CFM: in InterfaceLib 7.1 and later
1410 }
1411 procedure KillControls( theWindow: WindowRef ); external name '_KillControls';
1412 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1413
1414
1415 {��������������������������������������������������������������������������������������}
1416 { � Control Definition Registration }
1417 {��������������������������������������������������������������������������������������}
1418 {$endc} {not TARGET_CPU_64}
1419
1420 {$ifc not TARGET_CPU_64}
1421 type
constnull1422 ControlCNTLToCollectionProcPtr = function( const (*var*) bounds: Rect; value: SInt16; visible: Boolean; max: SInt16; min: SInt16; procID: SInt16; refCon: SRefCon; const (*var*) title: Str255; collection_: Collection ): OSStatus;
1423 type
1424 ControlCNTLToCollectionUPP = ControlCNTLToCollectionProcPtr;
1425 {
1426 * NewControlCNTLToCollectionUPP()
1427 *
1428 * Availability:
1429 * Mac OS X: in version 10.0 and later in Carbon.framework
1430 * CarbonLib: in CarbonLib 1.0 and later
1431 * Non-Carbon CFM: available as macro/inline
1432 }
NewControlCNTLToCollectionUPPnull1433 function NewControlCNTLToCollectionUPP( userRoutine: ControlCNTLToCollectionProcPtr ): ControlCNTLToCollectionUPP; external name '_NewControlCNTLToCollectionUPP';
1434 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1435
1436 {
1437 * DisposeControlCNTLToCollectionUPP()
1438 *
1439 * Availability:
1440 * Mac OS X: in version 10.0 and later in Carbon.framework
1441 * CarbonLib: in CarbonLib 1.0 and later
1442 * Non-Carbon CFM: available as macro/inline
1443 }
1444 procedure DisposeControlCNTLToCollectionUPP( userUPP: ControlCNTLToCollectionUPP ); external name '_DisposeControlCNTLToCollectionUPP';
1445 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1446
1447 {
1448 * InvokeControlCNTLToCollectionUPP()
1449 *
1450 * Availability:
1451 * Mac OS X: in version 10.0 and later in Carbon.framework
1452 * CarbonLib: in CarbonLib 1.0 and later
1453 * Non-Carbon CFM: available as macro/inline
1454 }
InvokeControlCNTLToCollectionUPPnull1455 function InvokeControlCNTLToCollectionUPP( const (*var*) bounds: Rect; value: SInt16; visible: Boolean; max: SInt16; min: SInt16; procID: SInt16; refCon: SRefCon; const (*var*) title: Str255; collection_: Collection; userUPP: ControlCNTLToCollectionUPP ): OSStatus; external name '_InvokeControlCNTLToCollectionUPP';
1456 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1457
1458 {$endc} {not TARGET_CPU_64}
1459
1460 {$ifc not TARGET_CPU_64}
1461 {
1462 * RegisterControlDefinition()
1463 *
1464 * Summary:
1465 * Associates or dissociates a control definition with a virtual
1466 * CDEF resource ID.
1467 *
1468 * Discussion:
1469 * In GetNewControl or NewControl on Carbon, the Control Manager
1470 * needs to know how to map the procID to a ControlDefSpec. With
1471 * RegisterControlDefinition, your application can inform the
1472 * Control Manager which ControlDefSpec to call when it sees a
1473 * request to use a 'CDEF' of a particular resource ID. Since custom
1474 * control definitions receive their initialization data in a
1475 * Collection passed in the 'param' parameter, you must also provide
1476 * a procedure to convert the bounds, min, max, and other parameters
1477 * to NewControl into a Collection. If you don't provide a
1478 * conversion proc, your control will receive an empty collection
1479 * when it is sent the initialization message. If you want the
1480 * value, min, visibility, etc. to be given to the control, you must
1481 * add the appropriate tagged data to the collection. See the
1482 * Control Collection Tags above. If you want to unregister a
1483 * ControlDefSpec that you have already registered, call
1484 * RegisterControlDefinition with the same CDEF resource ID, but
1485 * pass NULL for the inControlDef parameter. In this situation,
1486 * inConversionProc is effectively ignored.
1487 *
1488 * Mac OS X threading:
1489 * Not thread safe
1490 *
1491 * Parameters:
1492 *
1493 * inCDEFResID:
1494 * The virtual CDEF resource ID to which you'd like to associate
1495 * or dissociate the control definition.
1496 *
1497 * inControlDef:
1498 * A pointer to a ControlDefSpec which represents the control
1499 * definition you want to register, or NULL if you are attempting
1500 * to unregister a control definition.
1501 *
1502 * inConversionProc:
1503 * The conversion proc which will translate the NewControl
1504 * parameters into a Collection.
1505 *
1506 * Result:
1507 * An OSStatus code indicating success or failure.
1508 *
1509 * Availability:
1510 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1511 * CarbonLib: in CarbonLib 1.0 and later
1512 * Non-Carbon CFM: not available
1513 }
RegisterControlDefinitionnull1514 function RegisterControlDefinition( inCDEFResID: SInt16; const (*var*) inControlDef: ControlDefSpec; inConversionProc: ControlCNTLToCollectionUPP ): OSStatus; external name '_RegisterControlDefinition';
1515 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1516
1517
1518 {��������������������������������������������������������������������������������������}
1519 { � Control Visible State }
1520 {��������������������������������������������������������������������������������������}
1521 {
1522 * HiliteControl()
1523 *
1524 * Mac OS X threading:
1525 * Not thread safe
1526 *
1527 * Availability:
1528 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1529 * CarbonLib: in CarbonLib 1.0 and later
1530 * Non-Carbon CFM: in InterfaceLib 7.1 and later
1531 }
1532 procedure HiliteControl( theControl: ControlRef; hiliteState: ControlPartCode ); external name '_HiliteControl';
1533 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1534
1535
1536 {
1537 * ShowControl()
1538 *
1539 * Mac OS X threading:
1540 * Not thread safe
1541 *
1542 * Availability:
1543 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1544 * CarbonLib: in CarbonLib 1.0 and later
1545 * Non-Carbon CFM: in InterfaceLib 7.1 and later
1546 }
1547 procedure ShowControl( theControl: ControlRef ); external name '_ShowControl';
1548 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1549
1550
1551 {
1552 * HideControl()
1553 *
1554 * Mac OS X threading:
1555 * Not thread safe
1556 *
1557 * Availability:
1558 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1559 * CarbonLib: in CarbonLib 1.0 and later
1560 * Non-Carbon CFM: in InterfaceLib 7.1 and later
1561 }
1562 procedure HideControl( theControl: ControlRef ); external name '_HideControl';
1563 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1564
1565
1566 { following state routines available only with Appearance 1.0 and later}
1567 {
1568 * IsControlActive()
1569 *
1570 * Mac OS X threading:
1571 * Not thread safe
1572 *
1573 * Availability:
1574 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1575 * CarbonLib: in CarbonLib 1.0 and later
1576 * Non-Carbon CFM: in AppearanceLib 1.0 and later
1577 }
IsControlActivenull1578 function IsControlActive( inControl: ControlRef ): Boolean; external name '_IsControlActive';
1579 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1580
1581
1582 {
1583 * IsControlVisible()
1584 *
1585 * Summary:
1586 * Returns whether a control is visible.
1587 *
1588 * Discussion:
1589 * Note that IsControlVisible returns a control's effective
1590 * visibility, which is determined both by the control's own
1591 * visibility and the visibility of its parent controls. If a parent
1592 * control is invisible, then this control is considered to be
1593 * invisible also.
1594 *
1595 * Latent visibility can be determined with HIViewIsLatentlyVisible.
1596 *
1597 * Mac OS X threading:
1598 * Not thread safe
1599 *
1600 * Parameters:
1601 *
1602 * inControl:
1603 * The control whose visibility you wish to determine.
1604 *
1605 * Result:
1606 * A boolean value indicating whether the control is visible (true)
1607 * or hidden (false).
1608 *
1609 * Availability:
1610 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1611 * CarbonLib: in CarbonLib 1.0 and later
1612 * Non-Carbon CFM: in AppearanceLib 1.0 and later
1613 }
IsControlVisiblenull1614 function IsControlVisible( inControl: ControlRef ): Boolean; external name '_IsControlVisible';
1615 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1616
1617
1618 {
1619 * ActivateControl()
1620 *
1621 * Mac OS X threading:
1622 * Not thread safe
1623 *
1624 * Availability:
1625 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1626 * CarbonLib: in CarbonLib 1.0 and later
1627 * Non-Carbon CFM: in AppearanceLib 1.0 and later
1628 }
ActivateControlnull1629 function ActivateControl( inControl: ControlRef ): OSErr; external name '_ActivateControl';
1630 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1631
1632
1633 {
1634 * DeactivateControl()
1635 *
1636 * Mac OS X threading:
1637 * Not thread safe
1638 *
1639 * Availability:
1640 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1641 * CarbonLib: in CarbonLib 1.0 and later
1642 * Non-Carbon CFM: in AppearanceLib 1.0 and later
1643 }
DeactivateControlnull1644 function DeactivateControl( inControl: ControlRef ): OSErr; external name '_DeactivateControl';
1645 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1646
1647
1648 {
1649 * SetControlVisibility()
1650 *
1651 * Mac OS X threading:
1652 * Not thread safe
1653 *
1654 * Availability:
1655 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1656 * CarbonLib: in CarbonLib 1.0 and later
1657 * Non-Carbon CFM: in AppearanceLib 1.0 and later
1658 }
SetControlVisibilitynull1659 function SetControlVisibility( inControl: ControlRef; inIsVisible: Boolean; inDoDraw: Boolean ): OSErr; external name '_SetControlVisibility';
1660 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1661
1662
1663 { following state routines available only on Mac OS X and later}
1664 {
1665 * IsControlEnabled()
1666 *
1667 * Mac OS X threading:
1668 * Not thread safe
1669 *
1670 * Availability:
1671 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1672 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
1673 * Non-Carbon CFM: not available
1674 }
IsControlEnablednull1675 function IsControlEnabled( inControl: ControlRef ): Boolean; external name '_IsControlEnabled';
1676 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1677
1678
1679 {
1680 * EnableControl()
1681 *
1682 * Mac OS X threading:
1683 * Not thread safe
1684 *
1685 * Availability:
1686 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1687 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
1688 * Non-Carbon CFM: not available
1689 }
EnableControlnull1690 function EnableControl( inControl: ControlRef ): OSStatus; external name '_EnableControl';
1691 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1692
1693
1694 {
1695 * DisableControl()
1696 *
1697 * Mac OS X threading:
1698 * Not thread safe
1699 *
1700 * Availability:
1701 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1702 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
1703 * Non-Carbon CFM: not available
1704 }
DisableControlnull1705 function DisableControl( inControl: ControlRef ): OSStatus; external name '_DisableControl';
1706 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1707
1708
1709 {��������������������������������������������������������������������������������������}
1710 { � Control Imaging }
1711 {��������������������������������������������������������������������������������������}
1712 {
1713 * DrawControls()
1714 *
1715 * Mac OS X threading:
1716 * Not thread safe
1717 *
1718 * Availability:
1719 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1720 * CarbonLib: in CarbonLib 1.0 and later
1721 * Non-Carbon CFM: in InterfaceLib 7.1 and later
1722 }
1723 procedure DrawControls( theWindow: WindowRef ); external name '_DrawControls';
1724 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1725
1726
1727 {
1728 * Draw1Control()
1729 *
1730 * Mac OS X threading:
1731 * Not thread safe
1732 *
1733 * Availability:
1734 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1735 * CarbonLib: in CarbonLib 1.0 and later
1736 * Non-Carbon CFM: in InterfaceLib 7.1 and later
1737 }
1738 procedure Draw1Control( theControl: ControlRef ); external name '_Draw1Control';
1739 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1740
1741
1742 procedure DrawOneControl( theControl: ControlRef ); external name '_Draw1Control';
1743 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1744
1745 {
1746 * UpdateControls()
1747 *
1748 * Summary:
1749 * Redraws the controls that intersect a specified region in a
1750 * window.
1751 *
1752 * Mac OS X threading:
1753 * Not thread safe
1754 *
1755 * Parameters:
1756 *
1757 * inWindow:
1758 * The window whose controls to redraw.
1759 *
1760 * inUpdateRegion:
1761 * The region (in local coordinates) describing which controls to
1762 * redraw. In Mac OS 10.1 and later, and in CarbonLib 1.5 and
1763 * later, you may pass NULL for this parameter to redraw the
1764 * controls intersecting the visible region of the window.
1765 *
1766 * Availability:
1767 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1768 * CarbonLib: in CarbonLib 1.0 and later
1769 * Non-Carbon CFM: in InterfaceLib 7.1 and later
1770 }
1771 procedure UpdateControls( inWindow: WindowRef; inUpdateRegion: RgnHandle { can be NULL } ); external name '_UpdateControls';
1772 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1773
1774
1775 { following imaging routines available only with Appearance 1.0 and later}
1776 {
1777 * GetBestControlRect()
1778 *
1779 * Mac OS X threading:
1780 * Not thread safe
1781 *
1782 * Availability:
1783 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1784 * CarbonLib: in CarbonLib 1.0 and later
1785 * Non-Carbon CFM: in AppearanceLib 1.0 and later
1786 }
GetBestControlRectnull1787 function GetBestControlRect( inControl: ControlRef; var outRect: Rect; var outBaseLineOffset: SInt16 ): OSErr; external name '_GetBestControlRect';
1788 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1789
1790
1791 {
1792 * SetControlFontStyle()
1793 *
1794 * Mac OS X threading:
1795 * Not thread safe
1796 *
1797 * Availability:
1798 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1799 * CarbonLib: in CarbonLib 1.0 and later
1800 * Non-Carbon CFM: in AppearanceLib 1.0 and later
1801 }
SetControlFontStylenull1802 function SetControlFontStyle( inControl: ControlRef; const (*var*) inStyle: ControlFontStyleRec ): OSErr; external name '_SetControlFontStyle';
1803 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1804
1805
1806 {
1807 * DrawControlInCurrentPort()
1808 *
1809 * Mac OS X threading:
1810 * Not thread safe
1811 *
1812 * Availability:
1813 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1814 * CarbonLib: in CarbonLib 1.0 and later
1815 * Non-Carbon CFM: in AppearanceLib 1.0 and later
1816 }
1817 procedure DrawControlInCurrentPort( inControl: ControlRef ); external name '_DrawControlInCurrentPort';
1818 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1819
1820
1821 {
1822 * SetUpControlBackground()
1823 *
1824 * Summary:
1825 * Applies the proper background color for the given control to the
1826 * current port.
1827 *
1828 * Discussion:
1829 * An embedding-savvy control which erases before drawing must
1830 * ensure that its background color properly matches the body color
1831 * of any parent controls on top of which it draws. This routine
1832 * asks the Control Manager to determine and apply the proper
1833 * background color to the current port. If a ControlColorProc has
1834 * been provided for the given control, the proc will be called to
1835 * set up the background color. If no proc exists, or if the proc
1836 * returns a value other than noErr, the Control Manager ascends the
1837 * parent chain for the given control looking for a control which
1838 * has a special background (see the kControlHasSpecialBackground
1839 * feature bit). The first such parent is asked to set up the
1840 * background color (see the kControlMsgSetUpBackground message). If
1841 * no such parent exists, the Control Manager applies any ThemeBrush
1842 * which has been associated with the owning window (see
1843 * SetThemeWindowBackground). Available in Appearance 1.0 (Mac OS
1844 * 8), CarbonLib 1.0, Mac OS X, and later.
1845 *
1846 * Mac OS X threading:
1847 * Not thread safe
1848 *
1849 * Parameters:
1850 *
1851 * inControl:
1852 * The ControlRef that wants to erase.
1853 *
1854 * inDepth:
1855 * A short integer indicating the color depth of the device onto
1856 * which drawing will take place.
1857 *
1858 * inIsColorDevice:
1859 * A Boolean indicating whether the draw device is a color device.
1860 *
1861 * Result:
1862 * An OSStatus code indicating success or failure. The most likely
1863 * error is a controlHandleInvalidErr, resulting from a bad
1864 * ControlRef. Any non-noErr result indicates that the color set up
1865 * failed, and that the caller should probably give up its attempt
1866 * to draw.
1867 *
1868 * Availability:
1869 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1870 * CarbonLib: in CarbonLib 1.0 and later
1871 * Non-Carbon CFM: in AppearanceLib 1.0 and later
1872 }
SetUpControlBackgroundnull1873 function SetUpControlBackground( inControl: ControlRef; inDepth: SInt16; inIsColorDevice: Boolean ): OSErr; external name '_SetUpControlBackground';
1874 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1875
1876
1877 {
1878 * SetUpControlTextColor()
1879 *
1880 * Summary:
1881 * Applies the proper text color for the given control to the
1882 * current port.
1883 *
1884 * Discussion:
1885 * An embedding-savvy control which draws text must ensure that its
1886 * text color properly contrasts the background on which it draws.
1887 * This routine asks the Control Manager to determine and apply the
1888 * proper text color to the current port. If a ControlColorProc has
1889 * been provided for the given control, the proc will be called to
1890 * set up the text color. If no proc exists, or if the proc returns
1891 * a value other than noErr, the Control Manager ascends the parent
1892 * chain for the given control looking for a control which has a
1893 * special background (see the kControlHasSpecialBackground feature
1894 * bit). The first such parent is asked to set up the text color
1895 * (see the kControlMsgApplyTextColor message). If no such parent
1896 * exists, the Control Manager chooses a text color which contrasts
1897 * any ThemeBrush which has been associated with the owning window
1898 * (see SetThemeWindowBackground). Available in Appearance 1.1 (Mac
1899 * OS 8.5), CarbonLib 1.0, Mac OS X, and later.
1900 *
1901 * Mac OS X threading:
1902 * Not thread safe
1903 *
1904 * Parameters:
1905 *
1906 * inControl:
1907 * The ControlRef that wants to draw text.
1908 *
1909 * inDepth:
1910 * A short integer indicating the color depth of the device onto
1911 * which drawing will take place.
1912 *
1913 * inIsColorDevice:
1914 * A Boolean indicating whether the draw device is a color device.
1915 *
1916 * Result:
1917 * An OSStatus code indicating success or failure. The most likely
1918 * error is a controlHandleInvalidErr, resulting from a bad
1919 * ControlRef. Any non-noErr result indicates that the color set up
1920 * failed, and that the caller should probably give up its attempt
1921 * to draw.
1922 *
1923 * Availability:
1924 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
1925 * CarbonLib: in CarbonLib 1.0 and later
1926 * Non-Carbon CFM: in ControlsLib 8.5 and later
1927 }
SetUpControlTextColornull1928 function SetUpControlTextColor( inControl: ControlRef; inDepth: SInt16; inIsColorDevice: Boolean ): OSErr; external name '_SetUpControlTextColor';
1929 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
1930
1931
1932 {$endc} {not TARGET_CPU_64}
1933
1934 {$ifc not TARGET_CPU_64}
1935
1936 {
1937 * ControlColorProcPtr
1938 *
1939 * Discussion:
1940 * Callback allowing clients to specify/override the background
1941 * color and text color that a Control will use during drawing. Your
1942 * procedure should make the color changes to the current port. See
1943 * SetControlColorProc, SetUpControlBackground, and
1944 * SetUpControlTextColor for more information. Available on Mac OS
1945 * 8.5, CarbonLib 1.1, Mac OS X, and later.
1946 *
1947 * Parameters:
1948 *
1949 * inControl:
1950 * A reference to the control for whom your proc is setting up
1951 * colors.
1952 *
1953 * inMessage:
1954 * A ControlDefProcMessage indicating what sort of color your
1955 * procedure should set up. It will be either
1956 * kControlMsgApplyTextColor or kControlMsgSetUpBackground.
1957 * kControlMsgApplyTextColor is a request to set up the
1958 * appropriate text color (by setting the current port's
1959 * foreground color, pen information, etc.).
1960 * kControlMsgSetUpBackground is a request to set up the
1961 * appropriate background color (the current port's background
1962 * color, pattern, etc.).
1963 *
1964 * inDrawDepth:
1965 * A short integer indicating the bit depth of the device into
1966 * which the Control is drawing. The bit depth is typically passed
1967 * in as a result of someone someone trying to draw properly
1968 * across multiple monitors with different bit depths. If your
1969 * procedure wants to handle proper color set up based on bit
1970 * depth, it should use this parameter to help decide what color
1971 * to apply.
1972 *
1973 * inDrawInColor:
1974 * A Boolean indicating whether or not the device that the Control
1975 * is drawing into is a color device. The value is typically
1976 * passed in as a result of someone trying to draw properly across
1977 * multiple monitors which may or may not be color devices. If
1978 * your procedure wants to handle proper color set up for both
1979 * color and grayscale devices, it should use this parameter to
1980 * help decide what color to apply.
1981 *
1982 * Result:
1983 * An OSStatus code indicating success or failure. Returning noErr
1984 * is an indication that your proc completely handled the color set
1985 * up. If you return any other value, the Control Manager will fall
1986 * back to the normal color set up mechanism.
1987 }
1988 type
inControlnull1989 ControlColorProcPtr = function( inControl: ControlRef; inMessage: SInt16; inDrawDepth: SInt16; inDrawInColor: Boolean ): OSStatus;
1990 type
1991 ControlColorUPP = ControlColorProcPtr;
1992 {
1993 * NewControlColorUPP()
1994 *
1995 * Availability:
1996 * Mac OS X: in version 10.0 and later in Carbon.framework
1997 * CarbonLib: in CarbonLib 1.1 and later
1998 * Non-Carbon CFM: available as macro/inline
1999 }
NewControlColorUPPnull2000 function NewControlColorUPP( userRoutine: ControlColorProcPtr ): ControlColorUPP; external name '_NewControlColorUPP';
2001 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2002
2003 {
2004 * DisposeControlColorUPP()
2005 *
2006 * Availability:
2007 * Mac OS X: in version 10.0 and later in Carbon.framework
2008 * CarbonLib: in CarbonLib 1.1 and later
2009 * Non-Carbon CFM: available as macro/inline
2010 }
2011 procedure DisposeControlColorUPP( userUPP: ControlColorUPP ); external name '_DisposeControlColorUPP';
2012 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2013
2014 {
2015 * InvokeControlColorUPP()
2016 *
2017 * Availability:
2018 * Mac OS X: in version 10.0 and later in Carbon.framework
2019 * CarbonLib: in CarbonLib 1.1 and later
2020 * Non-Carbon CFM: available as macro/inline
2021 }
InvokeControlColorUPPnull2022 function InvokeControlColorUPP( inControl: ControlRef; inMessage: SInt16; inDrawDepth: SInt16; inDrawInColor: Boolean; userUPP: ControlColorUPP ): OSStatus; external name '_InvokeControlColorUPP';
2023 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2024
2025 {$endc} {not TARGET_CPU_64}
2026
2027 {$ifc not TARGET_CPU_64}
2028 {
2029 * SetControlColorProc()
2030 *
2031 * Summary:
2032 * Associates a ControlColorUPP with a given Control, thereby
2033 * allowing you to bypass the embedding hierarchy-based color setup
2034 * of SetUpControlBackground/SetUpControlTextColor and replace it
2035 * with your own.
2036 *
2037 * Discussion:
2038 * Before an embedded Control can erase, it calls
2039 * SetUpControlBackground to have its background color set up by any
2040 * parent controls. Similarly, any Control which draws text calls
2041 * SetUpControlTextColor to have the appropriate text color set up.
2042 * This allows certain controls (such as Tabs and Placards) to offer
2043 * special backgrounds and text colors for any child controls. By
2044 * default, the SetUp routines only move up the Control Manager
2045 * embedding hierarchy looking for a parent which has a special
2046 * background. This is fine in a plain vanilla embedding case, but
2047 * many application frameworks find it troublesome; if there are
2048 * interesting views between two Controls in the embedding
2049 * hierarchy, the framework needs to be in charge of the background
2050 * and text colors, otherwise drawing defects will occur. You can
2051 * only associate a single color proc with a given ControlRef.
2052 * Available on Mac OS 8.5, CarbonLib 1.1, Mac OS X, and later.
2053 *
2054 * Mac OS X threading:
2055 * Not thread safe
2056 *
2057 * Parameters:
2058 *
2059 * inControl:
2060 * The ControlRef with whom the color proc should be associated.
2061 *
2062 * inProc:
2063 * The color proc to associate with the ControlRef. If you pass
2064 * NULL, the ControlRef will be dissociated from any previously
2065 * installed color proc.
2066 *
2067 * Result:
2068 * An OSStatus code indicating success or failure. The most likely
2069 * error is a controlHandleInvalidErr resulting from a bad
2070 * ControlRef.
2071 *
2072 * Availability:
2073 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2074 * CarbonLib: in CarbonLib 1.1 and later
2075 * Non-Carbon CFM: in ControlsLib 8.5 and later
2076 }
SetControlColorProcnull2077 function SetControlColorProc( inControl: ControlRef; inProc: ControlColorUPP ): OSStatus; external name '_SetControlColorProc';
2078 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2079
2080
2081 {��������������������������������������������������������������������������������������}
2082 { � Control Mousing }
2083 {��������������������������������������������������������������������������������������}
2084 {
2085 NOTE ON CONTROL ACTION PROCS
2086
2087 When using the TrackControl() call when tracking an indicator, the actionProc parameter
2088 (type ControlActionUPP) should be replaced by a parameter of type DragGrayRgnUPP
2089 (see Quickdraw.h).
2090
2091 If, however, you are using the live feedback variants of scroll bars or sliders, you
2092 must pass a ControlActionUPP in when tracking the indicator as well. This functionality
2093 is available in Appearance 1.0 or later.
2094 }
2095 {
2096 * TrackControl()
2097 *
2098 * Mac OS X threading:
2099 * Not thread safe
2100 *
2101 * Availability:
2102 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2103 * CarbonLib: in CarbonLib 1.0 and later
2104 * Non-Carbon CFM: in InterfaceLib 7.1 and later
2105 }
TrackControlnull2106 function TrackControl( theControl: ControlRef; startPoint: Point; actionProc: ControlActionUPP { can be NULL } ): ControlPartCode; external name '_TrackControl';
2107 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2108
2109
2110 {
2111 * DragControl()
2112 *
2113 * Mac OS X threading:
2114 * Not thread safe
2115 *
2116 * Availability:
2117 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2118 * CarbonLib: in CarbonLib 1.0 and later
2119 * Non-Carbon CFM: in InterfaceLib 7.1 and later
2120 }
2121 procedure DragControl( theControl: ControlRef; startPoint: Point; const (*var*) limitRect: Rect; const (*var*) slopRect: Rect; axis: DragConstraint ); external name '_DragControl';
2122 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2123
2124
2125 {
2126 * TestControl()
2127 *
2128 * Summary:
2129 * Determines the control part that is at a given point.
2130 *
2131 * Mac OS X threading:
2132 * Not thread safe
2133 *
2134 * Parameters:
2135 *
2136 * theControl:
2137 * The control to test.
2138 *
2139 * testPoint:
2140 * The location to test. For a non-compositing control, this
2141 * location should be in port-local coordinates; for a compositing
2142 * control, this location should be in view-local coordinates.
2143 *
2144 * Result:
2145 * The control part code that was at the specified location.
2146 *
2147 * Availability:
2148 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2149 * CarbonLib: in CarbonLib 1.0 and later
2150 * Non-Carbon CFM: in InterfaceLib 7.1 and later
2151 }
TestControlnull2152 function TestControl( theControl: ControlRef; testPoint: Point ): ControlPartCode; external name '_TestControl';
2153 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2154
2155
2156 {
2157 * FindControl()
2158 *
2159 * Summary:
2160 * Finds the control in a window that is at a given point.
2161 *
2162 * Discussion:
2163 * FindControl does not work properly in compositing windows prior
2164 * to Mac OS X 10.4. In earlier releases of Mac OS X, it will return
2165 * the correct control, but the part code parameter will be invalid
2166 * (usually kControlNoPart).
2167 *
2168 * In Mac OS X 10.2 and later, we recommend using
2169 * HIViewGetViewForMouseEvent or HIViewGetSubviewHit instead of
2170 * FindControl.
2171 *
2172 * Mac OS X threading:
2173 * Not thread safe
2174 *
2175 * Parameters:
2176 *
2177 * testPoint:
2178 * The point to test. The point should be given in port-local
2179 * coordinates for the specified window.
2180 *
2181 * theWindow:
2182 * The window whose controls to test.
2183 *
2184 * theControl:
2185 * On exit, contains the control that was at the specified
2186 * location.
2187 *
2188 * Result:
2189 * The control part code that was at the specified location.
2190 *
2191 * Availability:
2192 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2193 * CarbonLib: in CarbonLib 1.0 and later
2194 * Non-Carbon CFM: in InterfaceLib 7.1 and later
2195 }
FindControlnull2196 function FindControl( testPoint: Point; theWindow: WindowRef; var theControl: ControlRef ): ControlPartCode; external name '_FindControl';
2197 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2198
2199
2200 { The following mousing routines available only with Appearance 1.0 and later }
2201 { HandleControlClick is preferable to TrackControl when running under }
2202 { Appearance 1.0 as you can pass in modifiers, which some of the new controls }
2203 { use, such as edit text and list boxes. }
2204 { NOTE: Passing NULL for the outPart parameter of FindControlUnderMouse is only}
2205 { supported in systems later than 10.1.x }
2206 {
2207 * FindControlUnderMouse()
2208 *
2209 * Summary:
2210 * Finds the control in a window that is at a given point.
2211 *
2212 * Discussion:
2213 * FindControlUnderMouse does not work properly in compositing
2214 * windows prior to Mac OS X 10.4. In earlier releases of Mac OS X,
2215 * it will return the correct control, but the part code parameter
2216 * will be invalid (usually kControlNoPart).
2217 *
2218 * In Mac OS X 10.2 and later, we recommend using
2219 * HIViewGetViewForMouseEvent or HIViewGetSubviewHit instead of
2220 * FindControlUnderMouse.
2221 *
2222 * Mac OS X threading:
2223 * Not thread safe
2224 *
2225 * Parameters:
2226 *
2227 * inWhere:
2228 * The point to test. The point should be given in port-local
2229 * coordinates for the specified window.
2230 *
2231 * inWindow:
2232 * The window whose controls to test.
2233 *
2234 * outPart:
2235 * On exit, contains the control part code that was at the
2236 * specified location. You may pass NULL for this parameter if you
2237 * don't need this information.
2238 *
2239 * Result:
2240 * The control that was at the specified location.
2241 *
2242 * Availability:
2243 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2244 * CarbonLib: in CarbonLib 1.0 and later
2245 * Non-Carbon CFM: in AppearanceLib 1.0 and later
2246 }
FindControlUnderMousenull2247 function FindControlUnderMouse( inWhere: Point; inWindow: WindowRef; outPart: ControlPartCodePtr { can be NULL } ): ControlRef; external name '_FindControlUnderMouse';
2248 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2249
2250
2251 {
2252 * HandleControlClick()
2253 *
2254 * Mac OS X threading:
2255 * Not thread safe
2256 *
2257 * Availability:
2258 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2259 * CarbonLib: in CarbonLib 1.0 and later
2260 * Non-Carbon CFM: in AppearanceLib 1.0 and later
2261 }
HandleControlClicknull2262 function HandleControlClick( inControl: ControlRef; inWhere: Point; inModifiers: EventModifiers; inAction: ControlActionUPP { can be NULL } ): ControlPartCode; external name '_HandleControlClick';
2263 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2264
2265
2266 { Contextual Menu support in the Control Manager is only available on Carbon. }
2267 { If the control didn't display a contextual menu (possibly because the point }
2268 { was in a non-interesting part), the menuDisplayed output parameter will be }
2269 { false. If the control did display a menu, menuDisplayed will be true. }
2270 { This in on Carbon only }
2271 {
2272 * HandleControlContextualMenuClick()
2273 *
2274 * Mac OS X threading:
2275 * Not thread safe
2276 *
2277 * Availability:
2278 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2279 * CarbonLib: in CarbonLib 1.0 and later
2280 * Non-Carbon CFM: in ControlsLib 9.0 and later
2281 }
HandleControlContextualMenuClicknull2282 function HandleControlContextualMenuClick( inControl: ControlRef; inWhere: Point; var menuDisplayed: Boolean ): OSStatus; external name '_HandleControlContextualMenuClick';
2283 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2284
2285
2286 { Some complex controls (like Data Browser) require proper sequencing of }
2287 { window activation and click processing. In some cases, the control might }
2288 { want the window to be left inactive yet still handle the click, or vice- }
2289 { versa. The GetControlClickActivation routine lets a control client ask the }
2290 { control how it wishes to behave for a particular click. }
2291 { This in on Carbon only. }
2292 {
2293 * GetControlClickActivation()
2294 *
2295 * Mac OS X threading:
2296 * Not thread safe
2297 *
2298 * Availability:
2299 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2300 * CarbonLib: in CarbonLib 1.0 and later
2301 * Non-Carbon CFM: in ControlsLib 9.0 and later
2302 }
GetControlClickActivationnull2303 function GetControlClickActivation( inControl: ControlRef; inWhere: Point; inModifiers: EventModifiers; var outResult: ClickActivationResult ): OSStatus; external name '_GetControlClickActivation';
2304 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2305
2306
2307 {��������������������������������������������������������������������������������������}
2308 { � Control Events (available only with Appearance 1.0 and later) }
2309 {��������������������������������������������������������������������������������������}
2310 {
2311 * HandleControlKey() *** DEPRECATED ***
2312 *
2313 * Deprecated:
2314 * This API only works for a limited set of controls in Mac OS X. No
2315 * HIView-based controls except for the Clock and UserPane controls
2316 * support this API. The EditText, ListBox, and ScrollingTextBox
2317 * controls are not HIView-based and do still support this API. For
2318 * HIView-based controls, you should send a
2319 * kEventTextInputUnicodeForKeyEvent event to a control if you need
2320 * to feed it keyboard input.
2321 *
2322 * Summary:
2323 * Sends WorldScript-encoded keyboard input to a control using
2324 * kControlMsgKeyDown.
2325 *
2326 * Mac OS X threading:
2327 * Not thread safe
2328 *
2329 * Parameters:
2330 *
2331 * inControl:
2332 * The control to receive the keyboard input.
2333 *
2334 * inKeyCode:
2335 * The virtual keycode to send.
2336 *
2337 * inCharCode:
2338 * The character code to send. This character should use the
2339 * current keyboard text encoding.
2340 *
2341 * inModifiers:
2342 * The keyboard modifiers to send.
2343 *
2344 * Result:
2345 * The part code that was modified by keyboard event processing.
2346 *
2347 * Availability:
2348 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
2349 * CarbonLib: in CarbonLib 1.0 and later
2350 * Non-Carbon CFM: in AppearanceLib 1.0 and later
2351 }
HandleControlKeynull2352 function HandleControlKey( inControl: ControlRef; inKeyCode: SInt16; inCharCode: SInt16; inModifiers: EventModifiers ): ControlPartCode; external name '_HandleControlKey';
2353 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
2354
2355
2356 {��������������������������������������������������������������������������������������}
2357 { � Control Mouse Tracking (available with Carbon) }
2358 {��������������������������������������������������������������������������������������}
2359 { The HandleControlSetCursor routine requests that a given control set the cursor to }
2360 { something appropriate based on the mouse location. }
2361 { If the control didn't want to set the cursor (because the point was in a }
2362 { non-interesting part), the cursorWasSet output parameter will be false. If the }
2363 { control did set the cursor, cursorWasSet will be true. }
2364 { Carbon only. }
2365 {
2366 * HandleControlSetCursor()
2367 *
2368 * Mac OS X threading:
2369 * Not thread safe
2370 *
2371 * Availability:
2372 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2373 * CarbonLib: in CarbonLib 1.0 and later
2374 * Non-Carbon CFM: in ControlsLib 9.0 and later
2375 }
HandleControlSetCursornull2376 function HandleControlSetCursor( control: ControlRef; localPoint: Point; modifiers: EventModifiers; var cursorWasSet: Boolean ): OSStatus; external name '_HandleControlSetCursor';
2377 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2378
2379
2380 {��������������������������������������������������������������������������������������}
2381 { � Control Positioning }
2382 {��������������������������������������������������������������������������������������}
2383 {
2384 * MoveControl()
2385 *
2386 * Mac OS X threading:
2387 * Not thread safe
2388 *
2389 * Availability:
2390 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2391 * CarbonLib: in CarbonLib 1.0 and later
2392 * Non-Carbon CFM: in InterfaceLib 7.1 and later
2393 }
2394 procedure MoveControl( theControl: ControlRef; h: SInt16; v: SInt16 ); external name '_MoveControl';
2395 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2396
2397
2398 {
2399 * SizeControl()
2400 *
2401 * Mac OS X threading:
2402 * Not thread safe
2403 *
2404 * Availability:
2405 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2406 * CarbonLib: in CarbonLib 1.0 and later
2407 * Non-Carbon CFM: in InterfaceLib 7.1 and later
2408 }
2409 procedure SizeControl( theControl: ControlRef; w: SInt16; h: SInt16 ); external name '_SizeControl';
2410 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2411
2412
2413 {��������������������������������������������������������������������������������������}
2414 { � Control Title }
2415 {��������������������������������������������������������������������������������������}
2416 {
2417 * SetControlTitle() *** DEPRECATED ***
2418 *
2419 * Deprecated:
2420 * Use HIViewSetText or SetControlTitleWithCFString instead of
2421 * SetControlTitle.
2422 *
2423 * Summary:
2424 * Sets the title of a control to a Pascal string.
2425 *
2426 * Mac OS X threading:
2427 * Not thread safe
2428 *
2429 * Availability:
2430 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
2431 * CarbonLib: in CarbonLib 1.0 and later
2432 * Non-Carbon CFM: in InterfaceLib 7.1 and later
2433 }
2434 procedure SetControlTitle( theControl: ControlRef; const (*var*) title: Str255 ); external name '_SetControlTitle';
2435 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
2436
2437
2438 {
2439 * GetControlTitle() *** DEPRECATED ***
2440 *
2441 * Deprecated:
2442 * Use HIViewCopyText or CopyControlTitleAsCFString instead of
2443 * GetControlTitle.
2444 *
2445 * Summary:
2446 * Retrieves the title of a control as a Pascal string.
2447 *
2448 * Mac OS X threading:
2449 * Not thread safe
2450 *
2451 * Availability:
2452 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
2453 * CarbonLib: in CarbonLib 1.0 and later
2454 * Non-Carbon CFM: in InterfaceLib 7.1 and later
2455 }
2456 procedure GetControlTitle( theControl: ControlRef; var title: Str255 ); external name '_GetControlTitle';
2457 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
2458
2459
2460 {
2461 * SetControlTitleWithCFString()
2462 *
2463 * Summary:
2464 * Sets the title of a control to the text contained in a CFString.
2465 *
2466 * Discussion:
2467 * The Control Manager will either make its own copy or just
2468 * increment the refcount of the CFString before returning from
2469 * SetControlTitleWithCFString, depending on whether the string is
2470 * mutable or immutable. If the string is mutable, modifying the
2471 * string after calling SetControlTitleWithCFString will have no
2472 * effect on the control's actual title. The caller may release the
2473 * string after calling SetControlTitleWithCFString.
2474 *
2475 * Note that setting the title of some controls (such as the
2476 * StaticText and EditText controls) does not affect the text that
2477 * is displayed by the control. These controls only read their title
2478 * text at creation, and changes to the title text after creation
2479 * are ignored. To set the text that is displayed by such a control,
2480 * use HIViewSetText, or SetControlData with
2481 * kControlStatic/EditTextTextTag.
2482 *
2483 * Mac OS X threading:
2484 * Not thread safe
2485 *
2486 * Parameters:
2487 *
2488 * inControl:
2489 * The control whose title to set.
2490 *
2491 * inString:
2492 * The string containing the new control title text.
2493 *
2494 * Availability:
2495 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2496 * CarbonLib: in CarbonLib 1.1 and later
2497 * Non-Carbon CFM: not available
2498 }
SetControlTitleWithCFStringnull2499 function SetControlTitleWithCFString( inControl: ControlRef; inString: CFStringRef ): OSStatus; external name '_SetControlTitleWithCFString';
2500 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2501
2502
2503 {
2504 * CopyControlTitleAsCFString()
2505 *
2506 * Summary:
2507 * Returns a CFString containing the title of a control.
2508 *
2509 * Discussion:
2510 * Note that retrieving the title of some controls (such as the
2511 * StaticText and EditText controls) does not retrieve the text that
2512 * is displayed by the control. These controls store the displayed
2513 * text in a location that is separate from the title. To retrieve
2514 * the text that is displayed by such a control, use HIViewCopyText,
2515 * or SetControlData with kControlStatic/EditTextTextTag.
2516 *
2517 * Mac OS X threading:
2518 * Not thread safe
2519 *
2520 * Parameters:
2521 *
2522 * inControl:
2523 * The control whose title to return.
2524 *
2525 * outString:
2526 * On exit, a CFString containing the control's title. This string
2527 * must be released by the caller.
2528 *
2529 * Availability:
2530 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2531 * CarbonLib: in CarbonLib 1.1 and later
2532 * Non-Carbon CFM: not available
2533 }
CopyControlTitleAsCFStringnull2534 function CopyControlTitleAsCFString( inControl: ControlRef; var outString: CFStringRef ): OSStatus; external name '_CopyControlTitleAsCFString';
2535 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2536
2537
2538 {��������������������������������������������������������������������������������������}
2539 { � Control Value }
2540 {��������������������������������������������������������������������������������������}
2541 {
2542 * GetControlValue()
2543 *
2544 * Mac OS X threading:
2545 * Not thread safe
2546 *
2547 * Availability:
2548 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2549 * CarbonLib: in CarbonLib 1.0 and later
2550 * Non-Carbon CFM: in InterfaceLib 7.1 and later
2551 }
GetControlValuenull2552 function GetControlValue( theControl: ControlRef ): SInt16; external name '_GetControlValue';
2553 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2554
2555
2556 {
2557 * SetControlValue()
2558 *
2559 * Mac OS X threading:
2560 * Not thread safe
2561 *
2562 * Availability:
2563 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2564 * CarbonLib: in CarbonLib 1.0 and later
2565 * Non-Carbon CFM: in InterfaceLib 7.1 and later
2566 }
2567 procedure SetControlValue( theControl: ControlRef; newValue: SInt16 ); external name '_SetControlValue';
2568 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2569
2570
2571 {
2572 * GetControlMinimum()
2573 *
2574 * Mac OS X threading:
2575 * Not thread safe
2576 *
2577 * Availability:
2578 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2579 * CarbonLib: in CarbonLib 1.0 and later
2580 * Non-Carbon CFM: in InterfaceLib 7.1 and later
2581 }
GetControlMinimumnull2582 function GetControlMinimum( theControl: ControlRef ): SInt16; external name '_GetControlMinimum';
2583 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2584
2585
2586 {
2587 * SetControlMinimum()
2588 *
2589 * Mac OS X threading:
2590 * Not thread safe
2591 *
2592 * Availability:
2593 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2594 * CarbonLib: in CarbonLib 1.0 and later
2595 * Non-Carbon CFM: in InterfaceLib 7.1 and later
2596 }
2597 procedure SetControlMinimum( theControl: ControlRef; newMinimum: SInt16 ); external name '_SetControlMinimum';
2598 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2599
2600
2601 {
2602 * GetControlMaximum()
2603 *
2604 * Mac OS X threading:
2605 * Not thread safe
2606 *
2607 * Availability:
2608 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2609 * CarbonLib: in CarbonLib 1.0 and later
2610 * Non-Carbon CFM: in InterfaceLib 7.1 and later
2611 }
GetControlMaximumnull2612 function GetControlMaximum( theControl: ControlRef ): SInt16; external name '_GetControlMaximum';
2613 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2614
2615
2616 {
2617 * SetControlMaximum()
2618 *
2619 * Mac OS X threading:
2620 * Not thread safe
2621 *
2622 * Availability:
2623 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2624 * CarbonLib: in CarbonLib 1.0 and later
2625 * Non-Carbon CFM: in InterfaceLib 7.1 and later
2626 }
2627 procedure SetControlMaximum( theControl: ControlRef; newMaximum: SInt16 ); external name '_SetControlMaximum';
2628 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2629
2630
2631 { proportional scrolling/32-bit value support is new with Appearance 1.1}
2632
2633 {
2634 * GetControlViewSize()
2635 *
2636 * Mac OS X threading:
2637 * Not thread safe
2638 *
2639 * Availability:
2640 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2641 * CarbonLib: in CarbonLib 1.0 and later
2642 * Non-Carbon CFM: in ControlsLib 8.5 and later
2643 }
GetControlViewSizenull2644 function GetControlViewSize( theControl: ControlRef ): SInt32; external name '_GetControlViewSize';
2645 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2646
2647
2648 {
2649 * SetControlViewSize()
2650 *
2651 * Mac OS X threading:
2652 * Not thread safe
2653 *
2654 * Availability:
2655 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2656 * CarbonLib: in CarbonLib 1.0 and later
2657 * Non-Carbon CFM: in ControlsLib 8.5 and later
2658 }
2659 procedure SetControlViewSize( theControl: ControlRef; newViewSize: SInt32 ); external name '_SetControlViewSize';
2660 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2661
2662
2663 {
2664 * GetControl32BitValue()
2665 *
2666 * Mac OS X threading:
2667 * Not thread safe
2668 *
2669 * Availability:
2670 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2671 * CarbonLib: in CarbonLib 1.0 and later
2672 * Non-Carbon CFM: in ControlsLib 8.5 and later
2673 }
GetControl32BitValuenull2674 function GetControl32BitValue( theControl: ControlRef ): SInt32; external name '_GetControl32BitValue';
2675 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2676
2677
2678 {
2679 * SetControl32BitValue()
2680 *
2681 * Mac OS X threading:
2682 * Not thread safe
2683 *
2684 * Availability:
2685 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2686 * CarbonLib: in CarbonLib 1.0 and later
2687 * Non-Carbon CFM: in ControlsLib 8.5 and later
2688 }
2689 procedure SetControl32BitValue( theControl: ControlRef; newValue: SInt32 ); external name '_SetControl32BitValue';
2690 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2691
2692
2693 {
2694 * GetControl32BitMaximum()
2695 *
2696 * Mac OS X threading:
2697 * Not thread safe
2698 *
2699 * Availability:
2700 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2701 * CarbonLib: in CarbonLib 1.0 and later
2702 * Non-Carbon CFM: in ControlsLib 8.5 and later
2703 }
GetControl32BitMaximumnull2704 function GetControl32BitMaximum( theControl: ControlRef ): SInt32; external name '_GetControl32BitMaximum';
2705 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2706
2707
2708 {
2709 * SetControl32BitMaximum()
2710 *
2711 * Mac OS X threading:
2712 * Not thread safe
2713 *
2714 * Availability:
2715 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2716 * CarbonLib: in CarbonLib 1.0 and later
2717 * Non-Carbon CFM: in ControlsLib 8.5 and later
2718 }
2719 procedure SetControl32BitMaximum( theControl: ControlRef; newMaximum: SInt32 ); external name '_SetControl32BitMaximum';
2720 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2721
2722
2723 {
2724 * GetControl32BitMinimum()
2725 *
2726 * Mac OS X threading:
2727 * Not thread safe
2728 *
2729 * Availability:
2730 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2731 * CarbonLib: in CarbonLib 1.0 and later
2732 * Non-Carbon CFM: in ControlsLib 8.5 and later
2733 }
GetControl32BitMinimumnull2734 function GetControl32BitMinimum( theControl: ControlRef ): SInt32; external name '_GetControl32BitMinimum';
2735 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2736
2737
2738 {
2739 * SetControl32BitMinimum()
2740 *
2741 * Mac OS X threading:
2742 * Not thread safe
2743 *
2744 * Availability:
2745 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2746 * CarbonLib: in CarbonLib 1.0 and later
2747 * Non-Carbon CFM: in ControlsLib 8.5 and later
2748 }
2749 procedure SetControl32BitMinimum( theControl: ControlRef; newMinimum: SInt32 ); external name '_SetControl32BitMinimum';
2750 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2751
2752
2753 {
2754 IsValidControlHandle will tell you if the handle you pass in belongs to a control
2755 the Control Manager knows about. It does not sanity check the data in the control.
2756 }
2757
2758 {
2759 * IsValidControlHandle()
2760 *
2761 * Mac OS X threading:
2762 * Not thread safe
2763 *
2764 * Availability:
2765 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2766 * CarbonLib: in CarbonLib 1.0 and later
2767 * Non-Carbon CFM: in ControlsLib 8.5 and later
2768 }
IsValidControlHandlenull2769 function IsValidControlHandle( theControl: ControlRef ): Boolean; external name '_IsValidControlHandle';
2770 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2771
2772
2773 {��������������������������������������������������������������������������������������}
2774 { � Control IDs }
2775 { Carbon only. }
2776 {��������������������������������������������������������������������������������������}
2777 {$endc} {not TARGET_CPU_64}
2778
2779 {
2780 * ControlID
2781 *
2782 * Summary:
2783 * A unique identifier for a control in a window.
2784 }
2785 type
2786 ControlIDPtr = ^ControlID;
2787 ControlID = record
2788 {
2789 * A four-character signature. When assigning a control ID to your
2790 * own controls, you should typically use your application signature
2791 * here, or some other signature with an uppercase character. Apple
2792 * reserves signatures that contain only lowercase characters.
2793 }
2794 signature: OSType;
2795
2796 {
2797 * A integer identifying the control. This value should be unique for
2798 * a given control across all controls in the same window with the
2799 * same signature.
2800 }
2801 id: SInt32;
2802 end;
2803 {$ifc not TARGET_CPU_64}
2804 {
2805 * SetControlID()
2806 *
2807 * Mac OS X threading:
2808 * Not thread safe
2809 *
2810 * Availability:
2811 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2812 * CarbonLib: in CarbonLib 1.0 and later
2813 * Non-Carbon CFM: not available
2814 }
SetControlIDnull2815 function SetControlID( inControl: ControlRef; const (*var*) inID: ControlID ): OSStatus; external name '_SetControlID';
2816 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2817
2818
2819 {
2820 * GetControlID()
2821 *
2822 * Mac OS X threading:
2823 * Not thread safe
2824 *
2825 * Availability:
2826 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2827 * CarbonLib: in CarbonLib 1.0 and later
2828 * Non-Carbon CFM: not available
2829 }
GetControlIDnull2830 function GetControlID( inControl: ControlRef; var outID: ControlID ): OSStatus; external name '_GetControlID';
2831 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2832
2833
2834 {
2835 * GetControlByID()
2836 *
2837 * Discussion:
2838 * Find a control in a window by its unique ID.
2839 *
2840 * HIView Notes: As of Mac OS X 10.3, this call is replaced by
2841 * HIViewFindByID. That call lets you start your search at any point
2842 * in the hierarchy, as the first parameter is a view and not a
2843 * window. Either will work, but the HIView API is preferred.
2844 *
2845 * Mac OS X threading:
2846 * Not thread safe
2847 *
2848 * Parameters:
2849 *
2850 * inWindow:
2851 * The window to search.
2852 *
2853 * inID:
2854 * The ID to search for.
2855 *
2856 * outControl:
2857 * The control that was found, or NULL if no control in the window
2858 * had the ID specified.
2859 *
2860 * Availability:
2861 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2862 * CarbonLib: in CarbonLib 1.0 and later
2863 * Non-Carbon CFM: not available
2864 }
GetControlByIDnull2865 function GetControlByID( inWindow: WindowRef; const (*var*) inID: ControlID; var outControl: ControlRef ): OSStatus; external name '_GetControlByID';
2866 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2867
2868
2869 {��������������������������������������������������������������������������������������}
2870 { � Control Command IDs }
2871 { Carbon only. }
2872 {��������������������������������������������������������������������������������������}
2873 {
2874 * SetControlCommandID()
2875 *
2876 * Mac OS X threading:
2877 * Not thread safe
2878 *
2879 * Availability:
2880 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2881 * CarbonLib: in CarbonLib 1.1 and later
2882 * Non-Carbon CFM: not available
2883 }
SetControlCommandIDnull2884 function SetControlCommandID( inControl: ControlRef; inCommandID: UInt32 ): OSStatus; external name '_SetControlCommandID';
2885 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2886
2887
2888 {
2889 * GetControlCommandID()
2890 *
2891 * Mac OS X threading:
2892 * Not thread safe
2893 *
2894 * Availability:
2895 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2896 * CarbonLib: in CarbonLib 1.1 and later
2897 * Non-Carbon CFM: not available
2898 }
GetControlCommandIDnull2899 function GetControlCommandID( inControl: ControlRef; var outCommandID: UInt32 ): OSStatus; external name '_GetControlCommandID';
2900 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2901
2902
2903 {��������������������������������������������������������������������������������������}
2904 { � Control Identification }
2905 { Carbon only. }
2906 {��������������������������������������������������������������������������������������}
2907 {$endc} {not TARGET_CPU_64}
2908
2909 type
2910 ControlKindPtr = ^ControlKind;
2911 ControlKind = record
2912 signature: OSType;
2913 kind: OSType;
2914 end;
2915
2916 {
2917 * Discussion:
2918 * Control signature kind
2919 }
2920 const
2921 {
2922 * Signature of all system controls.
2923 }
2924 kControlKindSignatureApple = FourCharCode('appl');
2925
2926 {$ifc not TARGET_CPU_64}
2927 {
2928 * GetControlKind()
2929 *
2930 * Summary:
2931 * Returns the kind of the given control.
2932 *
2933 * Discussion:
2934 * GetControlKind allows you to query the kind of any control.
2935 *
2936 *
2937 * HIView Note: With the advent of HIView, you can just as easily
2938 * use HIObjectCopyClassID to determine what kind of control you are
2939 * looking at. The class ID is only truly deterministic for
2940 * HIToolbox-supplied controls as of Mac OS X 10.3 or later due to
2941 * the fact that the class IDs underwent naming changes between Mac
2942 * OS X 10.2 and Mac OS X 10.3.
2943 *
2944 * Mac OS X threading:
2945 * Not thread safe
2946 *
2947 * Parameters:
2948 *
2949 * inControl:
2950 * The ControlRef to find the kind of.
2951 *
2952 * outControlKind:
2953 * On successful exit, this will contain the control signature and
2954 * kind. See ControlDefinitions.h for the kinds of each system
2955 * control.
2956 *
2957 * Availability:
2958 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
2959 * CarbonLib: in CarbonLib 1.5 and later
2960 * Non-Carbon CFM: not available
2961 }
GetControlKindnull2962 function GetControlKind( inControl: ControlRef; var outControlKind: ControlKind ): OSStatus; external name '_GetControlKind';
2963 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
2964
2965
2966 {��������������������������������������������������������������������������������������}
2967 { � Properties }
2968 {��������������������������������������������������������������������������������������}
2969 {$endc} {not TARGET_CPU_64}
2970
2971 const
2972 kControlPropertyPersistent = $00000001; { whether this property gets saved when flattening the control}
2973
2974 {$ifc not TARGET_CPU_64}
2975 {
2976 * GetControlProperty()
2977 *
2978 * Discussion:
2979 * Obtains a piece of data that has been previously associated with
2980 * a control.
2981 *
2982 * Mac OS X threading:
2983 * Not thread safe
2984 *
2985 * Parameters:
2986 *
2987 * control:
2988 * A ControlRef to the control whose associated data you wish to
2989 * obtain.
2990 *
2991 * propertyCreator:
2992 * An OSType signature, usually the signature of your application.
2993 * Do not use all lower case signatures, as these are reserved for
2994 * use by Apple.
2995 *
2996 * propertyTag:
2997 * An OSType signature, application-defined, identifying the
2998 * property.
2999 *
3000 * bufferSize:
3001 * A value specifying the size of the data to be retrieved. If the
3002 * size of the data is unknown, use the function
3003 * GetControlPropertySize to get the data�s size. If the size
3004 * specified in the bufferSize parameter does not match the actual
3005 * size of the property, GetControlProperty only retrieves data up
3006 * to the size specified or up to the actual size of the property,
3007 * whichever is smaller, and an error is returned.
3008 *
3009 * actualSize:
3010 * On output, the actual size of the property data. Pass NULL if
3011 * you don't want this information.
3012 *
3013 * propertyBuffer:
3014 * On input, a pointer to a buffer. This buffer must be big enough
3015 * to fit bufferSize bytes of data. On return, this buffer
3016 * contains a copy of the data that is associated with the
3017 * specified control.
3018 *
3019 * Result:
3020 * A result code indicating success or failure. Most common return
3021 * values are: noErr, paramErr, controlHandleInvalidErr,
3022 * controlPropertyInvalid and controlPropertyNotFoundErr.
3023 *
3024 * Availability:
3025 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3026 * CarbonLib: in CarbonLib 1.0 and later
3027 * Non-Carbon CFM: in ControlsLib 8.5 and later
3028 }
GetControlPropertynull3029 function GetControlProperty( control: ControlRef; propertyCreator: OSType; propertyTag: OSType; bufferSize: ByteCount; actualSize: ByteCountPtr { can be NULL }; propertyBuffer: UnivPtr ): OSStatus; external name '_GetControlProperty';
3030 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3031
3032
3033 {
3034 * GetControlPropertySize()
3035 *
3036 * Mac OS X threading:
3037 * Not thread safe
3038 *
3039 * Availability:
3040 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3041 * CarbonLib: in CarbonLib 1.0 and later
3042 * Non-Carbon CFM: in ControlsLib 8.5 and later
3043 }
GetControlPropertySizenull3044 function GetControlPropertySize( control: ControlRef; propertyCreator: OSType; propertyTag: OSType; var size: ByteCount ): OSStatus; external name '_GetControlPropertySize';
3045 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3046
3047
3048 {
3049 * SetControlProperty()
3050 *
3051 * Discussion:
3052 * Obtains a piece of data that has been previously associated with
3053 * a control.
3054 *
3055 * Mac OS X threading:
3056 * Not thread safe
3057 *
3058 * Parameters:
3059 *
3060 * control:
3061 * A ControlRef to the control whose associated data you wish to
3062 * obtain.
3063 *
3064 * propertyCreator:
3065 * An OSType signature, usually the signature of your application.
3066 * Do not use all lower case signatures, as these are reserved for
3067 * use by Apple.
3068 *
3069 * propertyTag:
3070 * An OSType signature, application-defined, identifying the
3071 * property.
3072 *
3073 * propertySize:
3074 * A value specifying the size of the data.
3075 *
3076 * propertyData:
3077 * On input, a pointer to data of any type. Pass a pointer to a
3078 * buffer containing the data to be associated; this buffer should
3079 * be at least as large as the value specified in the propertySize
3080 * parameter.
3081 *
3082 * propertyBuffer:
3083 * On input, a pointer to a buffer. This buffer must be big enough
3084 * to fit bufferSize bytes of data. On return, this buffer
3085 * contains a copy of the data that is associated with the
3086 * specified control.
3087 *
3088 * Result:
3089 * A result code indicating success or failure. Most common return
3090 * values are: noErr, paramErr, controlHandleInvalidErr and
3091 * controlPropertyInvalid
3092 *
3093 * Availability:
3094 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3095 * CarbonLib: in CarbonLib 1.0 and later
3096 * Non-Carbon CFM: in ControlsLib 8.5 and later
3097 }
SetControlPropertynull3098 function SetControlProperty( control: ControlRef; propertyCreator: OSType; propertyTag: OSType; propertySize: ByteCount; propertyData: {const} UnivPtr ): OSStatus; external name '_SetControlProperty';
3099 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3100
3101
3102 {
3103 * RemoveControlProperty()
3104 *
3105 * Mac OS X threading:
3106 * Not thread safe
3107 *
3108 * Availability:
3109 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3110 * CarbonLib: in CarbonLib 1.0 and later
3111 * Non-Carbon CFM: in ControlsLib 8.5 and later
3112 }
RemoveControlPropertynull3113 function RemoveControlProperty( control: ControlRef; propertyCreator: OSType; propertyTag: OSType ): OSStatus; external name '_RemoveControlProperty';
3114 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3115
3116
3117 {
3118 * GetControlPropertyAttributes()
3119 *
3120 * Mac OS X threading:
3121 * Not thread safe
3122 *
3123 * Availability:
3124 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3125 * CarbonLib: in CarbonLib 1.0 and later
3126 * Non-Carbon CFM: not available
3127 }
GetControlPropertyAttributesnull3128 function GetControlPropertyAttributes( control: ControlRef; propertyCreator: OSType; propertyTag: OSType; var attributes: OptionBits ): OSStatus; external name '_GetControlPropertyAttributes';
3129 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3130
3131
3132 {
3133 * ChangeControlPropertyAttributes()
3134 *
3135 * Mac OS X threading:
3136 * Not thread safe
3137 *
3138 * Availability:
3139 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3140 * CarbonLib: in CarbonLib 1.0 and later
3141 * Non-Carbon CFM: not available
3142 }
ChangeControlPropertyAttributesnull3143 function ChangeControlPropertyAttributes( control: ControlRef; propertyCreator: OSType; propertyTag: OSType; attributesToSet: OptionBits; attributesToClear: OptionBits ): OSStatus; external name '_ChangeControlPropertyAttributes';
3144 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3145
3146
3147 {��������������������������������������������������������������������������������������}
3148 { � Control Regions (Appearance 1.1 or later) }
3149 { See the discussion on meta-parts in this header for more information }
3150 {��������������������������������������������������������������������������������������}
3151 {
3152 * GetControlRegion()
3153 *
3154 * Mac OS X threading:
3155 * Not thread safe
3156 *
3157 * Availability:
3158 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3159 * CarbonLib: in CarbonLib 1.0 and later
3160 * Non-Carbon CFM: in ControlsLib 8.5 and later
3161 }
GetControlRegionnull3162 function GetControlRegion( inControl: ControlRef; inPart: ControlPartCode; outRegion: RgnHandle ): OSStatus; external name '_GetControlRegion';
3163 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3164
3165
3166 {��������������������������������������������������������������������������������������}
3167 { � Control Variant }
3168 {��������������������������������������������������������������������������������������}
3169 {
3170 * GetControlVariant()
3171 *
3172 * Mac OS X threading:
3173 * Not thread safe
3174 *
3175 * Availability:
3176 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3177 * CarbonLib: in CarbonLib 1.0 and later
3178 * Non-Carbon CFM: in InterfaceLib 7.1 and later
3179 }
GetControlVariantnull3180 function GetControlVariant( theControl: ControlRef ): ControlVariant; external name '_GetControlVariant';
3181 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3182
3183
3184 {��������������������������������������������������������������������������������������}
3185 { � Control Action }
3186 {��������������������������������������������������������������������������������������}
3187 {
3188 * SetControlAction()
3189 *
3190 * Mac OS X threading:
3191 * Not thread safe
3192 *
3193 * Availability:
3194 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3195 * CarbonLib: in CarbonLib 1.0 and later
3196 * Non-Carbon CFM: in InterfaceLib 7.1 and later
3197 }
3198 procedure SetControlAction( theControl: ControlRef; actionProc: ControlActionUPP ); external name '_SetControlAction';
3199 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3200
3201
3202 {
3203 * GetControlAction()
3204 *
3205 * Mac OS X threading:
3206 * Not thread safe
3207 *
3208 * Availability:
3209 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3210 * CarbonLib: in CarbonLib 1.0 and later
3211 * Non-Carbon CFM: in InterfaceLib 7.1 and later
3212 }
GetControlActionnull3213 function GetControlAction( theControl: ControlRef ): ControlActionUPP; external name '_GetControlAction';
3214 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3215
3216
3217 {��������������������������������������������������������������������������������������}
3218 { � Control Accessors }
3219 {��������������������������������������������������������������������������������������}
3220 {
3221 * SetControlReference()
3222 *
3223 * Summary:
3224 * This is somewhat of a legacy API. The Set/GetControlProperty API
3225 * is a better mechanism to associate data with a control.
3226 *
3227 * Discussion:
3228 * When you create a control, you specify an initial reference
3229 * value, either in the control resource or in the refCon parameter
3230 * of the function NewControl. You can use the function
3231 * GetControlReference to obtain the current value. You can use this
3232 * value for any purpose.
3233 *
3234 * Mac OS X threading:
3235 * Not thread safe
3236 *
3237 * Parameters:
3238 *
3239 * theControl:
3240 * A ControlRef to the control whose reference value you wish to
3241 * change.
3242 *
3243 * data:
3244 * The new reference value for the control.
3245 *
3246 * Availability:
3247 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3248 * CarbonLib: in CarbonLib 1.0 and later
3249 * Non-Carbon CFM: in InterfaceLib 7.1 and later
3250 }
3251 procedure SetControlReference( theControl: ControlRef; data: SRefCon ); external name '_SetControlReference';
3252 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3253
3254
3255 {
3256 * GetControlReference()
3257 *
3258 * Summary:
3259 * This is somewhat of a legacy API. The Set/GetControlProperty API
3260 * is a better mechanism to associate data with a control.
3261 *
3262 * Discussion:
3263 * When you create a control, you specify an initial reference
3264 * value, either in the control resource or in the refCon parameter
3265 * of the function NewControl. You can use this reference value for
3266 * any purpose, and you can use the function SetControlReference to
3267 * change this value.
3268 *
3269 * Mac OS X threading:
3270 * Not thread safe
3271 *
3272 * Parameters:
3273 *
3274 * theControl:
3275 * A ControlRef to the control whose reference value you wish to
3276 * retrieve.
3277 *
3278 * Result:
3279 * The current reference value for the specified control.
3280 *
3281 * Availability:
3282 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3283 * CarbonLib: in CarbonLib 1.0 and later
3284 * Non-Carbon CFM: in InterfaceLib 7.1 and later
3285 }
GetControlReferencenull3286 function GetControlReference( theControl: ControlRef ): SRefCon; external name '_GetControlReference';
3287 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3288
3289
3290 {��������������������������������������������������������������������������������������}
3291 { � Control Hierarchy (Appearance 1.0 and later only) }
3292 {��������������������������������������������������������������������������������������}
3293 {
3294 * SendControlMessage()
3295 *
3296 * Mac OS X threading:
3297 * Not thread safe
3298 *
3299 * Availability:
3300 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3301 * CarbonLib: in CarbonLib 1.0 and later
3302 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3303 }
SendControlMessagenull3304 function SendControlMessage( inControl: ControlRef; inMessage: SInt16; inParam: UnivPtr ): SInt32; external name '_SendControlMessage';
3305 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3306
3307
3308 {
3309 * CreateRootControl()
3310 *
3311 * Discussion:
3312 * Creates a new 'root control' for a window. This root is actually
3313 * the content area of a window, and spans all of Quickdraw space.
3314 *
3315 *
3316 * HIView Notes: In a composited window, this routine will return
3317 * errRootAlreadyExists. Technically, you cannot create a root
3318 * control in such a window. Instead you would embed views into the
3319 * content view of the window. GetRootControl will return the
3320 * content view in that situation as well.
3321 *
3322 * Mac OS X threading:
3323 * Not thread safe
3324 *
3325 * Parameters:
3326 *
3327 * inWindow:
3328 * The window for which to create a root control.
3329 *
3330 * outControl:
3331 * On exit, contains the window's root control. In Mac OS 10.1 and
3332 * CarbonLib 1.5 and later, this parameter may be NULL if you
3333 * don't need the ControlRef.
3334 *
3335 * Result:
3336 * A result code indicating success or failure. errRootAlreadyExists
3337 * is returned if the window already has a root control.
3338 *
3339 * Availability:
3340 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3341 * CarbonLib: in CarbonLib 1.0 and later
3342 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3343 }
CreateRootControlnull3344 function CreateRootControl( inWindow: WindowRef; outControl: ControlRefPtr { can be NULL } ): OSErr; external name '_CreateRootControl';
3345 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3346
3347
3348 {
3349 * GetRootControl()
3350 *
3351 * Discussion:
3352 * Returns the 'root control' for a given window. If no root exists
3353 * for the window, errNoRootControl is returned. This root control
3354 * represents the content area of the window, and spans all of
3355 * Quickdraw space.
3356 *
3357 * HIView Notes: With the advent of HIView, this API and concept are
3358 * considered deprecated. The root of the window in a composited
3359 * window is actually the structure view, and all views (window
3360 * widgets, content view, etc.) are subviews of that top-level view.
3361 * It can be fetched with HIViewGetRoot. In a composited window,
3362 * calling GetRootControl will return the content view, not the true
3363 * root to maintain compatibility with past usage of GetRootControl.
3364 * We recommend using HIViewFindByID with the kHIViewWindowContentID
3365 * control ID to fetch the content view instead of using this call.
3366 *
3367 * Mac OS X threading:
3368 * Not thread safe
3369 *
3370 * Parameters:
3371 *
3372 * inWindow:
3373 * The window to query.
3374 *
3375 * outControl:
3376 * The root control, on output.
3377 *
3378 * Result:
3379 * An operating system result code.
3380 *
3381 * Availability:
3382 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3383 * CarbonLib: in CarbonLib 1.0 and later
3384 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3385 }
GetRootControlnull3386 function GetRootControl( inWindow: WindowRef; var outControl: ControlRef ): OSErr; external name '_GetRootControl';
3387 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3388
3389
3390 {
3391 * EmbedControl()
3392 *
3393 * Discussion:
3394 * Adds a subcontrol to the given parent.
3395 *
3396 * HIView Note: This is replaced by HIViewAddSubview in Mac OS X
3397 * 10.2 and beyond. You can call either function in a composited or
3398 * non-composited window, but the HIView variant is preferred.
3399 *
3400 * Mac OS X threading:
3401 * Not thread safe
3402 *
3403 * Parameters:
3404 *
3405 * inControl:
3406 * The subcontrol being added.
3407 *
3408 * inContainer:
3409 * The control which will receive the new subcontrol.
3410 *
3411 * Result:
3412 * An operating system result code.
3413 * errNeedsCompositedWindow will be returned when you try to embed
3414 * into the content view in a non-compositing window; you can only
3415 * embed into the content view in compositing windows.
3416 *
3417 * Availability:
3418 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3419 * CarbonLib: in CarbonLib 1.0 and later
3420 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3421 }
EmbedControlnull3422 function EmbedControl( inControl: ControlRef; inContainer: ControlRef ): OSErr; external name '_EmbedControl';
3423 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3424
3425
3426 {
3427 * AutoEmbedControl()
3428 *
3429 * Discussion:
3430 * Based on the bounds of the given control, embed it in the window
3431 * specified. It basically finds the deepest parent the control
3432 * would fit into and embeds it there. This was invented primarily
3433 * for the Dialog Manager so that hierarchies could be generated
3434 * from the flattened DITL list.
3435 *
3436 * HIView Note: Do NOT call this API in a composited window, its
3437 * results will be unpredictable as the coordinate systems are very
3438 * different.
3439 *
3440 * Mac OS X threading:
3441 * Not thread safe
3442 *
3443 * Parameters:
3444 *
3445 * inControl:
3446 * The subcontrol being added.
3447 *
3448 * inWindow:
3449 * The window which will receive the new subcontrol.
3450 *
3451 * Result:
3452 * An operating system result code.
3453 *
3454 * Availability:
3455 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3456 * CarbonLib: in CarbonLib 1.0 and later
3457 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3458 }
AutoEmbedControlnull3459 function AutoEmbedControl( inControl: ControlRef; inWindow: WindowRef ): OSErr; external name '_AutoEmbedControl';
3460 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3461
3462
3463 {
3464 * GetSuperControl()
3465 *
3466 * Discussion:
3467 * Returns the parent control of the given one.
3468 *
3469 * HIView Note: HIViewGetSuperview is the preferred API as of Mac OS
3470 * X 10.2. Either call will work in a composited or non- composited
3471 * window.
3472 *
3473 * Mac OS X threading:
3474 * Not thread safe
3475 *
3476 * Parameters:
3477 *
3478 * inControl:
3479 * The control to query.
3480 *
3481 * outParent:
3482 * The parent control.
3483 *
3484 * Result:
3485 * An operating system result code.
3486 *
3487 * Availability:
3488 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3489 * CarbonLib: in CarbonLib 1.0 and later
3490 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3491 }
GetSuperControlnull3492 function GetSuperControl( inControl: ControlRef; var outParent: ControlRef ): OSErr; external name '_GetSuperControl';
3493 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3494
3495
3496 {
3497 * CountSubControls()
3498 *
3499 * Discussion:
3500 * Returns the number of children a given control has. This count
3501 * can then be used for calls to GetIndexedSubControl.
3502 *
3503 * HIView Note: As of Mac OS X 10.2, the preferred way to walk the
3504 * control hierarchy is to use HIViewGetFirstSubView followed by
3505 * repeated calls to HIViewGetNextView until NULL is returned.
3506 *
3507 * Mac OS X threading:
3508 * Not thread safe
3509 *
3510 * Parameters:
3511 *
3512 * inControl:
3513 * The control to query.
3514 *
3515 * outNumChildren:
3516 * A pointer to a UInt16 to receive the number of children
3517 * controls.
3518 *
3519 * Result:
3520 * An operating system result code.
3521 *
3522 * Availability:
3523 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3524 * CarbonLib: in CarbonLib 1.0 and later
3525 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3526 }
CountSubControlsnull3527 function CountSubControls( inControl: ControlRef; var outNumChildren: UInt16 ): OSErr; external name '_CountSubControls';
3528 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3529
3530
3531 {
3532 * GetIndexedSubControl()
3533 *
3534 * Discussion:
3535 * Returns the child control at a given index in the list of
3536 * subcontrols for the specified parent.
3537 *
3538 * HIView Note: As of Mac OS X 10.2, the preferred way to walk the
3539 * control hierarchy is to use HIViewGetFirstSubView followed by
3540 * repeated calls to HIViewGetNextView until NULL is returned.
3541 *
3542 * Mac OS X threading:
3543 * Not thread safe
3544 *
3545 * Parameters:
3546 *
3547 * inControl:
3548 * The parent control to query.
3549 *
3550 * inIndex:
3551 * The index of the subcontrol to fetch.
3552 *
3553 * outSubControl:
3554 * A pointer to a control reference to receive the subcontrol. If
3555 * the index is out of range, the contents of this parameter are
3556 * undefined after the call.
3557 *
3558 * Result:
3559 * An operating system result code.
3560 *
3561 * Availability:
3562 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3563 * CarbonLib: in CarbonLib 1.0 and later
3564 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3565 }
GetIndexedSubControlnull3566 function GetIndexedSubControl( inControl: ControlRef; inIndex: UInt16; var outSubControl: ControlRef ): OSErr; external name '_GetIndexedSubControl';
3567 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3568
3569
3570 {
3571 * SetControlSupervisor()
3572 *
3573 * Discussion:
3574 * Allow one view to intercept clicks for another. When something
3575 * like FindControl or the like is called on the target, it will
3576 * instead return the supervisor. This is largely deprecated these
3577 * days.
3578 *
3579 * HIView Note: As of Mac OS X 10.2, you can intercept subview
3580 * clicks by overriding the kEventControlInterceptSubviewClick event
3581 * (see CarbonEvents.h).
3582 *
3583 * Mac OS X threading:
3584 * Not thread safe
3585 *
3586 * Parameters:
3587 *
3588 * inControl:
3589 * The control to intercept clicks for.
3590 *
3591 * inBoss:
3592 * The new supervisor control (can be NULL).
3593 *
3594 * Result:
3595 * An operating system result code.
3596 *
3597 * Availability:
3598 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3599 * CarbonLib: in CarbonLib 1.0 and later
3600 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3601 }
SetControlSupervisornull3602 function SetControlSupervisor( inControl: ControlRef; inBoss: ControlRef { can be NULL } ): OSErr; external name '_SetControlSupervisor';
3603 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3604
3605
3606 {��������������������������������������������������������������������������������������}
3607 { � Keyboard Focus (available only with Appearance 1.0 and later) }
3608 {��������������������������������������������������������������������������������������}
3609 {
3610 * GetKeyboardFocus()
3611 *
3612 * Discussion:
3613 * Passes back the currently focused control within the given window.
3614 *
3615 * Mac OS X threading:
3616 * Not thread safe
3617 *
3618 * Parameters:
3619 *
3620 * inWindow:
3621 * The window to get the focus of.
3622 *
3623 * outControl:
3624 * On output, this will contain the ControlRef that is currently
3625 * focused in the given window. If there is no currently focused
3626 * control, outControl will contain NULL.
3627 *
3628 * Result:
3629 * An operating system result code.
3630 *
3631 * Availability:
3632 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3633 * CarbonLib: in CarbonLib 1.0 and later
3634 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3635 }
GetKeyboardFocusnull3636 function GetKeyboardFocus( inWindow: WindowRef; var outControl: ControlRef ): OSErr; external name '_GetKeyboardFocus';
3637 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3638
3639
3640 {
3641 * SetKeyboardFocus()
3642 *
3643 * Discussion:
3644 * Focuses the given part of the given control in a particular
3645 * window. If another control is currently focused in the window,
3646 * focus will be removed from the other control before focus is
3647 * given to the desired control. SetKeyboardFocus respects the full
3648 * keyboard navigation mode.
3649 *
3650 * Mac OS X threading:
3651 * Not thread safe
3652 *
3653 * Parameters:
3654 *
3655 * inWindow:
3656 * The window which contains the control you want to focus. If the
3657 * window does not contain the control, an error will be returned.
3658 *
3659 * inControl:
3660 * The control you want to focus.
3661 *
3662 * inPart:
3663 * The part of the control you wish to focus. You may pass
3664 * kControlFocusNoPart to clear the focus in the given control.
3665 * You may pass kControlFocusNextPart or kControlFocusPrevPart to
3666 * move the focus within the given control.
3667 *
3668 * Result:
3669 * An operating system result code.
3670 *
3671 * Availability:
3672 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3673 * CarbonLib: in CarbonLib 1.0 and later
3674 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3675 }
SetKeyboardFocusnull3676 function SetKeyboardFocus( inWindow: WindowRef; inControl: ControlRef; inPart: ControlFocusPart ): OSErr; external name '_SetKeyboardFocus';
3677 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3678
3679
3680 {
3681 * AdvanceKeyboardFocus()
3682 *
3683 * Discussion:
3684 * Advances the focus to the next most appropriate control. Unless
3685 * overridden in some fashion (either by overriding certain carbon
3686 * events or using the HIViewSetNextFocus API), the Toolbox will use
3687 * a spacially determinant method of focusing, attempting to focus
3688 * left to right, top to bottom in a window, taking groups of
3689 * controls into account. AdvanceKeyboardFocus does not respect the
3690 * full keyboard navigation mode. It will only advance the focus
3691 * between traditionally focusable controls. If you want to advance
3692 * the focus in a way that respects the full keyboard navigation
3693 * mode, use the HIViewAdvanceFocus API. AdvanceKeyboardFocus does
3694 * not work for windows in compositing mode. For compositing
3695 * windows, you must call HIViewAdvanceFocus instead.
3696 *
3697 * Mac OS X threading:
3698 * Not thread safe
3699 *
3700 * Parameters:
3701 *
3702 * inWindow:
3703 * The window to advance the focus in.
3704 *
3705 * Result:
3706 * An operating system result code.
3707 *
3708 * Availability:
3709 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3710 * CarbonLib: in CarbonLib 1.0 and later
3711 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3712 }
AdvanceKeyboardFocusnull3713 function AdvanceKeyboardFocus( inWindow: WindowRef ): OSErr; external name '_AdvanceKeyboardFocus';
3714 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3715
3716
3717 {
3718 * ReverseKeyboardFocus()
3719 *
3720 * Discussion:
3721 * Reverses the focus to the next most appropriate control. Unless
3722 * overridden in some fashion (either by overriding certain carbon
3723 * events or using the HIViewSetNextFocus API), the Toolbox will use
3724 * a spacially determinant method of focusing, attempting to focus
3725 * left to right, top to bottom in a window, taking groups of
3726 * controls into account. ReverseKeyboardFocus does not respect the
3727 * full keyboard navigation mode. It will only reverse the focus
3728 * between traditionally focusable controls. If you want to reverse
3729 * the focus in a way that respects the full keyboard navigation
3730 * mode, use the HIViewAdvanceFocus API. ReverseKeyboardFocus does
3731 * not work for windows in compositing mode. For compositing
3732 * windows, you must call HIViewAdvanceFocus instead.
3733 *
3734 * Mac OS X threading:
3735 * Not thread safe
3736 *
3737 * Parameters:
3738 *
3739 * inWindow:
3740 * The window to reverse the focus in.
3741 *
3742 * Result:
3743 * An operating system result code.
3744 *
3745 * Availability:
3746 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3747 * CarbonLib: in CarbonLib 1.0 and later
3748 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3749 }
ReverseKeyboardFocusnull3750 function ReverseKeyboardFocus( inWindow: WindowRef ): OSErr; external name '_ReverseKeyboardFocus';
3751 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3752
3753
3754 {
3755 * ClearKeyboardFocus()
3756 *
3757 * Discussion:
3758 * Clears focus from the currently focused control in a given
3759 * window. The window will be left such that no control is focused
3760 * within it.
3761 *
3762 * Mac OS X threading:
3763 * Not thread safe
3764 *
3765 * Parameters:
3766 *
3767 * inWindow:
3768 * The window that you want to clear the focus in.
3769 *
3770 * Result:
3771 * An operating system result code.
3772 *
3773 * Availability:
3774 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3775 * CarbonLib: in CarbonLib 1.0 and later
3776 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3777 }
ClearKeyboardFocusnull3778 function ClearKeyboardFocus( inWindow: WindowRef ): OSErr; external name '_ClearKeyboardFocus';
3779 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3780
3781
3782 {��������������������������������������������������������������������������������������}
3783 { � Control Data (available only with Appearance 1.0 and later) }
3784 {��������������������������������������������������������������������������������������}
3785
3786 {
3787 * GetControlFeatures()
3788 *
3789 * Discussion:
3790 * Returns the set of behaviors, etc. the given view supports. This
3791 * set of features is immutable before Mac OS X 10.3. As of that
3792 * release, the features can be changed with HIViewChangeFeatures.
3793 * That API is the recommended call on Mac OS X 10.3 and later.
3794 *
3795 * Mac OS X threading:
3796 * Not thread safe
3797 *
3798 * Parameters:
3799 *
3800 * inControl:
3801 * The control to query.
3802 *
3803 * outFeatures:
3804 * A pointer to a 32-bit feature bitfield.
3805 *
3806 * Result:
3807 * An operating system error code.
3808 *
3809 * Availability:
3810 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3811 * CarbonLib: in CarbonLib 1.0 and later
3812 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3813 }
GetControlFeaturesnull3814 function GetControlFeatures( inControl: ControlRef; var outFeatures: UInt32 ): OSErr; external name '_GetControlFeatures';
3815 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3816
3817
3818 {
3819 * SetControlData()
3820 *
3821 * Mac OS X threading:
3822 * Not thread safe
3823 *
3824 * Availability:
3825 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3826 * CarbonLib: in CarbonLib 1.0 and later
3827 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3828 }
SetControlDatanull3829 function SetControlData( inControl: ControlRef; inPart: ControlPartCode; inTagName: ResType; inSize: Size; inData: {const} UnivPtr ): OSErr; external name '_SetControlData';
3830 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3831
3832
3833 {
3834 * GetControlData()
3835 *
3836 * Mac OS X threading:
3837 * Not thread safe
3838 *
3839 * Availability:
3840 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3841 * CarbonLib: in CarbonLib 1.0 and later
3842 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3843 }
GetControlDatanull3844 function GetControlData( inControl: ControlRef; inPart: ControlPartCode; inTagName: ResType; inBufferSize: Size; inBuffer: UnivPtr; outActualSize: SizePtr { can be NULL } ): OSErr; external name '_GetControlData';
3845 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3846
3847
3848 {
3849 * GetControlDataSize()
3850 *
3851 * Mac OS X threading:
3852 * Not thread safe
3853 *
3854 * Availability:
3855 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3856 * CarbonLib: in CarbonLib 1.0 and later
3857 * Non-Carbon CFM: in AppearanceLib 1.0 and later
3858 }
GetControlDataSizenull3859 function GetControlDataSize( inControl: ControlRef; inPart: ControlPartCode; inTagName: ResType; var outMaxSize: Size ): OSErr; external name '_GetControlDataSize';
3860 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3861
3862
3863 {��������������������������������������������������������������������������������������}
3864 { � Control Drag & Drop }
3865 { Carbon only. }
3866 {��������������������������������������������������������������������������������������}
3867 {$endc} {not TARGET_CPU_64}
3868
3869 {
3870 * Discussion:
3871 * DragTrackingMessage values for use with
3872 * HandleControlDragTracking. These are deprecated in favor of the
3873 * drag Carbon Events introduced in Mac OS X 10.2 via HIView.
3874 }
3875 const
3876 {
3877 * The drag was previously outside the control and it just now
3878 * entered the control.
3879 }
3880 kDragTrackingEnterControl = 2;
3881
3882 {
3883 * The drag was previously inside the control and it is still inside
3884 * the control.
3885 }
3886 kDragTrackingInControl = 3;
3887
3888 {
3889 * The drag was previously inside the control and it just now left
3890 * the control.
3891 }
3892 kDragTrackingLeaveControl = 4;
3893
3894
3895 {$ifc not TARGET_CPU_64}
3896 {
3897 * HandleControlDragTracking()
3898 *
3899 * Summary:
3900 * Tells a control to respond visually to a drag.
3901 *
3902 * Discussion:
3903 * Call HandleControlDragTracking when a drag is above a control in
3904 * your window and you want to give that control a chance to draw
3905 * appropriately in response to the drag. Note that in order for a
3906 * control to have any chance of responding to this API, you must
3907 * enable the control's drag and drop support with
3908 * SetControlDragTrackingEnabled.
3909 *
3910 * HIView Note: The HandleControlDragTracking API should not be
3911 * called in a composited window. Instead, the
3912 * SetAutomaticControlDragTrackingEnabledForWindow API should be
3913 * used to enable automatic control drag tracking.
3914 *
3915 * Mac OS X threading:
3916 * Not thread safe
3917 *
3918 * Parameters:
3919 *
3920 * inControl:
3921 * The control the drag is over. Most controls won't track drags
3922 * unless you enable drag tracking on it with
3923 * SetControlDragTrackingEnabled.
3924 *
3925 * inMessage:
3926 * A drag message indicating the state of the drag above the
3927 * control. The meaning of the value you pass in must be relative
3928 * to the control, not the whole window. For when the drag first
3929 * enters the control, you should pass kDragTrackingEnterControl.
3930 * While the drag stays within the control, pass
3931 * kDragTrackingInControl. When the drag leaves the control, pass
3932 * kDragTrackingLeaveControl.
3933 *
3934 * inDrag:
3935 * The drag reference that is over the control.
3936 *
3937 * outLikesDrag:
3938 * On output, this will be a boolean indicating whether the
3939 * control "likes" the drag. A control "likes" the drag if the
3940 * data in the drag ref can be accepted by the control. If the
3941 * control does not like the drag, don't bother calling
3942 * HandleControlDragReceive if the user drops the dragged object
3943 * onto the control.
3944 *
3945 * Result:
3946 * A result code indicating success or failure.
3947 *
3948 * Availability:
3949 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3950 * CarbonLib: in CarbonLib 1.0 and later
3951 * Non-Carbon CFM: in ControlsLib 9.0 and later
3952 }
HandleControlDragTrackingnull3953 function HandleControlDragTracking( inControl: ControlRef; inMessage: DragTrackingMessage; inDrag: DragReference; var outLikesDrag: Boolean ): OSStatus; external name '_HandleControlDragTracking';
3954 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3955
3956
3957 {
3958 * HandleControlDragReceive()
3959 *
3960 * Summary:
3961 * Tells a control to accept the data in drag reference.
3962 *
3963 * Discussion:
3964 * Call HandleControlDragReceive when the user dropped a drag on a
3965 * control in your window. This gives the control the opportunity to
3966 * pull any interesting data out of the drag and insert the data
3967 * into itself. Note that in order for a control to have any chance
3968 * of responding to this API, you must enable the control's drag and
3969 * drop support with SetControlDragTrackingEnabled.
3970 *
3971 * HIView Note: The HandleControlDragReceive API should not be
3972 * called in a composited window. Instead, the
3973 * SetAutomaticControlDragTrackingEnabledForWindow API should be
3974 * used to enable automatic control drag tracking.
3975 *
3976 * Mac OS X threading:
3977 * Not thread safe
3978 *
3979 * Parameters:
3980 *
3981 * inControl:
3982 * The control that should accept the data. Most controls won't
3983 * accept drags unless you enable drag tracking on it with
3984 * SetControlDragTrackingEnabled.
3985 *
3986 * inDrag:
3987 * The drag reference that was dropped on the control.
3988 *
3989 * Result:
3990 * A result code indicating success or failure.
3991 *
3992 * Availability:
3993 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
3994 * CarbonLib: in CarbonLib 1.0 and later
3995 * Non-Carbon CFM: in ControlsLib 9.0 and later
3996 }
HandleControlDragReceivenull3997 function HandleControlDragReceive( inControl: ControlRef; inDrag: DragReference ): OSStatus; external name '_HandleControlDragReceive';
3998 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
3999
4000
4001 {
4002 * SetControlDragTrackingEnabled()
4003 *
4004 * Summary:
4005 * Tells a control that it should track and receive drags, including
4006 * the kEventControlDrag* suite of Carbon events.
4007 *
4008 * Discussion:
4009 * Call SetControlDragTrackingEnabled to enable a control's support
4010 * for drag and drop, including receipt of the kEventControlDrag*
4011 * suite of Carbon events. Controls won't receive these events or
4012 * track drags unless you first turn on drag and drop support with
4013 * this API. Some controls don't support drag and drop at all; these
4014 * controls won't track or receive drags even if you call this API
4015 * with true (but they will receive the Carbon events, so you can
4016 * add your own drag handling to a control by installing your own
4017 * Carbon event handlers).
4018 *
4019 * Mac OS X threading:
4020 * Not thread safe
4021 *
4022 * Parameters:
4023 *
4024 * inControl:
4025 * The control whose drag tracking enabled state you'd like to set.
4026 *
4027 * inTracks:
4028 * A Boolean indicating whether you want this control to track and
4029 * receive drags.
4030 *
4031 * Result:
4032 * A result code indicating success or failure.
4033 *
4034 * Availability:
4035 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
4036 * CarbonLib: in CarbonLib 1.0 and later
4037 * Non-Carbon CFM: in ControlsLib 9.0 and later
4038 }
SetControlDragTrackingEnablednull4039 function SetControlDragTrackingEnabled( inControl: ControlRef; inTracks: Boolean ): OSStatus; external name '_SetControlDragTrackingEnabled';
4040 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4041
4042
4043 {
4044 * IsControlDragTrackingEnabled()
4045 *
4046 * Summary:
4047 * Tells you whether a control's drag track and receive support is
4048 * enabled.
4049 *
4050 * Discussion:
4051 * Call IsControlDragTrackingEnabled to query a whether a control's
4052 * drag and drop support is enabled. Some controls don't support
4053 * drag and drop at all; these controls won't track or receive drags
4054 * even if you call this API and see a true output value.
4055 *
4056 * Mac OS X threading:
4057 * Not thread safe
4058 *
4059 * Parameters:
4060 *
4061 * inControl:
4062 * The control whose drag tracking enabled state you'd like to
4063 * query.
4064 *
4065 * outTracks:
4066 * On output, this will contain a Boolean value whether the
4067 * control's drag and drop support is enabled.
4068 *
4069 * Result:
4070 * A result code indicating success or failure.
4071 *
4072 * Availability:
4073 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
4074 * CarbonLib: in CarbonLib 1.0 and later
4075 * Non-Carbon CFM: in ControlsLib 9.0 and later
4076 }
IsControlDragTrackingEnablednull4077 function IsControlDragTrackingEnabled( inControl: ControlRef; var outTracks: Boolean ): OSStatus; external name '_IsControlDragTrackingEnabled';
4078 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4079
4080
4081 {
4082 * SetAutomaticControlDragTrackingEnabledForWindow()
4083 *
4084 * Summary:
4085 * Enables or disables the Control Manager's automatic drag tracking
4086 * for a given window.
4087 *
4088 * Discussion:
4089 * Call SetAutomaticControlDragTrackingEnabledForWindow to turn on
4090 * or off the Control Manager's automatic drag tracking support for
4091 * a given window. If you are using a composited window or the
4092 * standard event handler, you should generally always call this API
4093 * if you need drag support for controls in your window.
4094 *
4095 * By default, your application code is responsible for installing
4096 * drag tracking and receive handlers on a newly created window. The
4097 * Control Manager, however, has support for automatically tracking
4098 * and receiving drags over controls. The Control Manager will
4099 * detect the control the drag is over and call
4100 * HandleControlDragTracking and HandleControlDragReceive
4101 * appropriately. By default, this automatic support is turned off.
4102 * You can turn on this support by calling
4103 * SetAutomaticControlDragTrackingEnabledForWindow with true. Note
4104 * that earlier versions of system software incorrectly enable this
4105 * support by default; do not rely on this buggy behavior. As of Mac
4106 * OS 10.1.3, Mac OS 9.2, and CarbonLib 1.4, the buggy behavior is
4107 * fixed, and you must call this routine with true to enable
4108 * automatic drag tracking.
4109 *
4110 * Mac OS X threading:
4111 * Not thread safe
4112 *
4113 * Parameters:
4114 *
4115 * inWindow:
4116 * The window for which you'd like to enable or disable the
4117 * Control Manager's automatic drag tracking support.
4118 *
4119 * inTracks:
4120 * A Boolean value indicating whether you want to enable the
4121 * Control Manager's automatic drag tracking support.
4122 *
4123 * Result:
4124 * A result code indicating success or failure.
4125 *
4126 * Availability:
4127 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
4128 * CarbonLib: in CarbonLib 1.0 and later
4129 * Non-Carbon CFM: in ControlsLib 9.0 and later
4130 }
SetAutomaticControlDragTrackingEnabledForWindownull4131 function SetAutomaticControlDragTrackingEnabledForWindow( inWindow: WindowRef; inTracks: Boolean ): OSStatus; external name '_SetAutomaticControlDragTrackingEnabledForWindow';
4132 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4133
4134
4135 {
4136 * IsAutomaticControlDragTrackingEnabledForWindow()
4137 *
4138 * Summary:
4139 * Tells you whether the Control Manager's automatic drag tracking
4140 * is enabled for a given window.
4141 *
4142 * Discussion:
4143 * Call IsAutomaticControlDragTrackingEnabledForWindow to query the
4144 * enabled state of the Control Manager's automatic drag tracking
4145 * support for a given window. See the information on
4146 * SetAutomaticControlDragTrackingEnabledForWindow for more details.
4147 *
4148 * Mac OS X threading:
4149 * Not thread safe
4150 *
4151 * Parameters:
4152 *
4153 * inWindow:
4154 * The window whose Control Manager automatic drag tracking enable
4155 * state you'd like to query.
4156 *
4157 * outTracks:
4158 * On output, this will contain a Boolean value whether the
4159 * Control Manager's automatic drag tracking is enabled.
4160 *
4161 * Result:
4162 * A result code indicating success or failure.
4163 *
4164 * Availability:
4165 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
4166 * CarbonLib: in CarbonLib 1.0 and later
4167 * Non-Carbon CFM: in ControlsLib 9.0 and later
4168 }
IsAutomaticControlDragTrackingEnabledForWindownull4169 function IsAutomaticControlDragTrackingEnabledForWindow( inWindow: WindowRef; var outTracks: Boolean ): OSStatus; external name '_IsAutomaticControlDragTrackingEnabledForWindow';
4170 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4171
4172 {$endc} {not TARGET_CPU_64}
4173
4174 (*
4175 #if OLDROUTINENAMES
4176 {��������������������������������������������������������������������������������������}
4177 { � OLDROUTINENAMES }
4178 {��������������������������������������������������������������������������������������}
4179 const
4180 useWFont = kControlUsesOwningWindowsFontVariant;
4181
4182 const
4183 inThumb = kControlIndicatorPart;
4184 kNoHiliteControlPart = kControlNoPart;
4185 kInIndicatorControlPart = kControlIndicatorPart;
4186 kReservedControlPart = kControlDisabledPart;
4187 kControlInactiveControlPart = kControlInactivePart;
4188
4189
4190 #define SetCTitle(theControl, title) SetControlTitle(theControl, title)
4191 #define GetCTitle(theControl, title) GetControlTitle(theControl, title)
4192 #define UpdtControl(theWindow, updateRgn) UpdateControls(theWindow, updateRgn)
4193 #define SetCtlValue(theControl, theValue) SetControlValue(theControl, theValue)
4194 #define GetCtlValue(theControl) GetControlValue(theControl)
4195 #define SetCtlMin(theControl, minValue) SetControlMinimum(theControl, minValue)
4196 #define GetCtlMin(theControl) GetControlMinimum(theControl)
4197 #define SetCtlMax(theControl, maxValue) SetControlMaximum(theControl, maxValue)
4198 #define GetCtlMax(theControl) GetControlMaximum(theControl)
4199 #define GetAuxCtl(theControl, acHndl) GetAuxiliaryControlRecord(theControl, acHndl)
4200 #define SetCRefCon(theControl, data) SetControlReference(theControl, data)
4201 #define GetCRefCon(theControl) GetControlReference(theControl)
4202 #define SetCtlAction(theControl, actionProc) SetControlAction(theControl, actionProc)
4203 #define GetCtlAction(theControl) GetControlAction(theControl)
4204 #define SetCtlColor(theControl, newColorTable) SetControlColor(theControl, newColorTable)
4205 #define GetCVariant(theControl) GetControlVariant(theControl)
4206 #define getctitle(theControl, title) getcontroltitle(theControl, title)
4207 #define setctitle(theControl, title) setcontroltitle(theControl, title)
4208 #endif { OLDROUTINENAMES }
4209 *)
4210
4211 { Getters }
4212 {$ifc not TARGET_CPU_64}
4213 {
4214 * GetControlBounds()
4215 *
4216 * Discussion:
4217 * Returns the bounds of a control, assumed to be in port
4218 * coordinates.
4219 *
4220 * HIView Notes: When called in a composited window, this routine
4221 * returns the view's frame; i.e., it is equivalent to calling
4222 * HIViewGetFrame.
4223 *
4224 * Mac OS X threading:
4225 * Not thread safe
4226 *
4227 * Parameters:
4228 *
4229 * control:
4230 * The control to query
4231 *
4232 * bounds:
4233 * A pointer to a Quickdraw rectangle to be filled in by this call.
4234 *
4235 * Result:
4236 * A pointer to the rectangle passed in bounds.
4237 *
4238 * Availability:
4239 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
4240 * CarbonLib: in CarbonLib 1.0 and later
4241 * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
4242 }
GetControlBoundsnull4243 function GetControlBounds( control: ControlRef; var bounds: Rect ): RectPtr; external name '_GetControlBounds';
4244 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4245
4246
4247 {
4248 * IsControlHilited()
4249 *
4250 * Mac OS X threading:
4251 * Not thread safe
4252 *
4253 * Availability:
4254 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
4255 * CarbonLib: in CarbonLib 1.0 and later
4256 * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
4257 }
IsControlHilitednull4258 function IsControlHilited( control: ControlRef ): Boolean; external name '_IsControlHilited';
4259 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4260
4261
4262 {
4263 * GetControlHilite()
4264 *
4265 * Mac OS X threading:
4266 * Not thread safe
4267 *
4268 * Availability:
4269 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
4270 * CarbonLib: in CarbonLib 1.0 and later
4271 * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
4272 }
GetControlHilitenull4273 function GetControlHilite( control: ControlRef ): UInt16; external name '_GetControlHilite';
4274 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4275
4276
4277 {
4278 * GetControlOwner()
4279 *
4280 * Discussion:
4281 * Returns the window a control is bound to, or NULL if the control
4282 * is not currently attached to any window.
4283 *
4284 * HIView replacement: HIViewGetWindow (Mac OS X 10.3 or later).
4285 * Either call will work in a composited or non-composited view.
4286 *
4287 * Mac OS X threading:
4288 * Not thread safe
4289 *
4290 * Parameters:
4291 *
4292 * control:
4293 * The control to query
4294 *
4295 * Result:
4296 * A window reference, or NULL if the control is not attached to a
4297 * window
4298 *
4299 * Availability:
4300 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
4301 * CarbonLib: in CarbonLib 1.0 and later
4302 * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
4303 }
GetControlOwnernull4304 function GetControlOwner( control: ControlRef ): WindowRef; external name '_GetControlOwner';
4305 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4306
4307
4308 {
4309 * GetControlDataHandle()
4310 *
4311 * Mac OS X threading:
4312 * Not thread safe
4313 *
4314 * Availability:
4315 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
4316 * CarbonLib: in CarbonLib 1.0 and later
4317 * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
4318 }
GetControlDataHandlenull4319 function GetControlDataHandle( control: ControlRef ): Handle; external name '_GetControlDataHandle';
4320 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4321
4322
4323 {
4324 * GetControlPopupMenuHandle()
4325 *
4326 * Mac OS X threading:
4327 * Not thread safe
4328 *
4329 * Availability:
4330 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
4331 * CarbonLib: in CarbonLib 1.0 and later
4332 * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
4333 }
GetControlPopupMenuHandlenull4334 function GetControlPopupMenuHandle( control: ControlRef ): MenuRef; external name '_GetControlPopupMenuHandle';
4335 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4336
4337
GetControlPopupMenuRefnull4338 function GetControlPopupMenuRef( control: ControlRef ): MenuRef; external name '_GetControlPopupMenuHandle';
4339 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4340 {
4341 * GetControlPopupMenuID()
4342 *
4343 * Mac OS X threading:
4344 * Not thread safe
4345 *
4346 * Availability:
4347 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
4348 * CarbonLib: in CarbonLib 1.0 and later
4349 * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
4350 }
GetControlPopupMenuIDnull4351 function GetControlPopupMenuID( control: ControlRef ): SInt16; external name '_GetControlPopupMenuID';
4352 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4353
4354
4355 { Setters }
4356 {
4357 * SetControlDataHandle()
4358 *
4359 * Mac OS X threading:
4360 * Not thread safe
4361 *
4362 * Availability:
4363 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
4364 * CarbonLib: in CarbonLib 1.0 and later
4365 * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
4366 }
4367 procedure SetControlDataHandle( control: ControlRef; dataHandle: Handle ); external name '_SetControlDataHandle';
4368 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4369
4370
4371 {
4372 * SetControlBounds()
4373 *
4374 * Discussion:
4375 * Sets the bounds of a control, assumed to be in port coordinates.
4376 *
4377 *
4378 * HIView Notes: When called in a composited window, this routine
4379 * sets the view's frame, i.e. it is equivalent to calling
4380 * HIViewSetFrame. The view will be invalidated as necessary in a
4381 * composited window. HIViewSetFrame is the recommended call in that
4382 * environment.
4383 *
4384 * Mac OS X threading:
4385 * Not thread safe
4386 *
4387 * Parameters:
4388 *
4389 * control:
4390 * The control to query
4391 *
4392 * bounds:
4393 * A pointer to a Quickdraw rectangle to be used by this call.
4394 *
4395 * Availability:
4396 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
4397 * CarbonLib: in CarbonLib 1.0 and later
4398 * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
4399 }
4400 procedure SetControlBounds( control: ControlRef; const (*var*) bounds: Rect ); external name '_SetControlBounds';
4401 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4402
4403
4404 {
4405 * SetControlPopupMenuHandle()
4406 *
4407 * Mac OS X threading:
4408 * Not thread safe
4409 *
4410 * Availability:
4411 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
4412 * CarbonLib: in CarbonLib 1.0 and later
4413 * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
4414 }
4415 procedure SetControlPopupMenuHandle( control: ControlRef; popupMenu: MenuRef ); external name '_SetControlPopupMenuHandle';
4416 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4417
4418
4419 procedure SetControlPopupMenuRef( control: ControlRef; popupMenu: MenuRef ); external name '_SetControlPopupMenuHandle';
4420 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4421 {
4422 * SetControlPopupMenuID()
4423 *
4424 * Mac OS X threading:
4425 * Not thread safe
4426 *
4427 * Availability:
4428 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
4429 * CarbonLib: in CarbonLib 1.0 and later
4430 * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
4431 }
4432 procedure SetControlPopupMenuID( control: ControlRef; menuID: SInt16 ); external name '_SetControlPopupMenuID';
4433 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
4434
4435
4436 {$endc} {not TARGET_CPU_64}
4437
4438 {--------------------------------------------------------------------------------------}
4439 { � DEPRECATED }
4440 { All functions below this point are either deprecated (they continue to function }
4441 { but are not the most modern nor most efficient solution to a problem), or they are }
4442 { completely unavailable on Mac OS X. }
4443 {--------------------------------------------------------------------------------------}
4444
4445 {$ifc not TARGET_CPU_64}
4446 {
4447 * IdleControls() *** DEPRECATED ***
4448 *
4449 * Deprecated:
4450 * Applications should remove calls to IdleControls. Custom control
4451 * definitions should use Carbon event loop timers instead.
4452 *
4453 * Summary:
4454 * Gives idle time to any controls that want the kControlMsgIdle
4455 * message.
4456 *
4457 * Discussion:
4458 * IdleControls gives idle processing time for controls that set the
4459 * kControlWantsIdle feature bit. IdleControls is deprecated on Mac
4460 * OS X. System-supplied controls do not respond to IdleControls
4461 * being called on Mac OS X.
4462 *
4463 * Custom controls should use repeating Carbon event loop timers to
4464 * perform tasks, such as animation, that previously used time given
4465 * with IdleControls(). See InstallEventLoopTimer() in
4466 * CarbonEventsCore.h for more information.
4467 *
4468 * Mac OS X threading:
4469 * Not thread safe
4470 *
4471 * Parameters:
4472 *
4473 * inWindow:
4474 * The WindowRef whose controls are offered idle time.
4475 *
4476 * Availability:
4477 * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.4
4478 * CarbonLib: in CarbonLib 1.0 and later
4479 * Non-Carbon CFM: in AppearanceLib 1.0 and later
4480 }
4481 procedure IdleControls( inWindow: WindowRef ); external name '_IdleControls';
4482 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
4483
4484
4485 {$endc} {not TARGET_CPU_64}
4486
4487
4488 {$endc} {not TARGET_OS_MAC}
4489
4490 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
4491
4492 end.
4493 {$endc} {not MACOSALLINCLUDE}
4494