This is kinda raw, but it does demonstrate how to dynamically create popup 
menus based upon the context of the right mouse button location.

I noticed as I was looking at it that this version does not free the popup 
menu after it is done.  This, of course, needs to be taken care of.  The 
final product, incorporated into the current project I am working on, makes
sure the TmenuPopUp variable is nil when not in use, and frees it whenever
the popup operation is completed, via a common function call from each of the
click handlers.

Other changes:

The context sensing does not use the ActiveControl form property any
more.  Note that you cannot use the SENDER variable passed to the click
handler, since that is the TPopUpMenu, NOT the control that triggered the
right click.

Also, the conversion to and from client coords can get tricky.  Notice in 
this version that the popup menu appears relatively far away from the button
when right clicked, yet is close to the other components like the listbox 
and the outline.  It threw me for a little while when I first coded this, 
since the help does not indicate that the X,Y coords passed in the TMenuPopUp.PopUp 
event are SCREEN coords, not component coords.

Thomas Hill
hillt@ionet.net, or
hillt@sill-emh.army.mil
