popup menu selection-list item

Posted by Arno van der Ende on 06-Apr-2014 15:44

Hi,

I would like to enable a popup (context) menu for an item of a OE selection-list. The problem is, that I can click anywhere in the selection-list which shows me the attached popup-menu. 

But I would like to know on which item I 'right-mouse-clicked'. But the MOUSE-MENU-CLICK does not activate the item 'clicked'. Is it possbile to first 'apply the Nth entry' of the the selection-list and then show the popup? How to know on which item (Nth) I have pressed?

Is this even possible? If yes, how? 

Thanks

Arno

Posted by Stefan Drissen on 07-Apr-2014 02:13

Even when using a browse you need to grab the X and Y of the last mouse event (or so) and compare them to the X and Y of the browse widget and the height in pixels of a browse row.

A similar method may work for the selection list.

Posted by Arno van der Ende on 07-Apr-2014 05:34

Ok, not ideal, but with the X and Y coordinates and the Windows api to open a menu automatically I'm able to get it working.

RUN SendMessageA (selectionlist:HWND, 517, 0, 0, OUTPUT iReturn).

All Replies

Posted by Dileep Dasa on 07-Apr-2014 01:20

This is not possible.

POPUP-MENU is associated with a widget but not with an item in the widget.

In general, a selection list is only used to select one or more items.

Posted by Arno van der Ende on 07-Apr-2014 01:28

Yes, thank you Dileep. But do you know if it is possibly to apply a left-mouse-click when I do a right-mouse-click somehow?

Perhaps then I could get something working. Or I should rewrite the program to use a browse instead of selection list.

Posted by Stefan Drissen on 07-Apr-2014 02:13

Even when using a browse you need to grab the X and Y of the last mouse event (or so) and compare them to the X and Y of the browse widget and the height in pixels of a browse row.

A similar method may work for the selection list.

Posted by Arno van der Ende on 07-Apr-2014 04:24

Ok, that might work Stefan, thank you. Since I will override the default behavior of the 'right-mouse-click', I need to open the popup menu programmatically. Do you know if that's possible?

Posted by Arno van der Ende on 07-Apr-2014 05:34

Ok, not ideal, but with the X and Y coordinates and the Windows api to open a menu automatically I'm able to get it working.

RUN SendMessageA (selectionlist:HWND, 517, 0, 0, OUTPUT iReturn).

This thread is closed