home *** CD-ROM | disk | FTP | other *** search
- {$I OpenWild.inc } { Command line open }
- {|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-
- UTILITY
-
- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
- CONST
- PLanguage : PString = NIL ;
- {===================================================================
- ===================================================================}
- procedure CalcHelp ( NameOnly : string ) ;
- begin
- Names.HLP := Names.EXE ;
- while Names.HLP [ length ( Names.HLP ) ] <> '\' do
- dec ( Names.HLP [ 0 ] ) ;
- Names.HLP := Names.HLP + NameOnly + '.HLP' ;
- end ;
- {|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-
- CONFIG - Current Language
-
- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
- {===================================================================
-
- SAVE
-
- ===================================================================}
- procedure SaveConfig ;
- var
- Strm : PStream ;
- Description : string ;
- begin
- if Names.DAT = '' then EXIT ;
- Strm := New ( PDosStream ,
- Init ( Names.DAT ,
- stCreate ) ) ;
- Description := 'BABEL.EXE Multi-Language Editor - Configuration File' + #26 ;
- Strm^.Write ( Description[1] , length ( Description ) ) ;
- Strm^.WriteStr ( PLanguage ) ;
- if Strm^.Status <> stOk then
- begin
- FileErase ( Names.DAT ) ;
- MessageBox ( ^C'Could not create'#13
- + Names.DAT ,
- NIL ,
- mfError + mfOkButton ) ;
- end ;
- Dispose ( Strm , Done ) ;
- end ;
- {===================================================================
-
- LOAD
-
- ===================================================================}
- procedure LoadConfig ;
- var
- Strm : PStream ;
- Ch : char ;
- begin
- if not FileExist ( Names.DAT ) then EXIT ;
- Strm := New ( PDosStream ,
- Init ( Names.DAT ,
- stOpenRead ) ) ;
- Ch := #0 ;
- while ( Ch <> ^Z ) and ( Strm^.Status = stOK ) do
- Strm^.Read ( Ch , 1 ) ;
- PLanguage := Strm^.ReadStr ;
- if Strm^.Status <> stOk then
- MessageBox ( ^C'Error reading desktop file'#13
- + Names.DAT ,
- NIL ,
- mfError + mfOkButton ) ;
- Dispose ( Strm , Done ) ;
- end ;
- {===================================================================
-
- EXECUTE
-
- ===================================================================}
- function EditorDialog ( Dialog : Integer ;
- Info : Pointer ) : word ;
- var
- R : TRect ;
- T : TPoint ;
- begin
- case Dialog of
- edOutOfMemory :
- EditorDialog := MessageBox ( ^C'Not enough memory for this operation.' ,
- NIL ,
- mfError + mfOkButton ) ;
- edReadError :
- EditorDialog := MessageBox ( ^C'Error reading file %s.' ,
- @Info ,
- mfError + mfOkButton ) ;
- edWriteError :
- EditorDialog := MessageBox ( ^C'Error writing file %s.' ,
- @Info ,
- mfError + mfOkButton ) ;
- edCreateError :
- EditorDialog := MessageBox ( ^C'Error creating file %s.' ,
- @Info ,
- mfError + mfOkButton ) ;
- edSaveModify :
- EditorDialog := MessageBox ( ^C'%s has been modified. Save?' ,
- @Info ,
- mfInformation + mfYesNoCancel ) ;
- edSaveUntitled :
- EditorDialog := MessageBox ( ^C'Save untitled file?' ,
- NIL ,
- mfInformation + mfYesNoCancel ) ;
- edSaveAs :
- EditorDialog := ExecDialog ( New ( PFileDialog , Init ( '*.*' ,
- 'Save file as' ,
- '~N~ame' ,
- fdOkButton ,
- 101 ) ) , Info ) ;
- edFind :
- EditorDialog := ExecDialog ( CreateFindDialog , Info ) ;
- edSearchFailed:
- EditorDialog := MessageBox ( ^C'Search string not found.' ,
- NIL ,
- mfError + mfOkButton ) ;
- edReplace :
- EditorDialog := ExecDialog ( CreateReplaceDialog , Info ) ;
- edReplacePrompt :
- begin
- {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Avoid placing the dialog on the same line as the cursor
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
- R.Assign ( 0 , 1 , 40 , 8 ) ;
- R.Move ( ( Desktop^.Size.X - R.B.X ) div 2 , 0 ) ;
- Desktop^.MakeGlobal ( R.B , T ) ;
- Inc ( T.Y ) ;
- if TPoint(Info).Y <= T.Y then
- R.Move ( 0 , Desktop^.Size.Y - R.B.Y - 2 ) ;
- EditorDialog := MessageBoxRect ( R ,
- ^C'Replace this occurence?' ,
- NIL ,
- mfYesNoCancel
- + mfInformation ) ;
- end ;
- else
- MessageBox ( ^C'Unknown DIALOG requested!' ,
- NIL ,
- mfError + mfOkButton ) ;
- end ;
- end ;
- {===================================================================
-
- COPYRIGHT
-
- ===================================================================}
- procedure CopyrightMsg ;
- begin
- writeln ( '▐▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▌' ) ;
- writeln ( '▐ ░▒▓█ BABEL Multi-Lingual Editor █▓▒░ Version ' + VersionCode + ' ▌' ) ;
- writeln ( '▐──────────────────────────────────────────────────────────────────────────▌' ) ;
- writeln ( '▐ Copyright (c) 1992 Johnathan J. Stein All Rights Reserved Worldwide ▌' ) ;
- writeln ( '▐ ▌' ) ;
- writeln ( '▐ STEIN RESEARCH & ENGINEERING Voice 419.666.7103 ▌' ) ;
- writeln ( '▐ Post Office Box 346 Fax 419.874.4922 ▌' ) ;
- writeln ( '▐ Perrysburg, OH 43552 CompuServe 76576.470 ▌' ) ;
- writeln ( '▐ USA INTERNET 76576.470@compuserve.com ▌' ) ;
- writeln ( '▐▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▌' ) ;
- writeln ;
- writeln ;
- writeln ( 'Translation Services by' ) ;
- writeln ( '┌──────────────────────────────────────────────────────────────────────────┐' ) ;
- writeln ( '│ Thomas Davidson │' ) ;
- writeln ( '│ PASO del NORTE LENGUAJE Voice 915.564.0990 │' ) ;
- writeln ( '│ 2713 Hamilton Ave Fax 915.564.5293 │' ) ;
- writeln ( '│ El Paso, TX 79930-3639 CompuServe 75540.1022 │' ) ;
- writeln ( '│ USA INTERNET 75540.1022@compuserve.com │' ) ;
- writeln ( '└──────────────────────────────────────────────────────────────────────────┘' ) ;
- end ;
-