HIButtonViews.pas 38 KB

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