HIButtonViews.pas 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090
  1. {
  2. File: HIToolbox/HIButtonViews.h
  3. Contains: Definitions of the button views provided by HIToolbox.
  4. Version: HIToolbox-624~3
  5. Copyright: © 2006-2008 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://bugs.freepascal.org
  9. }
  10. { Initial Pascal Translation: Jonas Maebe, <[email protected]>, October 2009 }
  11. { Pascal Translation Updated: Gorazd Krosl, <[email protected]>, October 2009 }
  12. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  13. {
  14. Modified for use with Free Pascal
  15. Version 308
  16. Please report any bugs to <[email protected]>
  17. }
  18. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  19. {$mode macpas}
  20. {$modeswitch cblocks}
  21. {$packenum 1}
  22. {$macro on}
  23. {$inline on}
  24. {$calling mwpascal}
  25. {$IFNDEF FPC_DOTTEDUNITS}
  26. unit HIButtonViews;
  27. {$ENDIF FPC_DOTTEDUNITS}
  28. interface
  29. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  30. {$setc GAP_INTERFACES_VERSION := $0308}
  31. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  32. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  33. {$endc}
  34. {$ifc defined CPUPOWERPC and defined CPUI386}
  35. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  36. {$endc}
  37. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  38. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  39. {$endc}
  40. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  41. {$setc __ppc__ := 1}
  42. {$elsec}
  43. {$setc __ppc__ := 0}
  44. {$endc}
  45. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  46. {$setc __ppc64__ := 1}
  47. {$elsec}
  48. {$setc __ppc64__ := 0}
  49. {$endc}
  50. {$ifc not defined __i386__ and defined CPUI386}
  51. {$setc __i386__ := 1}
  52. {$elsec}
  53. {$setc __i386__ := 0}
  54. {$endc}
  55. {$ifc not defined __x86_64__ and defined CPUX86_64}
  56. {$setc __x86_64__ := 1}
  57. {$elsec}
  58. {$setc __x86_64__ := 0}
  59. {$endc}
  60. {$ifc not defined __arm__ and defined CPUARM}
  61. {$setc __arm__ := 1}
  62. {$elsec}
  63. {$setc __arm__ := 0}
  64. {$endc}
  65. {$ifc not defined __arm64__ and defined CPUAARCH64}
  66. {$setc __arm64__ := 1}
  67. {$elsec}
  68. {$setc __arm64__ := 0}
  69. {$endc}
  70. {$ifc defined cpu64}
  71. {$setc __LP64__ := 1}
  72. {$elsec}
  73. {$setc __LP64__ := 0}
  74. {$endc}
  75. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  76. {$error Conflicting definitions for __ppc__ and __i386__}
  77. {$endc}
  78. {$ifc defined __ppc__ and __ppc__}
  79. {$setc TARGET_CPU_PPC := TRUE}
  80. {$setc TARGET_CPU_PPC64 := FALSE}
  81. {$setc TARGET_CPU_X86 := FALSE}
  82. {$setc TARGET_CPU_X86_64 := FALSE}
  83. {$setc TARGET_CPU_ARM := FALSE}
  84. {$setc TARGET_CPU_ARM64 := FALSE}
  85. {$setc TARGET_OS_MAC := TRUE}
  86. {$setc TARGET_OS_IPHONE := FALSE}
  87. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  88. {$setc TARGET_OS_EMBEDDED := FALSE}
  89. {$elifc defined __ppc64__ and __ppc64__}
  90. {$setc TARGET_CPU_PPC := FALSE}
  91. {$setc TARGET_CPU_PPC64 := TRUE}
  92. {$setc TARGET_CPU_X86 := FALSE}
  93. {$setc TARGET_CPU_X86_64 := FALSE}
  94. {$setc TARGET_CPU_ARM := FALSE}
  95. {$setc TARGET_CPU_ARM64 := FALSE}
  96. {$setc TARGET_OS_MAC := TRUE}
  97. {$setc TARGET_OS_IPHONE := FALSE}
  98. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  99. {$setc TARGET_OS_EMBEDDED := FALSE}
  100. {$elifc defined __i386__ and __i386__}
  101. {$setc TARGET_CPU_PPC := FALSE}
  102. {$setc TARGET_CPU_PPC64 := FALSE}
  103. {$setc TARGET_CPU_X86 := TRUE}
  104. {$setc TARGET_CPU_X86_64 := FALSE}
  105. {$setc TARGET_CPU_ARM := FALSE}
  106. {$setc TARGET_CPU_ARM64 := FALSE}
  107. {$ifc defined iphonesim}
  108. {$setc TARGET_OS_MAC := FALSE}
  109. {$setc TARGET_OS_IPHONE := TRUE}
  110. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  111. {$elsec}
  112. {$setc TARGET_OS_MAC := TRUE}
  113. {$setc TARGET_OS_IPHONE := FALSE}
  114. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  115. {$endc}
  116. {$setc TARGET_OS_EMBEDDED := FALSE}
  117. {$elifc defined __x86_64__ and __x86_64__}
  118. {$setc TARGET_CPU_PPC := FALSE}
  119. {$setc TARGET_CPU_PPC64 := FALSE}
  120. {$setc TARGET_CPU_X86 := FALSE}
  121. {$setc TARGET_CPU_X86_64 := TRUE}
  122. {$setc TARGET_CPU_ARM := FALSE}
  123. {$setc TARGET_CPU_ARM64 := FALSE}
  124. {$ifc defined iphonesim}
  125. {$setc TARGET_OS_MAC := FALSE}
  126. {$setc TARGET_OS_IPHONE := TRUE}
  127. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  128. {$elsec}
  129. {$setc TARGET_OS_MAC := TRUE}
  130. {$setc TARGET_OS_IPHONE := FALSE}
  131. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  132. {$endc}
  133. {$setc TARGET_OS_EMBEDDED := FALSE}
  134. {$elifc defined __arm__ and __arm__}
  135. {$setc TARGET_CPU_PPC := FALSE}
  136. {$setc TARGET_CPU_PPC64 := FALSE}
  137. {$setc TARGET_CPU_X86 := FALSE}
  138. {$setc TARGET_CPU_X86_64 := FALSE}
  139. {$setc TARGET_CPU_ARM := TRUE}
  140. {$setc TARGET_CPU_ARM64 := FALSE}
  141. {$setc TARGET_OS_MAC := FALSE}
  142. {$setc TARGET_OS_IPHONE := TRUE}
  143. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  144. {$setc TARGET_OS_EMBEDDED := TRUE}
  145. {$elifc defined __arm64__ and __arm64__}
  146. {$setc TARGET_CPU_PPC := FALSE}
  147. {$setc TARGET_CPU_PPC64 := FALSE}
  148. {$setc TARGET_CPU_X86 := FALSE}
  149. {$setc TARGET_CPU_X86_64 := FALSE}
  150. {$setc TARGET_CPU_ARM := FALSE}
  151. {$setc TARGET_CPU_ARM64 := TRUE}
  152. {$ifc defined ios}
  153. {$setc TARGET_OS_MAC := FALSE}
  154. {$setc TARGET_OS_IPHONE := TRUE}
  155. {$setc TARGET_OS_EMBEDDED := TRUE}
  156. {$elsec}
  157. {$setc TARGET_OS_MAC := TRUE}
  158. {$setc TARGET_OS_IPHONE := FALSE}
  159. {$setc TARGET_OS_EMBEDDED := FALSE}
  160. {$endc}
  161. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  162. {$elsec}
  163. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  164. {$endc}
  165. {$ifc defined __LP64__ and __LP64__ }
  166. {$setc TARGET_CPU_64 := TRUE}
  167. {$elsec}
  168. {$setc TARGET_CPU_64 := FALSE}
  169. {$endc}
  170. {$ifc defined FPC_BIG_ENDIAN}
  171. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  172. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  173. {$elifc defined FPC_LITTLE_ENDIAN}
  174. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  175. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  176. {$elsec}
  177. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  178. {$endc}
  179. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  180. {$setc CALL_NOT_IN_CARBON := FALSE}
  181. {$setc OLDROUTINENAMES := FALSE}
  182. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  183. {$setc OPAQUE_UPP_TYPES := TRUE}
  184. {$setc OTCARBONAPPLICATION := TRUE}
  185. {$setc OTKERNEL := FALSE}
  186. {$setc PM_USE_SESSION_APIS := TRUE}
  187. {$setc TARGET_API_MAC_CARBON := TRUE}
  188. {$setc TARGET_API_MAC_OS8 := FALSE}
  189. {$setc TARGET_API_MAC_OSX := TRUE}
  190. {$setc TARGET_CARBON := TRUE}
  191. {$setc TARGET_CPU_68K := FALSE}
  192. {$setc TARGET_CPU_MIPS := FALSE}
  193. {$setc TARGET_CPU_SPARC := FALSE}
  194. {$setc TARGET_OS_UNIX := FALSE}
  195. {$setc TARGET_OS_WIN32 := FALSE}
  196. {$setc TARGET_RT_MAC_68881 := FALSE}
  197. {$setc TARGET_RT_MAC_CFM := FALSE}
  198. {$setc TARGET_RT_MAC_MACHO := TRUE}
  199. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  200. {$setc TYPE_BOOL := FALSE}
  201. {$setc TYPE_EXTENDED := FALSE}
  202. {$setc TYPE_LONGLONG := TRUE}
  203. {$IFDEF FPC_DOTTEDUNITS}
  204. uses MacOsApi.MacTypes,MacOsApi.Appearance,MacOsApi.CarbonEvents,MacOsApi.Controls,MacOsApi.IconsCore,MacOsApi.Icons,MacOsApi.Menus,MacOsApi.QuickdrawTypes,MacOsApi.TextEdit,MacOsApi.CFBase,MacOsApi.HIObject;
  205. {$ELSE FPC_DOTTEDUNITS}
  206. uses MacTypes,Appearance,CarbonEvents,Controls,IconsCore,Icons,Menus,QuickdrawTypes,TextEdit,CFBase,HIObject;
  207. {$ENDIF FPC_DOTTEDUNITS}
  208. {$endc} {not MACOSALLINCLUDE}
  209. {$ifc TARGET_OS_MAC}
  210. {$ALIGN POWER}
  211. {
  212. * HIButtonViews.h
  213. *
  214. * Discussion:
  215. * API definitions for the simple button views provided by
  216. * HIToolbox: pushbutton, checkbox, radio button and radio group,
  217. * bevel button, and round button.
  218. }
  219. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  220. { PUSH BUTTON (CDEF 23) }
  221. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  222. { Two new variants of the standard pushbutton have been added to the standard control }
  223. { suite that draw a color icon next to the control title. One variant draws the icon }
  224. { on the left side, the other draws it on the right side (when the system justifica- }
  225. { tion is right to left, these are reversed). }
  226. { When either of the icon pushbuttons are created, the contrlMax field of the control }
  227. { record is used to determine the ID of the 'cicn' resource drawn in the pushbutton. }
  228. { In addition, a push button can now be told to draw with a default outline using the }
  229. { SetControlData routine with the kControlPushButtonDefaultTag below. }
  230. { A push button may also be marked using the kControlPushButtonCancelTag. This has }
  231. { no visible representation, but does cause the button to play the CancelButton theme }
  232. { sound instead of the regular pushbutton theme sound when pressed. }
  233. { Push Button proc IDs }
  234. const
  235. kControlPushButtonProc = 368;
  236. kControlPushButLeftIconProc = 374; { Standard pushbutton with left-side icon}
  237. kControlPushButRightIconProc = 375; { Standard pushbutton with right-side icon}
  238. { Push Button Icon Alignments }
  239. type
  240. ControlPushButtonIconAlignment = UInt16;
  241. const
  242. kControlPushButtonIconOnLeft = 6;
  243. kControlPushButtonIconOnRight = 7;
  244. { Control Kind Tag }
  245. const
  246. kControlKindPushButton = FourCharCode('push');
  247. kControlKindPushIconButton = FourCharCode('picn');
  248. { The HIObject class ID for the HIPushButton class. }
  249. {$ifc USE_CFSTR_CONSTANT_MACROS}
  250. {$definec kHIPushButtonClassID CFSTRP('com.apple.HIPushButton')}
  251. {$endc}
  252. { Creation APIs: Carbon Only }
  253. {$ifc not TARGET_CPU_64}
  254. {
  255. * CreatePushButtonControl()
  256. *
  257. * Summary:
  258. * Creates a push button control.
  259. *
  260. * Mac OS X threading:
  261. * Not thread safe
  262. *
  263. * Parameters:
  264. *
  265. * window:
  266. * The window that should contain the control. May be NULL on 10.3
  267. * and later.
  268. *
  269. * boundsRect:
  270. * The bounds of the control, in local coordinates of the window.
  271. *
  272. * title:
  273. * The control title. May be NULL.
  274. *
  275. * outControl:
  276. * On exit, contains the new control.
  277. *
  278. * Availability:
  279. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  280. * CarbonLib: in CarbonLib 1.1 and later
  281. * Non-Carbon CFM: not available
  282. }
  283. function CreatePushButtonControl( window: WindowRef; const (*var*) boundsRect: Rect; title: CFStringRef { can be NULL }; var outControl: ControlRef ): OSStatus; external name '_CreatePushButtonControl';
  284. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  285. {
  286. * CreatePushButtonWithIconControl()
  287. *
  288. * Summary:
  289. * Creates a push button control containing an icon or other
  290. * graphical content.
  291. *
  292. * Mac OS X threading:
  293. * Not thread safe
  294. *
  295. * Parameters:
  296. *
  297. * window:
  298. * The window that should contain the control. May be NULL on 10.3
  299. * and later.
  300. *
  301. * boundsRect:
  302. * The bounds of the control, in local coordinates of the window.
  303. *
  304. * title:
  305. * The control title. May be NULL.
  306. *
  307. * icon:
  308. * The control graphic content.
  309. *
  310. * iconAlignment:
  311. * The alignment of the control graphic content.
  312. *
  313. * outControl:
  314. * On exit, contains the new control.
  315. *
  316. * Availability:
  317. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  318. * CarbonLib: in CarbonLib 1.1 and later
  319. * Non-Carbon CFM: not available
  320. }
  321. function CreatePushButtonWithIconControl( window: WindowRef; const (*var*) boundsRect: Rect; title: CFStringRef { can be NULL }; var icon: ControlButtonContentInfo; iconAlignment: ControlPushButtonIconAlignment; var outControl: ControlRef ): OSStatus; external name '_CreatePushButtonWithIconControl';
  322. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  323. {$endc} {not TARGET_CPU_64}
  324. {
  325. * Summary:
  326. * Tagged data supported by standard buttons
  327. }
  328. const
  329. {
  330. * Data is a Boolean indicating if a push button is a default button.
  331. * If so, the button will draw with the appropriate appearance.
  332. * Available in Mac OS 8.5 and later.
  333. }
  334. kControlPushButtonDefaultTag = FourCharCode('dflt');
  335. {
  336. * Data is a Boolean indicating if a push button is a cancel button.
  337. * If so, the button will draw with an appropriate appearance.
  338. * Available in Mac OS 8.5 and later.
  339. }
  340. kControlPushButtonCancelTag = FourCharCode('cncl');
  341. {
  342. * Data is a ControlButtonContentInfo or HIViewContentInfo structure.
  343. * May be used to set or retrieve a button's image content. Available
  344. * in Mac OS X 10.4 and later. In Mac OS X 10.4, the push button
  345. * supports the kControlContentCIconRes and kControlContentCGImageRef
  346. * content types. In Mac OS X 10.5 and later, the push button also
  347. * supports IconRef content.
  348. }
  349. kControlPushButtonContentTag = kControlContentTag;
  350. {
  351. * Data is a ControlPushButtonIconAlignment indicating the desired
  352. * alignment for the button's image content. Applies to all types of
  353. * image content that may be associated with the push button, not
  354. * just icons. Available in Mac OS X 10.4 and later.
  355. }
  356. kControlPushButtonIconAlignmentTag = FourCharCode('cpia');
  357. {
  358. * Data is a Boolean indicating if a push button should animate. Will
  359. * be True by default even if the button is not a default button and
  360. * is not currently pulsing. Available in Mac OS X 10.5 and later.
  361. }
  362. kControlPushButtonAnimatingTag = FourCharCode('anim');
  363. {
  364. * Summary:
  365. * Tagged data supported by push buttons
  366. *
  367. * Discussion:
  368. * This new tag is available on Mac OS X 10.4 and later. The
  369. * constant is not in the Mac OS X 10.4 and Mac OS X 10.5 headers,
  370. * but the constant value is functional on both releases.
  371. }
  372. const
  373. {
  374. * Data is a Boolean indicating if a push button is a textured push
  375. * button, to be drawn on a textured window. Textured was previously
  376. * referred to as "metal". This attribute is only to be set on push
  377. * buttons being used in composited windows.
  378. }
  379. kControlPushButtonIsTexturedTag = FourCharCode('metl');
  380. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  381. { CHECKBOX (CDEF 23) }
  382. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  383. { The standard checkbox view supports a "mixed" value that indicates that the }
  384. { current setting contains a mixed set of on and off values. The control value used }
  385. { to display this indication is defined below: }
  386. { kControlCheckBoxMixedValue = 2 }
  387. { Check Box proc ID }
  388. const
  389. kControlCheckBoxProc = 369;
  390. { Variants with Appearance 1.1 or later }
  391. const
  392. kControlCheckBoxAutoToggleProc = 371;
  393. { Control Kind Tag }
  394. const
  395. kControlKindCheckBox = FourCharCode('cbox');
  396. { The HIObject class ID for the HICheckBox class. }
  397. {$ifc USE_CFSTR_CONSTANT_MACROS}
  398. {$definec kHICheckBoxClassID CFSTRP('com.apple.HICheckBox')}
  399. {$endc}
  400. {$ifc not TARGET_CPU_64}
  401. {
  402. * CreateCheckBoxControl()
  403. *
  404. * Summary:
  405. * Creates a checkbox control.
  406. *
  407. * Mac OS X threading:
  408. * Not thread safe
  409. *
  410. * Parameters:
  411. *
  412. * window:
  413. * The window that should contain the control. May be NULL on 10.3
  414. * and later.
  415. *
  416. * boundsRect:
  417. * The bounds of the control, in local coordinates of the window.
  418. *
  419. * title:
  420. * The control title. May be NULL.
  421. *
  422. * initialValue:
  423. * The initial value of the control. Should be zero (off), one
  424. * (on), or two (mixed). The control is automatically given a
  425. * minimum value of zero and a maximum value of two.
  426. *
  427. * autoToggle:
  428. * Whether this control should have auto-toggle behavior. If true,
  429. * the control will automatically toggle between on and off states
  430. * when clicked.
  431. *
  432. * outControl:
  433. * On exit, contains the new control.
  434. *
  435. * Availability:
  436. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  437. * CarbonLib: in CarbonLib 1.1 and later
  438. * Non-Carbon CFM: not available
  439. }
  440. function CreateCheckBoxControl( window: WindowRef; const (*var*) boundsRect: Rect; title: CFStringRef { can be NULL }; initialValue: SInt32; autoToggle: Boolean; var outControl: ControlRef ): OSStatus; external name '_CreateCheckBoxControl';
  441. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  442. { Check Box Values }
  443. {$endc} {not TARGET_CPU_64}
  444. const
  445. kControlCheckBoxUncheckedValue = 0;
  446. kControlCheckBoxCheckedValue = 1;
  447. kControlCheckBoxMixedValue = 2;
  448. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  449. { RADIO BUTTON (CDEF 23) }
  450. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  451. { The standard radio button control supports a "mixed" value that indicates that the }
  452. { current setting contains a mixed set of on and off values. The control value used }
  453. { to display this indication is defined below: }
  454. { kControlRadioButtonMixedValue = 2 }
  455. { Radio Button proc IDs }
  456. const
  457. kControlRadioButtonProc = 370;
  458. { Variants with Appearance 1.1 or later }
  459. const
  460. kControlRadioButtonAutoToggleProc = 372;
  461. { Radio Button Values }
  462. const
  463. kControlRadioButtonUncheckedValue = 0;
  464. kControlRadioButtonCheckedValue = 1;
  465. kControlRadioButtonMixedValue = 2;
  466. { Control Kind Tag }
  467. const
  468. kControlKindRadioButton = FourCharCode('rdio');
  469. { The HIObject class ID for the HIRadioButton class. }
  470. {$ifc USE_CFSTR_CONSTANT_MACROS}
  471. {$definec kHIRadioButtonClassID CFSTRP('com.apple.HIRadioButton')}
  472. {$endc}
  473. {$ifc not TARGET_CPU_64}
  474. {
  475. * CreateRadioButtonControl()
  476. *
  477. * Summary:
  478. * Creates a radio button control.
  479. *
  480. * Mac OS X threading:
  481. * Not thread safe
  482. *
  483. * Parameters:
  484. *
  485. * window:
  486. * The window that should contain the control. May be NULL on 10.3
  487. * and later.
  488. *
  489. * boundsRect:
  490. * The bounds of the control, in local coordinates of the window.
  491. *
  492. * title:
  493. * The control title. May be NULL.
  494. *
  495. * initialValue:
  496. * The initial value of the control. Should be zero (off), one
  497. * (on), or two (mixed). The control is automatically given a
  498. * minimum value of zero and a maximum value of two.
  499. *
  500. * autoToggle:
  501. * Whether this control should have auto-toggle behavior. If true,
  502. * the control will automatically toggle between on and off states
  503. * when clicked. This parameter should be false if the control
  504. * will be embedded into a radio group control; in that case, the
  505. * radio group will handle setting the correct control value in
  506. * response to a click.
  507. *
  508. * outControl:
  509. * On exit, contains the new control.
  510. *
  511. * Availability:
  512. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  513. * CarbonLib: in CarbonLib 1.1 and later
  514. * Non-Carbon CFM: not available
  515. }
  516. function CreateRadioButtonControl( window: WindowRef; const (*var*) boundsRect: Rect; title: CFStringRef { can be NULL }; initialValue: SInt32; autoToggle: Boolean; var outControl: ControlRef ): OSStatus; external name '_CreateRadioButtonControl';
  517. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  518. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  519. { RADIO GROUP (CDEF 26) }
  520. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  521. { This control implements a radio group. It is an embedding control and can therefore }
  522. { only be used when a control hierarchy is established for its owning window. You }
  523. { should only embed controls that have radio button behavior - currently radio buttons}
  524. { and bevel buttons. Specifically, you can embed controls that return the feature bit }
  525. { kControlHasRadioBehavior. As controls are embedded into it, the group sets up its }
  526. { value, min, and max to represent the number of embedded items. }
  527. { The current value of the control is the index of the sub-control that is the current}
  528. { 'on' radio button. To get the current radio button control handle, you can use the }
  529. { control manager call GetIndexedSubControl, passing in the value of the radio group. }
  530. { Note that when creating radio buttons for use in a radio group control, you should }
  531. { not use the autoToggle version of the radio button. The radio group control will }
  532. { handling toggling the radio button values itself; auto-toggle radio buttons do not }
  533. { work properly in a radio group control on Mac OS 9. }
  534. { NOTE: This control is only available with Appearance 1.0.1. }
  535. { Radio Group Proc ID }
  536. {$endc} {not TARGET_CPU_64}
  537. const
  538. kControlRadioGroupProc = 416;
  539. { Control Kind Tag }
  540. const
  541. kControlKindRadioGroup = FourCharCode('rgrp');
  542. { The HIObject class ID for the HIRadioGroup class. }
  543. {$ifc USE_CFSTR_CONSTANT_MACROS}
  544. {$definec kHIRadioGroupClassID CFSTRP('com.apple.HIRadioGroup')}
  545. {$endc}
  546. { Creation API: Carbon Only }
  547. {$ifc not TARGET_CPU_64}
  548. {
  549. * CreateRadioGroupControl()
  550. *
  551. * Mac OS X threading:
  552. * Not thread safe
  553. *
  554. * Availability:
  555. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  556. * CarbonLib: in CarbonLib 1.1 and later
  557. * Non-Carbon CFM: not available
  558. }
  559. function CreateRadioGroupControl( window: WindowRef; const (*var*) boundsRect: Rect; var outControl: ControlRef ): OSStatus; external name '_CreateRadioGroupControl';
  560. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  561. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
  562. BEVEL BUTTON INTERFACE (CDEF 2)
  563. Bevel buttons allow you to control the content type (pict/icon/etc.), the behavior
  564. (pushbutton/toggle/sticky), and the bevel size. You also have the option of
  565. attaching a menu to it. When a menu is present, you can specify which way the
  566. popup arrow is facing (down or right).
  567. This is all made possible by overloading the Min, Max, and Value parameters for the
  568. control, as well as adjusting the variant. Here's the breakdown of what goes where:
  569. Parameter What Goes Here
  570. Min Hi Byte = Behavior, Lo Byte = content type.
  571. Max ResID for resource-based content types.
  572. Value MenuID to attach, 0 = no menu, please.
  573. The variant is broken down into two halves. The low 2 bits control the bevel type.
  574. Bit 2 controls the popup arrow direction (if a menu is present) and bit 3 controls
  575. whether or not to use the control's owning window's font.
  576. Constants for all you need to put this together are below. The values for behaviors
  577. are set up so that you can simply add them to the content type for use in the Min
  578. parameter of NewControl.
  579. An example call:
  580. control = NewControl( window, &bounds, "\p", true, 0, kControlContentIconSuiteRes +
  581. kBehaviorToggles, myIconSuiteID, bevelButtonSmallBevelProc,
  582. 0L );
  583. Attaching a menu:
  584. control = NewControl( window, &bounds, "\p", true, kMyMenuID,
  585. kControlContentIconSuiteRes, myIconSuiteID, bevelButtonSmallBevelProc +
  586. kBevelButtonMenuOnRight, 0L );
  587. This will attach menu ID kMyMenuID to the button, with the popup arrow facing right.
  588. This also puts the menu up to the right of the button. You can also specify that a
  589. menu can have multiple items checked at once by adding kBehaviorMultiValueMenus
  590. into the Min parameter. If you do use multivalue menus, the GetBevelButtonMenuValue
  591. helper function will return the last item chosen from the menu, whether or not it
  592. was checked.
  593. NOTE: Bevel buttons with menus actually have *two* values. The value of the
  594. button (on/off), and the value of the menu. The menu value can be gotten
  595. with the GetBevelButtonMenuValue helper function.
  596. Handle-based Content
  597. You can create your control and then set the content to an existing handle to an
  598. icon suite, etc. using the macros below. Please keep in mind that resource-based
  599. content is owned by the control, handle-based content is owned by you. The CDEF will
  600. not try to dispose of handle-based content. If you are changing the content type of
  601. the button on the fly, you must make sure that if you are replacing a handle-
  602. based content with a resource-based content to properly dispose of the handle,
  603. else a memory leak will ensue.
  604. Textual Content
  605. Please note that if a bevel button gets its textual content from the title
  606. of the control. To alter the textual content of a bevel button, use the
  607. SetControlTitle[WithCFString] API.
  608. Implicit Menu Arrow Sizing
  609. Bevel buttons can now have implicit popup menu arrow sizes on Mac OS X 10.5 and later. Use
  610. SetControlData(..., kControlSizeTag, ...), where the default control size is
  611. kControlSizeAuto. kControlSizeAuto has the bevel button render its popup menu arrow
  612. at a size that is dependent on the size of the bevel button -- this is the behavior
  613. on Tiger and earlier. kControlSizeNormal has it render the normal size arrow and
  614. kControlSizeSmall has it render the arrow small. All other sizes are invalid.
  615. }
  616. { Bevel Button Proc IDs }
  617. {$endc} {not TARGET_CPU_64}
  618. const
  619. kControlBevelButtonSmallBevelProc = 32;
  620. kControlBevelButtonNormalBevelProc = 33;
  621. kControlBevelButtonLargeBevelProc = 34;
  622. { Add these variant codes to kBevelButtonSmallBevelProc to change the type of button }
  623. const
  624. kControlBevelButtonSmallBevelVariant = 0;
  625. kControlBevelButtonNormalBevelVariant = 1 shl 0;
  626. kControlBevelButtonLargeBevelVariant = 1 shl 1;
  627. kControlBevelButtonMenuOnRightVariant = 1 shl 2;
  628. { Bevel Thicknesses }
  629. type
  630. ControlBevelThickness = UInt16;
  631. const
  632. kControlBevelButtonSmallBevel = 0;
  633. kControlBevelButtonNormalBevel = 1;
  634. kControlBevelButtonLargeBevel = 2;
  635. { Behaviors of bevel buttons. These are set up so you can add }
  636. { them together with the content types for use in the Min }
  637. { parameter of NewControl. Note that the behavior of a bevel }
  638. { button cannot be changed after the button is created. }
  639. const
  640. kControlBehaviorPushbutton = 0;
  641. kControlBehaviorToggles = $0100;
  642. kControlBehaviorSticky = $0200;
  643. kControlBehaviorOffsetContents = $8000;
  644. kControlBehaviorSingleValueMenu = 0;
  645. kControlBehaviorMultiValueMenu = $4000; { only makes sense when a menu is attached.}
  646. { Behaviors for 1.0.1 or later }
  647. const
  648. kControlBehaviorCommandMenu = $2000; { menu holds commands, not choices. Overrides multi-value bit.}
  649. type
  650. ControlBevelButtonBehavior = UInt16;
  651. ControlBevelButtonMenuBehavior = UInt16;
  652. { Bevel Button Menu Placements }
  653. type
  654. ControlBevelButtonMenuPlacement = UInt16;
  655. const
  656. kControlBevelButtonMenuOnBottom = 0;
  657. kControlBevelButtonMenuOnRight = 1 shl 2;
  658. { Control Kind Tag }
  659. const
  660. kControlKindBevelButton = FourCharCode('bevl');
  661. { The HIObject class ID for the HIBevelButton class. }
  662. {$ifc USE_CFSTR_CONSTANT_MACROS}
  663. {$definec kHIBevelButtonClassID CFSTRP('com.apple.HIBevelButton')}
  664. {$endc}
  665. { Creation API: Carbon Only }
  666. {$ifc not TARGET_CPU_64}
  667. {
  668. * CreateBevelButtonControl()
  669. *
  670. * Mac OS X threading:
  671. * Not thread safe
  672. *
  673. * Availability:
  674. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  675. * CarbonLib: in CarbonLib 1.1 and later
  676. * Non-Carbon CFM: not available
  677. }
  678. function CreateBevelButtonControl( window: WindowRef; const (*var*) boundsRect: Rect; title: CFStringRef; thickness: ControlBevelThickness; behavior: ControlBevelButtonBehavior; info: ControlButtonContentInfoPtr; menuID_: MenuID; menuBehavior: ControlBevelButtonMenuBehavior; menuPlacement: ControlBevelButtonMenuPlacement; var outControl: ControlRef ): OSStatus; external name '_CreateBevelButtonControl';
  679. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  680. { Graphic Alignments }
  681. {$endc} {not TARGET_CPU_64}
  682. type
  683. ControlButtonGraphicAlignment = SInt16;
  684. const
  685. kControlBevelButtonAlignSysDirection = -1; { only left or right}
  686. kControlBevelButtonAlignCenter = 0;
  687. kControlBevelButtonAlignLeft = 1;
  688. kControlBevelButtonAlignRight = 2;
  689. kControlBevelButtonAlignTop = 3;
  690. kControlBevelButtonAlignBottom = 4;
  691. kControlBevelButtonAlignTopLeft = 5;
  692. kControlBevelButtonAlignBottomLeft = 6;
  693. kControlBevelButtonAlignTopRight = 7;
  694. kControlBevelButtonAlignBottomRight = 8;
  695. { Text Alignments }
  696. type
  697. ControlButtonTextAlignment = SInt16;
  698. const
  699. kControlBevelButtonAlignTextSysDirection = teFlushDefault;
  700. kControlBevelButtonAlignTextCenter = teCenter;
  701. kControlBevelButtonAlignTextFlushRight = teFlushRight;
  702. kControlBevelButtonAlignTextFlushLeft = teFlushLeft;
  703. { Text Placements }
  704. type
  705. ControlButtonTextPlacement = SInt16;
  706. const
  707. kControlBevelButtonPlaceSysDirection = -1; { if graphic on right, then on left}
  708. kControlBevelButtonPlaceNormally = 0;
  709. kControlBevelButtonPlaceToRightOfGraphic = 1;
  710. kControlBevelButtonPlaceToLeftOfGraphic = 2;
  711. kControlBevelButtonPlaceBelowGraphic = 3;
  712. kControlBevelButtonPlaceAboveGraphic = 4;
  713. { Data tags supported by the bevel button controls }
  714. const
  715. kControlBevelButtonContentTag = kControlContentTag; { ControlImageContentInfo}
  716. kControlBevelButtonTransformTag = FourCharCode('tran'); { IconTransformType}
  717. kControlBevelButtonTextAlignTag = FourCharCode('tali'); { ButtonTextAlignment}
  718. kControlBevelButtonTextOffsetTag = FourCharCode('toff'); { SInt16}
  719. kControlBevelButtonGraphicAlignTag = FourCharCode('gali'); { ButtonGraphicAlignment}
  720. kControlBevelButtonGraphicOffsetTag = FourCharCode('goff'); { Point}
  721. kControlBevelButtonTextPlaceTag = FourCharCode('tplc'); { ButtonTextPlacement}
  722. kControlBevelButtonMenuValueTag = FourCharCode('mval'); { SInt16}
  723. kControlBevelButtonMenuHandleTag = FourCharCode('mhnd'); { MenuRef}
  724. kControlBevelButtonMenuRefTag = FourCharCode('mhnd'); { MenuRef}
  725. kControlBevelButtonCenterPopupGlyphTag = FourCharCode('pglc'); { Boolean: true = center, false = bottom right}
  726. { These are tags in 1.0.1 or later }
  727. const
  728. kControlBevelButtonLastMenuTag = FourCharCode('lmnu'); { SInt16: menuID of last menu item selected from}
  729. kControlBevelButtonMenuDelayTag = FourCharCode('mdly'); { SInt32: ticks to delay before menu appears}
  730. { tags available with Appearance 1.1 or later }
  731. const
  732. { Boolean: True = if an icon of the ideal size for}
  733. { the button isn't available, scale a larger or}
  734. { smaller icon to the ideal size. False = don't}
  735. { scale; draw a smaller icon or clip a larger icon.}
  736. { Default is false. Only applies to IconSuites and}
  737. kControlBevelButtonScaleIconTag = FourCharCode('scal'); { IconRefs.}
  738. { tags available in Mac OS X and later }
  739. const
  740. kControlBevelButtonOwnedMenuRefTag = FourCharCode('omrf'); { MenuRef (control will dispose)}
  741. kControlBevelButtonKindTag = FourCharCode('bebk'); { ThemeButtonKind ( kTheme[Small,Medium,Large,Rounded]BevelButton )}
  742. {
  743. * Summary:
  744. * Tags available with Mac OS X 10.3 or later
  745. }
  746. const
  747. {
  748. * Passed data is an Boolean. Gets or sets whether or not the
  749. * associated menu is a multi-value menu or not. True means that the
  750. * menu can have multiple selections.
  751. }
  752. kControlBevelButtonIsMultiValueMenuTag = FourCharCode('mult');
  753. { Helper routines are available only thru the shared library/glue. }
  754. {$ifc not TARGET_CPU_64}
  755. {
  756. * GetBevelButtonMenuValue()
  757. *
  758. * Mac OS X threading:
  759. * Not thread safe
  760. *
  761. * Availability:
  762. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  763. * CarbonLib: in CarbonLib 1.0 and later
  764. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  765. }
  766. function GetBevelButtonMenuValue( inButton: ControlRef; var outValue: MenuItemIndex ): OSErr; external name '_GetBevelButtonMenuValue';
  767. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  768. {
  769. * SetBevelButtonMenuValue()
  770. *
  771. * Mac OS X threading:
  772. * Not thread safe
  773. *
  774. * Availability:
  775. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  776. * CarbonLib: in CarbonLib 1.0 and later
  777. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  778. }
  779. function SetBevelButtonMenuValue( inButton: ControlRef; inValue: MenuItemIndex ): OSErr; external name '_SetBevelButtonMenuValue';
  780. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  781. {
  782. * GetBevelButtonMenuHandle()
  783. *
  784. * Mac OS X threading:
  785. * Not thread safe
  786. *
  787. * Availability:
  788. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  789. * CarbonLib: in CarbonLib 1.0 and later
  790. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  791. }
  792. function GetBevelButtonMenuHandle( inButton: ControlRef; var outHandle: MenuHandle ): OSErr; external name '_GetBevelButtonMenuHandle';
  793. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  794. function GetBevelButtonMenuRef__NAME__GetBevelButtonMenuHandle( possibleWindow: WindowRef ): Boolean; external name '_GetBevelButtonMenuRef__NAME__GetBevelButtonMenuHandle';
  795. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  796. {
  797. * GetBevelButtonContentInfo()
  798. *
  799. * Mac OS X threading:
  800. * Not thread safe
  801. *
  802. * Availability:
  803. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  804. * CarbonLib: in CarbonLib 1.0 and later
  805. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  806. }
  807. function GetBevelButtonContentInfo( inButton: ControlRef; outContent: ControlButtonContentInfoPtr ): OSErr; external name '_GetBevelButtonContentInfo';
  808. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  809. {
  810. * SetBevelButtonContentInfo()
  811. *
  812. * Mac OS X threading:
  813. * Not thread safe
  814. *
  815. * Availability:
  816. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  817. * CarbonLib: in CarbonLib 1.0 and later
  818. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  819. }
  820. function SetBevelButtonContentInfo( inButton: ControlRef; inContent: ControlButtonContentInfoPtr ): OSErr; external name '_SetBevelButtonContentInfo';
  821. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  822. {
  823. * SetBevelButtonTransform()
  824. *
  825. * Mac OS X threading:
  826. * Not thread safe
  827. *
  828. * Availability:
  829. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  830. * CarbonLib: in CarbonLib 1.0 and later
  831. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  832. }
  833. function SetBevelButtonTransform( inButton: ControlRef; transform: IconTransformType ): OSErr; external name '_SetBevelButtonTransform';
  834. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  835. {
  836. * SetBevelButtonGraphicAlignment()
  837. *
  838. * Mac OS X threading:
  839. * Not thread safe
  840. *
  841. * Availability:
  842. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  843. * CarbonLib: in CarbonLib 1.0 and later
  844. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  845. }
  846. function SetBevelButtonGraphicAlignment( inButton: ControlRef; inAlign: ControlButtonGraphicAlignment; inHOffset: SInt16; inVOffset: SInt16 ): OSErr; external name '_SetBevelButtonGraphicAlignment';
  847. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  848. {
  849. * SetBevelButtonTextAlignment()
  850. *
  851. * Mac OS X threading:
  852. * Not thread safe
  853. *
  854. * Availability:
  855. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  856. * CarbonLib: in CarbonLib 1.0 and later
  857. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  858. }
  859. function SetBevelButtonTextAlignment( inButton: ControlRef; inAlign: ControlButtonTextAlignment; inHOffset: SInt16 ): OSErr; external name '_SetBevelButtonTextAlignment';
  860. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  861. {
  862. * SetBevelButtonTextPlacement()
  863. *
  864. * Mac OS X threading:
  865. * Not thread safe
  866. *
  867. * Availability:
  868. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  869. * CarbonLib: in CarbonLib 1.0 and later
  870. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  871. }
  872. function SetBevelButtonTextPlacement( inButton: ControlRef; inWhere: ControlButtonTextPlacement ): OSErr; external name '_SetBevelButtonTextPlacement';
  873. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  874. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  875. { ROUND BUTTON }
  876. { (CDEF 31) }
  877. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  878. {$endc} {not TARGET_CPU_64}
  879. {
  880. * ControlRoundButtonSize
  881. *
  882. * Discussion:
  883. * Button Sizes
  884. }
  885. type
  886. ControlRoundButtonSize = SInt16;
  887. const
  888. {
  889. * A 20 pixel diameter button.
  890. }
  891. kControlRoundButtonNormalSize = kControlSizeNormal;
  892. {
  893. * A 25 pixel diameter button.
  894. }
  895. kControlRoundButtonLargeSize = kControlSizeLarge;
  896. { Data tags supported by the round button controls }
  897. const
  898. kControlRoundButtonContentTag = kControlContentTag; { ControlImageContentInfo}
  899. kControlRoundButtonSizeTag = kControlSizeTag; { ControlRoundButtonSize}
  900. { Control Kind Tag }
  901. const
  902. kControlKindRoundButton = FourCharCode('rndb');
  903. { The HIObject class ID for the HIRoundButton class. }
  904. {$ifc USE_CFSTR_CONSTANT_MACROS}
  905. {$definec kHIRoundButtonClassID CFSTRP('com.apple.HIRoundButton')}
  906. {$endc}
  907. {$ifc not TARGET_CPU_64}
  908. {
  909. * CreateRoundButtonControl()
  910. *
  911. * Summary:
  912. * Creates a new instance of the Round Button Control.
  913. *
  914. * Discussion:
  915. * CreateRoundButtonControl is preferred over NewControl because it
  916. * allows you to specify the exact set of parameters required to
  917. * create the control without overloading parameter semantics.
  918. *
  919. * Mac OS X threading:
  920. * Not thread safe
  921. *
  922. * Parameters:
  923. *
  924. * inWindow:
  925. * The WindowRef in which to create the control. May be NULL in
  926. * 10.3 and later.
  927. *
  928. * inBoundsRect:
  929. * The bounding rectangle for the control. The height and width of
  930. * the control is fixed (specified by the ControlRoundButtonSize
  931. * parameter) and the control will be centered within the
  932. * rectangle you specify.
  933. *
  934. * inSize:
  935. * The button size; either kControlRoundButtonNormalSize or
  936. * kControlRoundButtonLargeSize.
  937. *
  938. * inContent:
  939. * Any optional content displayed in the button. Currently only
  940. * kControlContentIconRef is supported. May be NULL.
  941. *
  942. * outControl:
  943. * On successful exit, this will contain the new control.
  944. *
  945. * Availability:
  946. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  947. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  948. * Non-Carbon CFM: not available
  949. }
  950. function CreateRoundButtonControl( inWindow: WindowRef { can be NULL }; const (*var*) inBoundsRect: Rect; inSize: ControlRoundButtonSize; inContent: ControlButtonContentInfoPtr { can be NULL }; var outControl: ControlRef ): OSStatus; external name '_CreateRoundButtonControl';
  951. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  952. {$endc} {not TARGET_CPU_64}
  953. {$ifc OLDROUTINENAMES}
  954. const
  955. kControlCheckboxUncheckedValue = kControlCheckBoxUncheckedValue;
  956. kControlCheckboxCheckedValue = kControlCheckBoxCheckedValue;
  957. kControlCheckboxMixedValue = kControlCheckBoxMixedValue;
  958. {$endc} { OLDROUTINENAMES }
  959. {$endc} {TARGET_OS_MAC}
  960. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  961. end.
  962. {$endc} {not MACOSALLINCLUDE}