Applies to: any Clarion window; the thread names no version. Posted in the softvelocity.clarion.templates newsgroup.
Problem
The user wants a button that looks like a normal Clarion button, icon included, and that opens a menu with an icon on every item when clicked, similar to the Find button in MS Word. It should work anywhere on a form or other window. He was ready to buy a product for it.
Solution
- No template is needed; use POPUP in the button's embed. Three posters gave this answer, one with the item syntax:
POPUP('[' & PROP:Icon & '(MyIco.ICO)]MenuChoice')
- POPUP takes screen coordinates by default, not window coordinates like control positions. To open the menu below the button, convert the control position with the ClientToScreen API (with the window in pixel mode), add the control height to Y, and pass the result:
POPUP('Whatever', X, Y). One poster's utility method does this and was shown in outline. - A simpler way: POPUP has a fourth parameter, position. A BYTE set to 1 treats the second and third parameters as relative to the upper left corner of the active window's client area; 0, the default, means screen coordinates.
- A third-party product was also named as a ready-made button with a menu.
Caveats
- Option 2 needs the API call and the pixel-mode switch; restore the window's previous pixel setting afterwards.
- The thread does not say which Clarion version first had the fourth parameter; a poster said it had been there a long time.
- The original poster wrote "Just what I needed" without detailing which option he used.
Today (2026)
The POPUP position parameter is in the language reference; likely unchanged, not re-tested here.
Sources: Michael G. (Dec 2016, the question), Peter W., Sean H., Andre L., Arnor B. (Dec 2016), Lee W. (Jan 2017) in softvelocity.clarion.templates.