Midrange News for the IBM i Community


Posted by: Viking
Information Systems
CA
CSRLOC with MOUBTN
has no ratings.
Published: 07 Dec 2012
Revised: 23 Jan 2013 - 1765 days ago
Last viewed on: 23 Nov 2017 (3941 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

CSRLOC with MOUBTN Published by: Viking on 07 Dec 2012 view comments(3)

I've got a green screen that uses RTNCSRLOC and CSRLOC and Infds to put the cursor back to the field where the user was when they hit F4 to prompt and a selection window was presented.  This works perfectly when the user uses the keyboard to select the value in the selection window, but if they select the value by clicking the mouse (the window has MOUBTN) the value is returned but the cursor stays in the same position it was when the window was up, i.e. not where they were when they hit F4.

Any ideas for how to deal with this?

Thanks.

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: neilrh
Premium member *
Jackson, MI
Comment on: CSRLOC with MOUBTN
Posted: 4 years 11 months 16 days 22 hours 43 minutes ago

I've had a lot of issues with Mouse Button usage on green screen. A lot of it seems to be tied to the emulator you're using. For example adding mouse button sensitivity stopped the functioning of drag a square on screen for purpose of cut and paste. In some cases the windows O/S mouse use would override the green screen function. Sometimes they would both happen causing much distress to our users.

In the end we just pulled out the mouse select functionality because it caused more problems than it fixed. Sorry I cannot be more help.

Posted by: Viking
Premium member *
CA
Comment on: CSRLOC with MOUBTN
Posted: 4 years 11 months 16 days 22 hours 3 minutes ago

Oddly, I now have it working correctly but don't quite understand why it works...

 

Defining MOUBTN(*ULP *ULR CF09) instead of MOUBTN(*ULP CF09), i.e. with both *ULP and *ULR instead of just *ULP fixed my problem!  I don't quite understand why but now the cursor goes back to whatever field it came from whether I select with the keyboard or the mouse!

I found an old post where Lynne Noll said something about ULP being the first of a two-stage event or something and had suggested this solution for a different issue.

Posted by: Viking
Premium member *
CA
Comment on: CSRLOC with MOUBTN
Posted: 4 years 11 months 16 days 19 hours 59 minutes ago
Edited: Mon, 10 Dec, 2012 at 11:45:40 (1809 days ago)

Everything is working fine - thanks.