home *** CD-ROM | disk | FTP | other *** search
Modula Definition | 1990-01-26 | 6.8 KB | 142 lines |
- DEFINITION MODULE Gads;
-
- (*======================================================================*)
- (* Helper version v0.07 *)
- (*======================================================================*)
- (* Copyright © 1989 Mike Cargal, All Rights Reserved *)
- (*======================================================================*)
- (* Version: 0.07 Author : Mike Cargal *)
- (* Date : 20-Jun-89 Changes: Original *)
- (*======================================================================*)
-
- FROM SYSTEM IMPORT STRPTR;
- FROM Intuition IMPORT GadgetPtr, WindowPtr, IntuiMessage;
-
- TYPE
-
- Gad = RECORD
- Command : ARRAY [0..99] OF CHAR; (* Command TO execute
- when Helper button
- clicked *)
- Label : ARRAY [0..8] OF CHAR; (* Label TO place on
- Helper button *)
- AppendFile : BOOLEAN; (* Append File TO
- command TRUE/FALSE *)
- END;
-
- GadArray = ARRAY [0..11] OF Gad; (* ARRAY OF 12 Helper buttons *)
- GadPtr = POINTER TO GadArray;
-
- CONST
- Version = "Helper v0.07";
-
- VAR
- DefConfig : STRPTR;
-
- (*******************************************************************)
-
- PROCEDURE ChangeGads(Helperwp : WindowPtr);
-
- (*-------------------------------------------------------------\
- | |
- | Open Window with Helper button definition gadgets. |
- | |
- | Use EasyIDCMP to respond to user gadget selection and |
- | modify user configuration. |
- | |
- \-------------------------------------------------------------*)
-
- PROCEDURE LoadGads(wp : WindowPtr);
-
- (*-------------------------------------------------------------\
- | |
- | Present user with File requester to select configuration |
- | file, and then load user configuration from selected |
- | file. Configuration file is verified against version |
- | number of Helper so that non-configuration files and |
- | incompatible configuration files will be rejected. |
- | |
- | Return success or failure of Configuration load. |
- | |
- | NOTE: file requester goes initially to S: since |
- | requesting configuration file. |
- | |
- \-------------------------------------------------------------*)
-
- PROCEDURE SaveGads(wp : WindowPtr);
-
- (*-------------------------------------------------------------\
- | |
- | Present user with File requester (inititially in S:) to |
- | select configuration file. Save current configuration |
- | to selected file. |
- | |
- \-------------------------------------------------------------*)
-
- PROCEDURE SaveDefaults(wp : WindowPtr);
-
- (*-------------------------------------------------------------\
- | |
- | Save current configuration to default configuration file |
- | (S:Helper.cnf). This file will be read automatically |
- | when Helper is started up to obtain users default |
- | configuration. |
- | |
- \-------------------------------------------------------------*)
-
- PROCEDURE InitGads() : GadPtr;
-
- (*-------------------------------------------------------------\
- | |
- | Attempt to open S:Helper.cnf to read in user's default |
- | configuration. |
- | |
- | If default configuration file is not located, then |
- | assign "default default" values to Helper buttons |
- | |
- \-------------------------------------------------------------*)
-
- PROCEDURE GetFile(text, Dir : STRPTR) : STRPTR;
-
- (*-------------------------------------------------------------\
- | |
- | Use Arp File requester to get file name. |
- | text - Title to appear at top of requester |
- | Dir - Directory in which requester should initiate. |
- | NIL = Use Current Directory of Process. |
- | |
- | Returns - STRPTR to full path name of requested file. |
- | |
- \-------------------------------------------------------------*)
-
- PROCEDURE HandleCloseWindow(VAR im : IntuiMessage) : INTEGER;
-
- (*-------------------------------------------------------------\
- | |
- | Handle Close Window IDCMP message for EasyIDCMP. |
- | |
- | I have nothing special to do, so just return non 0 |
- | to let EasyIDCMP know I'm through. |
- | |
- \-------------------------------------------------------------*)
-
- PROCEDURE OpenHelperWindow() : WindowPtr;
-
- (*-------------------------------------------------------------\
- | |
- | Open up Helper window according to configuration file |
- | or established defaults. |
- | |
- \-------------------------------------------------------------*)
-
- PROCEDURE CloseHelperWindow(wp : WindowPtr);
-
- (*-------------------------------------------------------------\
- | |
- | Close Helper Window, freeing Gadget List etc. |
- | |
- \-------------------------------------------------------------*)
-
-
- END Gads.
-