home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Extra 1997 #5
/
AmigaPlus_Extra-CD_5-97.iso
/
online-tools
/
mail
/
netmail
/
drivers
/
turbotext.editor
< prev
next >
Wrap
Text File
|
1995-08-11
|
3KB
|
134 lines
/*
** $VER: TurboText.editor 1.3 (11.8.95)
** Copyright (c) 1995 Riccardo Solmi
**
*/
OPTIONS RESULTS
OPTIONS FAILAT 21
cmd = 'TURBOTEXT:TTX'
IF ~EXISTS(cmd) THEN DO
cmd = GetVar('NetMail/TurboTextCmd')
IF cmd = 0 | ~EXISTS(cmd) THEN DO
ADDRESS COMMAND 'SetEnv NetMail/TurboTextCmd `Which "TurboText"`'
cmd = GetVar('NetMail/TurboTextCmd')
IF cmd = 0 THEN DO
ADDRESS COMMAND 'SetEnv NetMail/TurboTextCmd `RequestFile Title "Select TurboText command" Noicons`'
cmd = GetVar('NetMail/TurboTextCmd')
IF cmd = 0 | ~EXISTS(cmd) THEN RETURN 2
ADDRESS COMMAND 'Copy QUIET ENV:NetMail/TurboTextCmd ENVARC:NetMail/TurboTextCmd'
END
END
END
SELECT
WHEN UPPER(ARG(1)) = 'EDIT' THEN DO
PARSE ARG , file, port
IF ~SHOW('P', port) | ~ABBREV(port, 'TURBOTEXT') THEN DO
IF ~SHOW('P', 'TURBOTEXT') THEN DO
ADDRESS COMMAND
'"'cmd'" >NIL:'
'WaitForPort TURBOTEXT0'
IF RC ~= 0 THEN RETURN 0
port = 'TURBOTEXT0'
END
ELSE DO
ADDRESS 'TURBOTEXT'
OpenDoc
port = RESULT
END
wininfo = GetVar('NetMail/EditorWin')
IF wininfo ~= 0 THEN DO
PARSE VAR wininfo pL pT pW pH .
ADDRESS VALUE port
CALL ChangeWindow pL pT pW pH port
END
END
ADDRESS VALUE port
'SetReadOnly OFF'
'OpenFile QUIET NAME' file
END
WHEN UPPER(ARG(1)) = 'SAVE' THEN DO
PARSE ARG , port
IF SHOW('P', port) & ABBREV(port, 'TURBOTEXT') THEN DO
ADDRESS VALUE port
'SaveFile NOICON NOBACKUP'
END
END
WHEN UPPER(ARG(1)) = 'CLOSE' THEN DO
PARSE ARG , port
IF SHOW('P', port) & ABBREV(port, 'TURBOTEXT') THEN DO
ADDRESS VALUE port
wininfo = GetVar('NetMail/EditorWin')
PARSE VAR wininfo pL pT pW pH cLTWH
'GetWindowInfo'
PARSE VAR RESULT . pL pT pW pH .
SetVar('NetMail/EditorWin', pL pT pW pH cLTWH)
'CloseDoc QUIET'
END
END
END
RETURN port
ChangeWindow:
/** $VER: ChangeWindow.ttx 1.0 (23.12.90)
**
** Unlike the MoveWindow and SizeWindow commands this lets you place and
** size a window with absolute, not relative, coordinates. ChangeWindow won't
** let you go beyond screen boundaries. The window will be moved then
** sized as closely to spec as possible.
**
** Written by Art Steinmetz
** Modified by Martin Taillefer
**/
PARSE ARG left top width height port
port = Strip(port,'B')
IF (port ~= "") THEN DO
ADDRESS VALUE port
END
GetWindowInfo
PARSE VAR RESULT icon winLeft winTop winWidth winHeight minWidth minHeight .
GetScreenInfo
PARSE VAR RESULT dum dum scrWidth scrHeight .
IF width > scrWidth THEN DO
width = scrWidth
END
IF height > scrHeight THEN DO
Height = scrHeight
END
IF left + width > scrWidth THEN DO
left = scrWidth - width
END
IF top + height > scrHeight THEN DO
top = scrHeight - height
END
IF left < 0 THEN DO
left = 0
END
IF top < 0 THEN DO
top = 0
END
SizeWindow (minWidth - winWidth) (minHeight - winHeight)
MoveWindow (left - winLeft) (top - winTop)
SizeWindow (width - minWidth) (height - minHeight)
RETURN