home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
useful
/
os20
/
cdity
/
devicelock.lha
/
DeviceLock
/
Txt
/
DLstrings.mod
< prev
Wrap
Text File
|
1993-12-05
|
4KB
|
150 lines
MODULE DLstrings ; (* OLK / 13.01.93 / adapted by [tom] *)
IMPORT e := Exec,
gt:= GadTools,
l := Locale,
u := Utility,
s := SYSTEM ;
CONST (* MODULE *)
NrOfMenus = 6; (* [tom] *)
CatName = "DeviceLock.catalog" ;
NrOfStrings = 34 ;
MenuProject *= 0 ;
MenuProjectLockAll *= 1 ;
MenuProjectUnlockAll *= 2 ;
MenuProjectAbout *= 4 ;
MenuProjectHide *= 6 ;
MenuProjectQuit *= 7 ;
WarnCannotAddKeyCode *= 200 ;
WarnNotValidKeyCode *= 201 ;
WarnStringTooLong *= 202 ;
WarnCorruptNumber *= 203 ;
WarnCorruptBoolean *= 204 ;
WarnCommentIsNoComment *= 205 ;
WarnUnknownOption *= 206 ;
MsgAbout *= 300 ;
MsgError *= 301 ;
MsgFailed *= 302 ;
MsgKeepUnlock *= 303 ;
MsgProblem *= 304 ;
MsgWarning *= 305 ;
MsgAllRightsReserved *= 306 ;
ErrGivenSettingsNotValid *= 400 ;
ErrCantOpenOrReadGivenSettings *= 401 ;
ErrWrongPrefs *= 402 ;
ErrCantFindAnyPrefs *= 403 ;
ErrWBReadArgs *= 404 ;
ErrZeroDrives *= 405 ;
ErrCantExLock *= 406 ;
ErrCantExUnlock *= 407 ;
GadProceedQuit *= 500 ;
GadLockAll *= 501 ;
GadKeepUnlock *= 502 ;
GadOK *= 503 ;
ProbCantLock *= 600 ;
ProbCantUnlock *= 601 ;
TYPE (* MODULE *)
AppString = RECORD
id : LONGINT ;
sp : e.STRPTR ;
END ;
AppArray = ARRAY NrOfStrings OF AppString ;
CONST (* AppStrings *)
AppStrings = AppArray(
0, s.ADR("Project"),
1, s.ADR("LOCK"),
2, s.ADR("UNLOCK"),
4, s.ADR("Version, Copyright ..."),
6, s.ADR("Hide"),
7, s.ADR("Quit ..."),
200, s.ADR("Cannot add\n'%s'."),
201, s.ADR("'%s'\nis not a valid hotkey."),
202, s.ADR("String was too long, stripped down to\n'%s'."),
203, s.ADR("Converting '%s' into number failed.\nTreated as 0."),
204, s.ADR("I cannot interpret BOOLEAN value '%s'.\nTreated as FALSE."),
205, s.ADR("'%s' invalid format.\nThese line is ignored."),
206, s.ADR("Unknown option '%s'."),
300, s.ADR("DeviceLock: Version, Copyright"),
301, s.ADR("DeviceLock: Error"),
302, s.ADR("%s failed"),
303, s.ADR("Keep actual Lock-state or UNLOCK?"),
304, s.ADR("DeviceLock: Problem"),
305, s.ADR("DeviceLock: Warning"),
306, s.ADR("All Rights reserved."),
400, s.ADR("Specified settings are no »DeviceLock.Prefs«."),
401, s.ADR("I can't find/read given settings."),
402, s.ADR("No valid »DeviceLock.Prefs« in path."),
403, s.ADR("I can't find »DeviceLock.Prefs« in path."),
404, s.ADR("Problems while reading ToolTypes."),
405, s.ADR("No drive specifications."),
406, s.ADR("Can't execute »lock ... on«."),
407, s.ADR("Can't execute »lock ... off«."),
500, s.ADR("Proceed|No further warnings|Quit"),
501, s.ADR("LOCK"),
502, s.ADR("UNLOCK|Keep|Oops, back to the program"),
503, s.ADR("OK"),
600, s.ADR("Can't lock '%s'."),
601, s.ADR("Can't unlock '%s'.")
) ;
VAR (* MODULE *)
i : INTEGER ;
CurrCat : l.CatalogPtr ;
PROCEDURE GetString* (ID : LONGINT) : e.STRPTR ;
BEGIN
FOR i := 0 TO (NrOfStrings - 1) DO
IF AppStrings[i].id = ID THEN
IF CurrCat # NIL THEN
RETURN l.GetCatalogStr (CurrCat, AppStrings[i].id, AppStrings[i].sp^)
ELSE
RETURN AppStrings[i].sp
END
END
END ;
RETURN NIL
END GetString ;
PROCEDURE FillMenu* (VAR men : ARRAY OF gt.NewMenu);
BEGIN
FOR i := 0 TO (NrOfMenus - 1) DO
IF CurrCat # NIL THEN
men[AppStrings[i].id].label := l.GetCatalogStr (CurrCat, AppStrings[i].id, AppStrings[i].sp^)
ELSE
men[AppStrings[i].id].label := AppStrings[i].sp
END
END;
END FillMenu;
BEGIN (* MODULE *)
IF l.base # NIL THEN
CurrCat := l.OpenCatalog (NIL, CatName, u.end)
END
CLOSE (* MODULE *)
IF CurrCat # NIL THEN
l.CloseCatalog (CurrCat) ;
CurrCat := NIL
END
END (* MODULE *) DLstrings.