home *** CD-ROM | disk | FTP | other *** search
Modula Implementation | 1996-12-06 | 3.1 KB | 114 lines | [TEXT/3PRM] |
- implementation module controls;
-
- import mac_types;
-
- InButton :== 10;
- InCheckBox :== 11;
- InUpButton :== 20;
- InDownButton :== 21;
- InPageUp :== 22;
- InPageDown :== 23;
- InThumb :== 129;
-
- :: ControlHandle :== Int;
-
- // Initialization and Allocation
-
- NewControl :: !WindowPtr !Rect !{#Char} !Bool !Int !Int !Int !Int !Int !Toolbox -> (!ControlHandle,!Toolbox);
- NewControl theWindow (left,top,right,bottom) title visible value min max procID refCon t
- = code (right=W,bottom=W,left=W,top=W,theWindow=R4L,title=O8S,visible=W,value=W,
- min=W,max=W,procID=W,refCon=L,t=U)(control=L,z=I8Z)
- {
- instruction 0xA954
- };
-
- // Control Display
-
- SetCTitle :: !ControlHandle !{#Char} !Toolbox -> Toolbox;
- SetCTitle theControl title t = code (theControl=L,title=S,t=U)(z=Z){
- instruction 0xA95F || _SetCTitle
- };
-
- HideControl :: !ControlHandle !Toolbox -> Toolbox;
- HideControl theControl t = code (theControl=L,t=U)(z=Z){
- instruction 0xA958
- };
-
- ShowControl :: !ControlHandle !Toolbox -> Toolbox;
- ShowControl theControl t = code (theControl=L,t=U)(z=Z){
- instruction 0xA957
- };
-
- DrawControls :: !WindowPtr !Toolbox -> Toolbox;
- DrawControls theWindow t = code (theWindow=L,t=U)(z=Z){
- instruction 0xA969
- };
-
- UpdtControl :: !WindowPtr !RgnHandle !Toolbox -> Toolbox;
- UpdtControl theWindow updateRgn t = code (theWindow=L,updateRgn=L,t=U)(z=Z){
- instruction 0xA953
- };
-
- // Mouse Location
-
- FindControl :: !Int !Int !WindowPtr !Toolbox -> (!ControlHandle,!Int,!Toolbox);
- FindControl h v theWindow t
- = code (h=R6W,v=W,theWindow=L,t=O10U)(part_code=W,whichControl=L,z=Z){
- instruction 0xA96C
- };
-
- TrackControl :: !ControlHandle !Int !Int !Int !Toolbox -> (!Int,!Toolbox);
- TrackControl theControl h v actionProc t
- = code (theControl=R2L,h=W,v=W,actionProc=L,t=U)(r=W,z=Z){
- instruction 0xA968
- };
-
- // Control Movement and Sizing
-
- MoveControl :: !ControlHandle !Int !Int !Toolbox -> Toolbox;
- MoveControl theControl h v t = code (theControl=L,h=W,v=W,t=U)(z=Z){
- instruction 0xA959
- };
-
- SizeControl :: !ControlHandle !Int !Int !Toolbox -> Toolbox;
- SizeControl theControl w h t = code (theControl=L,w=W,h=W,t=U)(z=Z){
- instruction 0xA95C
- };
-
- // Control Setting and Range
-
- SetCtlValue :: !ControlHandle !Int !Toolbox -> Toolbox;
- SetCtlValue theControl theValue t = code (theControl=L,theValue=W,t=U)(z=Z){
- instruction 0xA963
- };
-
- GetCtlValue :: !ControlHandle !Toolbox -> (!Int,!Toolbox);
- GetCtlValue theControl t = code (theControl=R2L,t=U)(v=W,z=Z){
- instruction 0xA960
- };
-
- SetCtlMin :: !ControlHandle !Int !Toolbox -> Toolbox;
- SetCtlMin theControl minValue t = code (theControl=L,minValue=W,t=U)(z=Z){
- instruction 0xA964
- };
-
- GetCtlMin :: !ControlHandle !Toolbox -> (!Int,!Toolbox);
- GetCtlMin theControl t = code (theControl=R2L,t=U)(v=W,z=Z){
- instruction 0xA961
- };
-
- SetCtlMax :: !ControlHandle !Int !Toolbox -> Toolbox;
- SetCtlMax theControl maxValue t = code (theControl=L,maxValue=W,t=U)(z=Z){
- instruction 0xA965
- };
-
- GetCtlMax :: !ControlHandle !Toolbox -> (!Int,!Toolbox);
- GetCtlMax theControl t = code (theControl=R2L,t=U)(v=W,z=Z){
- instruction 0xA962
- };
-
- HiliteControl :: !ControlHandle !Int !Toolbox -> Toolbox;
- HiliteControl theControl hiliteState t = code (theControl=L,hiliteState=W,t=U)(z=Z){
- instruction 0xA95D
- };
-