View previous topic :: View next topic |
Author |
Message |
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Mon Mar 09, 2015 3:36 pm Post subject: %pm question |
|
|
I'm wondering if this is possible.
I'd like to allow a popup menu to appear, using the right click. And, since the operations in the menu will be context sensitive, I need to know the location within the window that the user right-clicked.
I am using a Text Array, and have tried the CLEARWIN_INFO@ strings for reading the mouse state and position for Text Array, and have tried the Graphics Window strings as well. But no mouse click was sensed.
I suspect that the Mouse has already been read and cleared by the invocation of the popup menu.
I am able to intercept the left mouse click state and position of the mouse cursor just fine.
I'm thinking I may have to implement my own Window creation similar to the popup menu, then process the user selection from that window, bypassing the popup menu capability entirely.
Would appreciate suggestions and comments!
Bill |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Mon Mar 09, 2015 5:06 pm Post subject: |
|
|
The ClearWin+ way to create a context sensitive %pm is to use %nw as described in the document cwplus.enh item 341.
Use %lc immediately after the relevant control to get hwnd for the control.
Use this value of hwnd in a %sc callback function (cbfunc say).
In cbfunc write
i = winio@("%nw&",hwnd)
i = winio@("%pm.....
and construct %pm in the usual way. |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Mon Mar 09, 2015 5:22 pm Post subject: |
|
|
Thanks very much, Paul! I'll give it a go! |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Wed Mar 11, 2015 4:03 pm Post subject: |
|
|
Paul, it would appear that because the only control in the window is my text_array, this will not work. I can't specify a %nw for each clickable field in the text array. The right-click works (generally) just fine, and I'll use that based on the last user selected field. For the expanded features, I'll have to implement a different solution.
Still, a nice feature that I may be able to use in the new solution.
Thanks for supplying this. I'd have never discovered that on my own!
Bill |
|
Back to top |
|
|
|