home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Best Objectech Shareware Selections
/
UNTITLED.iso
/
boss
/
util
/
menu
/
010
/
novtrans.mnu
< prev
next >
Wrap
Text File
|
1992-12-01
|
15KB
|
477 lines
Comment
========================================================================
Novell menu to MarxMenu Translator:
Copyright 1989-92 by Marc Perkel * All rights reserved.
Usage: MARXMENU NOVTRANS <novell menu>
This program was written to translate Novell menus to MarxMenus. It is
not an exact translation, but does the bulk of the work. It is up to you
to edit the output file and tune the menu the way you want.
I have made no attempt to copy color information. I am not presenting
selections in sorted order, but in the order in which they are defined.
If the translation is successful then your old menu will be renamed with
a NOV extension.
========================================================================
EndComment
Var
Menus
MenuPtr
CommandPtr
LinePtr
ThisMenu
ThisChoice
BoxDim
VarNum
PromptLine
Out
Cap
InputAVar
NovellFileName
MarxMenuFileName
NovellTempFileName
NovFileExists
Greek
Titles
QuietMode
NovLines
;----- Translator Messages
Const
TopMessage = "Joe Blow's Master Menu"
BottomMessage = "*-<< Acme Manufacturing Company >>-*"
;----- If you want the Greek Column effect, set to true
Greek = False
Qualifier MenuName MenuTitle YPos XPos MenuColor MenuChoices
Qualifier ChoiceName ChoiceCmd
Comment
========================================================================
This is the main body of the NovTrans Program.
========================================================================
EndComment
if not NetWorkVersion
ClearScreen
Writeln
Writeln 'This translator requires the network version of MarxMenu to Run!'
endif
PreAmble
GetFileNames
Parse
if MenuPtr = 0
Writeln
Writeln
Writeln 'Error: ' NovellTempFileName ' is not a Novell menu!
ExitMenu
endif
Header
WriteOutMenus
Footer
ClearScreenFirst Off
Writeln
if QuietMode
Execute 'MARXCOMP.EXE ' + MarxMenuFileName + ' /U'
else
Execute 'MARXCOMP.EXE ' + MarxMenuFileName
endif
if ReturnCode = 0
Writeln
Writeln 'Menu Translation Sucessful!'
Writeln
if not NovFileExists and not QuietMode
Writeln 'Renaming ' NovellTempFileName ' to ' ForceExtension(NovellTempFileName,'NOV')
FileRename(NovellTempFileName,ForceExtension(NovellTempFileName,'NOV'))
Writeln 'Renaming ' MarxMenuFileName ' to ' NovellTempFileName
FileRename(MarxMenuFileName,NovellTempFileName)
Writeln
Write 'Your original novell menu has been renamed to: '
Writeln ForceExtension(NovellTempFileName,'NOV')
Writeln
endif
Writeln 'To test your menu type MARX ' NovellFileName '.
endif
ExitMenu
Comment
=====================================
Subroutine area.
=====================================
EndComment
;----- Initilize Variables and Environment
Procedure PreAmble
ClearScreenOnExit Off
if UpperCase(ParamStr(3)) = 'U'
Quietmode = True
OutFile = 'NUL'
endif
StandardIO
Writeln
NovellFileName = UpperCase(ParamStr(2))
if Extension(NovellFileName) = 'MNU'
length(NovellFileName) = length(NovellFileName) - 4
endif
Usage
EndProc
;----- Proper Usage Procedure
Procedure Usage
if NovellFileName = ''
Writeln('Converts Novell menus to MarxMenus.')
Writeln
Writeln(' Usage: MarxMenu NovTrans <menu>')
ExitMenu
endif
EndProc
;----- Get File Names
Procedure GetFileNames
if pos('.',NovellFileName) = 0
if QuietMode
NovellTempFileName = ForceExtension(NovellFileName,'MNU')
else
NovellTempFileName = ForceExtension(NovellFileName,'NOV')
if ExistOnPath(NovellTempFileName) = ''
NovellTempFileName = ForceExtension(NovellFileName,'MNU')
else
NovFileExists = True
endif
endif
endif
NovellTempFileName = ExistOnPath(NovellTempFileName)
if NovellTempFileName = ''
Writeln 'Error: ' NovellFileName ' does not exist!'
ExitMenu
endif
if NovFileExists
MarxMenuFileName = ForceExtension(NovellTempFileName,'MNU')
else
MarxMenuFileName = ForceExtension(NovellTempFileName,'TMP')
endif
ReadTextFile(NovellTempFileName,NovLines)
Writeln 'Creating ' MarxMenuFileName
EndProc
Procedure BlankLine
FileWriteln(Out,'')
EndProc
;----- Write out the MarxMenu Source Header
Procedure Header
FileAssign(Out,MarxMenuFileName)
FileCreate(Out)
BlankLine
FileWriteln(Out,'Comment')
FileWriteln(Out,'==========================================================')
BlankLine
FileWriteln(Out,'This File was converted from Novell Menu: ',NovellTempFileName)
BlankLine
FileWriteln(Out,'It should behave in a similar way to the original menu but')
FileWriteln(Out,'not necessarilly exactly the same. It will be close enough')
FileWriteln(Out,'for you to fine tune it the way you want.')
BlankLine
FileWriteln(Out,'To add a choice to a menu simply use the AddChoice command')
FileWriteln(Out,'then add the appropiate Onkey statement.')
FileWriteln(Out,'The menu will make the size adjustments accordinaly.')
BlankLine
FileWriteln(Out,' Example:')
FileWriteln(Out,' AddChoice("Print Console",10)')
FileWriteln(Out,' ... ')
FileWriteln(Out,' ... ')
FileWriteln(Out,' OnKey Task(10)')
FileWriteln(Out,' cd \public')
FileWriteln(Out,' PConsole')
FileWriteln(Out,' ...')
BlankLine
FileWriteln(Out,"If you want to change the menu's center, pass the XY")
FileWriteln(Out,"coordinates to menu's CenterStretchBox procedure.")
BlankLine
FileWriteln(Out,' Example:')
FileWriteln(Out,' CenterStretchBox("Menu Header",40,12)')
BlankLine
FileWriteln(Out,'This will cause the menu to center at Col 40, Row 12')
BlankLine
FileWriteln(Out,'Instead of defining the center of the box, there is a command')
FileWriteln(Out,'CornerStretchBox where the box grows down and right.')
BlankLine
FileWriteln(Out,' Example:')
FileWriteln(Out,' CornerStretchBox("Menu Header",8,6)')
BlankLine
FileWriteln(Out,'To control custom features, edit CUSTOM.INC and other INCLUDE Files.')
BlankLine
FileWriteln(Out,'=========================================================')
FileWriteln(Out,'EndComment')
BlankLine
FileWriteln(Out,';----- Create Variables')
BlankLine
FileWriteln(Out,'var')
FileWriteln(Out,' NovVar')
FileWriteln(Out,' KeepUsersInMenu')
BlankLine
BlankLine
FileWriteln(Out,';----- Here is where you add you own menu title and status line message')
BlankLine
FileWriteln(Out,'MenuTitle = "',TopMessage,'"')
FileWriteln(Out,'StatusLineText = "',BottomMessage,'"')
BlankLine
FileWriteln(Out,';----- Load Novell look and feel routines')
BlankLine
FileWriteln(Out,'Include "CUSTOM.INC"')
if Greek then FileWriteln(Out,'Greek = True')
BlankLine
FileWriteln(Out,'KeepUsersInMenu Off ;Change to On to keep users in menu.')
BlankLine
FileWriteln(Out,'Comment')
FileWriteln(Out,'=================================')
BlankLine
FileWriteln(Out,'MarxMenu is capable of software metering. This means that it can')
FileWriteln(Out,'limit the number of users of an application to a fixed amount.')
BlankLine
FileWriteln(Out,' OnKey Task (2)')
FileWriteln(Out," |if Limit('LOTUS',6) then Return ;limit Lotus to 6 Users")
FileWriteln(Out,' CD \PUBLIC\LOTUS')
FileWriteln(Out,' 123')
BlankLine
FileWriteln(Out,'Read the METER.INC file for more details.')
BlankLine
FileWriteln(Out,'=================================')
FileWriteln(Out,'EndComment')
BlankLine
FileWriteln(Out,"Include 'METER.INC' ;Software Metering")
BlankLine
FileWriteln(Out,'Comment')
FileWriteln(Out,'=================================')
BlankLine
FileWriteln(Out,'In order to add menu choices conditionally you would append the')
FileWriteln(Out,'choices to the end of the array after all the default choices')
FileWriteln(Out,'are