Controls.pas 145 KB

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