How do I customize the mouse's right-click menu? That is, instead of Cut, Copy, Paste, Select All, Delete in Edit-Masks, etc., I would like to display my custom menu, which includes Save, Refresh, etc.
In order to have your own custom menus you need to define the menu in the normal manner through the menu painter. Alternatively, you can use a sub-menu from your Sheets menu. (This is the option that most people choose.)
Then use the PopMenu function to display the menu when the user clicks the right mouse button. To achieve this, you need to add a script such as this to the rbuttondown event:
lm_M = parent.menuid
PopMenu( lm_M.m_menutoshow, w_mdiframe.PointerX(), w_mdiframe.PointerY() )