Peter, here a simple(r) solution.
You can use it as prototype.
Of course you have to adapt it to your needs.
Just add someting like that to the appropriate .cft file
(e.g. java.cft):
if ( File_Exist("|(HOME)/java-sdk.mnu",NOERR) ) {
Reg_Load(124,"|(HOME)/java-sdk.mnu",EXTRA)
Config_String(USER_MENU,"Java&Tools")
}
Then use a macro like the following (perhaps executed via
USTARTUP.VDM) to fill the Buffer-switch event macro:
Reg_Set(114,`//Buffer Switch event macro
Reg_Set(120,EXT_ONLY)
if ( Reg_Compare(120, "vdm") == 0) {
if ( File_Exist("|(HOME)/vedit.mnu",NOERR) ) {
Reg_Load(124,"|(HOME)/vedit.mnu",EXTRA)
Config_String(USER_MENU,"Vedit&Tools")
}
} else {
if ( Reg_Compare(120, "java") == 0) {
if ( File_Exist("|(HOME)/java-sdk.mnu",NOERR) ) {
Reg_Load(124,"|(HOME)/java-sdk.mnu",EXTRA)
Config_String(USER_MENU,"Java&Tools")
}
}}
`) //End of the Reg_Set(114,... command above
That should do the trick.
Christian