///////////////////////////////////////////////////////////////////////// // MenuItem.cs // // Written by Lynn Selin, Century Software // Last modified 1/3/2000 // // This script demonstrates how the user can add to the TinyTERM menu // structure. Running it will add a menu item "User Cmd" to the "Help" // // // Also Included is the Code that is run when the Menu Item is selected. // ////////////////////////////////////////////////////////////////////////// #define MENU_USER_CMD 8000 // Insert First Time // The following Function is called only this script is run RemoveMenuItem(GetFrameMenu(Frame),MENU_USER_CMD,0); InsertMenuItem(GetSubMenu(GetFrameMenu(Frame), 5), 1,0, MENU_USER_CMD, "User Cmd"); // Frame is the Object created for the TT frame // 5 is the 5th Item on the menu bar or "Help" // MENU_USER_CMD must be Unique from other assigned menu Items. // "User Cmd" is the Label that will be put in the Help Menu Item ///////////////////////-------Beginning of User_Modify_Menu------------- // The function is Called Everytime the Menu Bar is Refreshed function User_Modify_Menu() // Insert When Refreshed { RemoveMenuItem(GetFrameMenu(Frame),MENU_USER_CMD,0); InsertMenuItem(GetSubMenu(GetFrameMenu(Frame), 5), 1,0, MENU_USER_CMD, "User Cmd"); // For Parameters see above } // User_Modify_Menu /////////////////////////----End of User_Modify_Menu--------- //////////////////////______Beginning of Process_User_Menu() ________ // This function is called when any item in the Help menu is selected function Process_User_Menu(FrameObj, oCtl, nMsg, nCode) { if (nCode == MENU_USER_CMD) { //////////// THE FOLLOWING CODE WILL BE RUN WHEN "User Cmd" is selected //////////// from the "Help" Item on the Main Menu Bar //////////// INSERT YOUR OWN CODE FROM HERE ////////////////// msgbox ("Run Function Here","Your Code",0); //////////// TO HERE ///////////////////////////////////////// return(1); } return (0); } // Process_User_Menu //////////////----------End of Process_User_Menu() ______________________