home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / progrmng / mlpmodul.sit / MacLogimoPlus Documentation / DEF3 Files / DialogMgr.DEF < prev    next >
Encoding:
Modula Definition  |  1990-06-14  |  6.5 KB  |  141 lines  |  [TEXT/PMED]

  1. DEFINITION MODULE DialogMgr;    (* Christoph Fleischer 06.02.85 *)
  2.                                 (* MacIntosh Toolbox Dialog Manager Routines *)
  3.                                 (* last modification   01.07.85 fxk*)
  4. FROM SYSTEM IMPORT ADDRESS;
  5. FROM MacBase IMPORT LongInt,Handle,StrPtr;
  6. FROM WindowMgr IMPORT WindowPtr,WindowRecord;
  7. FROM EventMgr IMPORT EventRecord;
  8. FROM TextEdit IMPORT TEHandle;
  9. FROM QuickDraw IMPORT Rect;
  10.  
  11. EXPORT QUALIFIED
  12.   UserItem,CtrlItem,BtnCtrl,ChkCtrl,RadCtrl,ResCtrl,StatText,EditText,IconItem,PicItem,ItemDisable,OK,Cancel,
  13.   DialogPtr,DialogPeek,DialogRecord,DialogTHndl,DialogTPtr,DialogTemplate,StageList,AlertTHndl,AlertTPtr,
  14.   AlertTemplate,RestartProcPtr,FilterProcPtr,SoundNumber,ErrorProcPtr,
  15.   InitDialogs,GetNewDialog,NewDialog,IsDialogEvent,DialogSelect,ModalDialog,DrawDialog,CloseDialog,
  16.   DisposDialog,Alert,StopAlert,NoteAlert,CautionAlert,CouldAlert,FreeAlert,CouldDialog,FreeDialog,ParamText,
  17.   ErrorSound,GetDItem,SetDItem,SetIText,GetIText,SelIText,DlgCut,DlgPaste,DlgCopy;
  18.  
  19. CONST
  20.   UserItem    = 0;
  21.   CtrlItem    = 4;
  22.   BtnCtrl     = 0;              (* Low two bits specify what kind of control *)
  23.   ChkCtrl     = 1;
  24.   RadCtrl     = 2;
  25.   ResCtrl     = 3;
  26.  
  27.   StatText    = 8;              (* Static text    *)
  28.   EditText    = 16;             (* Editable text  *)
  29.   IconItem    = 32;             (* Icon item      *)
  30.   PicItem     = 64;             (* Picture item   *)
  31.   ItemDisable = 128;            (* Disable item if set *)
  32.  
  33.   OK          = 1;              (* OK button is first by convention *)
  34.   Cancel      = 2;              (* Cancel button is second by convention *)
  35.  
  36. TYPE
  37.   DialogPtr    = WindowPtr;
  38.   DialogPeek   = POINTER TO DialogRecord;
  39.   DialogRecord = RECORD
  40.                    window:      WindowRecord;
  41.                    Items:       Handle;
  42.                    textH:       TEHandle;
  43.                    EditField:   INTEGER;
  44.                    EditOpen:    INTEGER;
  45.                    ADefItem:    INTEGER;
  46.                  END;
  47.  
  48.   DialogTHndl    = POINTER TO DialogTPtr;
  49.   DialogTPtr     = POINTER TO DialogTemplate;
  50.   DialogTemplate = RECORD
  51.                      boundsRect:  Rect;
  52.                      procID:      INTEGER;
  53.                      visible:     BOOLEAN;
  54.                      filler1:     BOOLEAN;
  55.                      goAwayFlag:  BOOLEAN;
  56.                      filler2:     BOOLEAN;
  57.                      refCon:      LongInt;
  58.                      ItemsID:     INTEGER;
  59.                      title:       ARRAY[0..255] OF CHAR;
  60.                    END;
  61.  
  62.   StageList      = BITSET;      (* PACKED ARRAY [1..4] OF RECORD
  63.                                      boldItem:  [0..1];
  64.                                      boxDrawn:  BOOLEAN;
  65.                                      sound:     [0..3];
  66.                                    END;                     *)
  67.  
  68.   AlertTHndl    = POINTER TO AlertTPtr;
  69.   AlertTPtr     = POINTER TO AlertTemplate;
  70.   AlertTemplate = RECORD
  71.                     boundsRect:  Rect;
  72.                     itemsID:     INTEGER;
  73.                     stages:      StageList;
  74.                   END;
  75.  
  76.   RestartProcPtr = ADDRESS;
  77.   FilterProcPtr  = ADDRESS;(* PROCEDURE(DialogPtr,VAR EventRecord,VAR INTEGER): BOOLEAN;*)
  78.   SoundNumber    = [0..3];
  79.   ErrorProcPtr   = ADDRESS;
  80.  
  81.  
  82. PROCEDURE InitDialogs(restartProc: RestartProcPtr);               (*INLINE $A97B*)
  83. PROCEDURE GetNewDialog(dialogID: INTEGER;
  84.                        wStorage: ADDRESS;
  85.                        behind:  WindowPtr): DialogPtr;            (*INLINE $A97C*)
  86. PROCEDURE NewDialog(wStorage:       ADDRESS;
  87.                     VAR boundsRect: Rect;
  88.                     title:          StrPtr;
  89.                     visible:        BOOLEAN;
  90.                     theProc:        INTEGER;
  91.                     behind:         WindowPtr;
  92.                     goAwayFlag:     BOOLEAN;
  93.                     refCon:         LongInt;
  94.                     itmLstHndl:     Handle): DialogPtr;           (*INLINE $A97D*)
  95. PROCEDURE IsDialogEvent(VAR event:   EventRecord): BOOLEAN;       (*INLINE $A97F*)
  96. PROCEDURE DialogSelect (VAR event:   EventRecord;
  97.                        VAR theDialog:  DialogPtr;
  98.                        VAR itemHit: INTEGER): BOOLEAN;            (*INLINE $A980*)
  99. PROCEDURE ModalDialog( filterProc: FilterProcPtr; VAR itemHit: INTEGER);
  100.                                                                   (*INLINE $A991*)
  101. PROCEDURE DrawDialog(dialog: DialogPtr);                          (*INLINE $A981*)
  102. PROCEDURE CloseDialog(dialog: DialogPtr);                         (*INLINE $A982*)
  103. PROCEDURE DisposDialog(dialog: DialogPtr);                        (*INLINE $A983*)
  104. PROCEDURE Alert(alertID:     INTEGER;
  105.                 filterProc:  FilterProcPtr): INTEGER;             (*INLINE $A985*)
  106. PROCEDURE StopAlert(alertID:     INTEGER;
  107.                     filterProc:  FilterProcPtr): INTEGER;         (*INLINE $A986*)
  108. PROCEDURE NoteAlert(alertID:     INTEGER;
  109.                     filterProc:  FilterProcPtr): INTEGER;         (*INLINE $A987*)
  110. PROCEDURE CautionAlert(alertID:     INTEGER;
  111.                        filterProc:  FilterProcPtr): INTEGER;      (*INLINE $A988*)
  112. PROCEDURE CouldAlert(alertID:  INTEGER);                          (*INLINE $A989*)
  113. PROCEDURE FreeAlert(alertID:   INTEGER);                          (*INLINE $A98A*)
  114. PROCEDURE CouldDialog(DlgID:  INTEGER);                           (*INLINE $A979*)
  115. PROCEDURE FreeDialog(DlgID:   INTEGER);                           (*INLINE $A97A*)
  116. PROCEDURE ParamText(cite0, cite1, cite2, cite3:  StrPtr);     (*INLINE $A98B*)
  117. PROCEDURE ErrorSound(sound: ErrorProcPtr);                        (*INLINE $A98C*)
  118. PROCEDURE GetDItem(dialog:         DialogPtr;
  119.                    itemNo:         INTEGER;
  120.                    VAR kind:       INTEGER;
  121.                    VAR item:       Handle;
  122.                    VAR box:        Rect);                         (*INLINE $A98D*)
  123. PROCEDURE SetDItem(dialog:         DialogPtr;
  124.                    itemNo:         INTEGER;
  125.                    kind:           INTEGER;
  126.                    item:           Handle;
  127.                    VAR box:        Rect);                         (*INLINE $A98E*)
  128. PROCEDURE SetIText(item:       Handle; text:   StrPtr);                           (*INLINE $A98F*)
  129. PROCEDURE GetIText(item:       Handle; text:   StrPtr);                           (*INLINE $A990*)
  130. PROCEDURE SelIText(dialog:   DialogPtr;
  131.                    itemNo:   INTEGER;
  132.                    startSel, endSel: INTEGER );                   (*INLINE $A97E*)
  133.  
  134. (*********** These procedures are not yet implemented ****************)
  135.  
  136. PROCEDURE DlgCut(dialog: DialogPtr);
  137. PROCEDURE DlgPaste(dialog: DialogPtr);
  138. PROCEDURE DlgCopy(dialog: DialogPtr);
  139.  
  140. END DialogMgr.
  141.