home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / MacInterface / controls.icl < prev    next >
Encoding:
Modula Implementation  |  1996-12-06  |  3.1 KB  |  114 lines  |  [TEXT/3PRM]

  1. implementation module controls;
  2.  
  3. import mac_types;
  4.  
  5. InButton :== 10;
  6. InCheckBox :== 11;
  7. InUpButton :== 20;
  8. InDownButton :== 21;
  9. InPageUp :== 22;
  10. InPageDown :== 23;
  11. InThumb :== 129;
  12.  
  13. ::    ControlHandle :== Int;
  14.  
  15. //    Initialization and Allocation
  16.  
  17. NewControl :: !WindowPtr !Rect !{#Char} !Bool !Int !Int !Int !Int !Int !Toolbox -> (!ControlHandle,!Toolbox);
  18. NewControl theWindow (left,top,right,bottom) title visible value min max procID refCon t
  19. = code (right=W,bottom=W,left=W,top=W,theWindow=R4L,title=O8S,visible=W,value=W,
  20.         min=W,max=W,procID=W,refCon=L,t=U)(control=L,z=I8Z)
  21. {
  22.     instruction 0xA954
  23. };
  24.  
  25. //    Control Display
  26.  
  27. SetCTitle :: !ControlHandle !{#Char} !Toolbox -> Toolbox;
  28. SetCTitle theControl title t = code (theControl=L,title=S,t=U)(z=Z){
  29.     instruction 0xA95F        || _SetCTitle
  30. };
  31.  
  32. HideControl :: !ControlHandle !Toolbox -> Toolbox;
  33. HideControl theControl t = code (theControl=L,t=U)(z=Z){
  34.     instruction 0xA958
  35. };
  36.  
  37. ShowControl :: !ControlHandle !Toolbox -> Toolbox;
  38. ShowControl theControl t = code (theControl=L,t=U)(z=Z){
  39.     instruction 0xA957
  40. };
  41.  
  42. DrawControls :: !WindowPtr !Toolbox -> Toolbox;
  43. DrawControls theWindow t = code (theWindow=L,t=U)(z=Z){
  44.     instruction 0xA969
  45. };
  46.  
  47. UpdtControl :: !WindowPtr !RgnHandle !Toolbox -> Toolbox;
  48. UpdtControl theWindow updateRgn t = code (theWindow=L,updateRgn=L,t=U)(z=Z){
  49.     instruction 0xA953
  50. };
  51.  
  52. //    Mouse Location
  53.  
  54. FindControl :: !Int !Int !WindowPtr !Toolbox -> (!ControlHandle,!Int,!Toolbox);
  55. FindControl h v theWindow t
  56. = code (h=R6W,v=W,theWindow=L,t=O10U)(part_code=W,whichControl=L,z=Z){
  57.     instruction 0xA96C
  58. };
  59.  
  60. TrackControl :: !ControlHandle !Int !Int !Int !Toolbox -> (!Int,!Toolbox);
  61. TrackControl theControl h v actionProc t
  62. = code (theControl=R2L,h=W,v=W,actionProc=L,t=U)(r=W,z=Z){
  63.     instruction 0xA968
  64. };
  65.  
  66. //    Control Movement and Sizing
  67.  
  68. MoveControl :: !ControlHandle !Int !Int !Toolbox -> Toolbox;
  69. MoveControl theControl h v t = code (theControl=L,h=W,v=W,t=U)(z=Z){
  70.     instruction 0xA959
  71. };
  72.  
  73. SizeControl :: !ControlHandle !Int !Int !Toolbox -> Toolbox;
  74. SizeControl theControl w h t = code (theControl=L,w=W,h=W,t=U)(z=Z){
  75.     instruction 0xA95C
  76. };
  77.  
  78. //    Control Setting and Range
  79.  
  80. SetCtlValue :: !ControlHandle !Int !Toolbox -> Toolbox;
  81. SetCtlValue theControl theValue t = code (theControl=L,theValue=W,t=U)(z=Z){
  82.     instruction 0xA963
  83. };
  84.  
  85. GetCtlValue :: !ControlHandle !Toolbox -> (!Int,!Toolbox);
  86. GetCtlValue theControl t = code (theControl=R2L,t=U)(v=W,z=Z){
  87.     instruction 0xA960
  88. };
  89.  
  90. SetCtlMin :: !ControlHandle !Int !Toolbox -> Toolbox;
  91. SetCtlMin theControl minValue t = code (theControl=L,minValue=W,t=U)(z=Z){
  92.     instruction 0xA964
  93. };
  94.  
  95. GetCtlMin :: !ControlHandle !Toolbox -> (!Int,!Toolbox);
  96. GetCtlMin theControl t = code (theControl=R2L,t=U)(v=W,z=Z){
  97.     instruction 0xA961
  98. };
  99.  
  100. SetCtlMax :: !ControlHandle !Int !Toolbox -> Toolbox;
  101. SetCtlMax theControl maxValue t = code (theControl=L,maxValue=W,t=U)(z=Z){
  102.     instruction 0xA965
  103. };
  104.  
  105. GetCtlMax :: !ControlHandle !Toolbox -> (!Int,!Toolbox);
  106. GetCtlMax theControl t = code (theControl=R2L,t=U)(v=W,z=Z){
  107.     instruction 0xA962
  108. };
  109.  
  110. HiliteControl :: !ControlHandle !Int !Toolbox -> Toolbox;
  111. HiliteControl theControl hiliteState t = code (theControl=L,hiliteState=W,t=U)(z=Z){
  112.     instruction 0xA95D
  113. };
  114.