|
On 13/12/2005, at 3:57 AM, Charles St-Laurent wrote:
Hi!I designed a window with a single choice list of 3 elements, and a button "OK" at the bottom of the window. If the user clicks on an element of my single choice list, everithing works fine. But if he positions the cursor onan element of the list and then push the OK button, my program does notreceive any selection. I also tried to use the CHCCTL to get the selection but it does not work if the user hightlights an element of my list and thenpush the OK button...Any suggestion to get the item that is highlighted when the user push the OKbutton? Here's a short piece of my display file code:A F12 2Y 0B 6 8SNGCHCFLD(*RSTCSR *AUTOSLT *NOSLTIN-A D *AUTOENT) A CHOICE(1 'Choice 1') A CHOICE(2 'Choice 2') A CHOICE(3 'Choice 3') A CHCCTL(1 &FLD03) A CHCCTL(2 &FLD04) A CHCCTL(3 &FLD10) A F13 2Y 0B 10 32PSHBTNFLD A PSHBTNCHC(1 'OK' ENTER) A FLD03 1Y 0H A FLD04 1Y 0H A FLD10 1Y 0H
You can't do what you are trying to accomplish with this definition.Firstly, CHCCTL only indicates a selected value for MLTCHCFLD fields. For SNGCHCFLD the CHCCTL only sets whether available or not. F12 will contain the number of the selected field. If you want to indicate pre-selected fields then for SNGCHCFLD you have to set the real field value (in this case F12 to 1). For MLTCHCFLD you set the various CHCCTL fields instead.
Secondly, the reason clicking OK doesn't indicate a selection is because no selection was made. You moved the cursor to an item and it was reverse-imaged to show you where the cursor is but that item is not selected. It won't be selected until you press the space bar (or click the item with the mouse) at which point it will change from reverse-image to highlight. Because you have defined *AUTOENT the act of selecting also issues Enter and the user never gets a chance to click OK.
If you remove *AUTOENT then the user can click the menu item to select it (or move the arrow keys and press the spacebar) and then click OK to send the selection to your program. They will have to use two mouse clicks to accomplish this. They will no longer be able to automatically select and submit using a single mouse click however if you enable "ENTER at cursor position" in "Hotspots Setup" in PC5250 then double-clicking an item will select it and send Enter to the application.
*AUTOSLT will still allow selection by moving the cursor and pressing Enter because *AUTOSLT means automatically select the item if the cursor is on the item when Enter is pressed.
Regards, Simon Coulter. -------------------------------------------------------------------- FlyByNight Software AS/400 Technical Specialists http://www.flybynight.com.au/ Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\ Fax: +61 3 9419 0175 \ / X ASCII Ribbon campaign against HTML E-Mail / \ --------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.