Bug #10875
COMBO-BOX: Ctrl-UP and Ctrl-DOWN keys do nothing
100%
Related issues
History
#1 Updated by Vladimir Tsichevski 8 months ago
- Related to Bug #10801: COMBO-BOX issues added
#2 Updated by Vladimir Tsichevski 8 months ago
Run the following example in GUI mode:
DEFINE VARIABLE cb AS CHARACTER VIEW-AS COMBO-BOX LIST-ITEMS "a12", "b34", "c56" SIMPLE SIZE 40 BY 5 NO-UNDO. DEFINE FRAME f cb NO-LABEL. ENABLE ALL WITH FRAME f. WAIT-FOR CLOSE OF CURRENT-WINDOW.
In this example, a frame with a COMBO-BOX of SIMPLE type is created and enabled.
Press the Ctrl-UP and Ctrl-DOWN keys.
In OE: These key combinations act the same as the keys without the Ctrl modifier: they select the next and previous items in the list.
In FWD: These key combinations do nothing but remove selection.
#8 Updated by Delia Mitric 4 months ago
- % Done changed from 0 to 50
Committed some changes for GUI issue: 10875a branch rev. 16478.
Added functionality for CTRL_UP and CTRL_DOWN combos.
While testing, found that there is a little problem (in trunk) when we press CTRL_LEFT/CTRL_RIGHT in the combo-box and after that, we press UP/DOWN OR CTRL_UP/CTRL_DOWN.
The desired behavior is to select the previous/next item in the list, but the current behavior is to re-select the current item. Again, this happens just after we "play" with CTRL_LEFT/CTRL_RIGHT keys. Maybe this issue can be treated separately because it is about CTRL_LEFT/CTRL_RIGHT behavior.
#9 Updated by Delia Mitric 4 months ago
- % Done changed from 50 to 100
- Status changed from WIP to Review
Created a new issue in User Interface for CTRL + UP/DOWN events behavior in ChUI mode because in FWD they don't work properly: #11319
The solution for current issue is committed to 10875 rev. 16478.
Hynek, please review. Thanks!
#10 Updated by Hynek Cihlar 4 months ago
- Status changed from Review to WIP
- % Done changed from 100 to 90
Code review 10875a.
DefaultList history header format error. The new history entry reads * 016 DMM 20260320 but should read ** 016 DMM 20260320 (two asterisks, one space, matching the format of all preceding entries).
DefaultList: duplicate switch cases could use fall-through. In DefaultList.processKey, the new Key.VK_CTRL_CURSOR_DOWN case is identical to the existing Key.VK_CURSOR_DOWN case (both set delta = 1), and likewise Key.VK_CTRL_CURSOR_UP duplicates Key.VK_CURSOR_UP (delta = -1). These should use case fall-through instead of duplicating the body:
case Key.VK_CURSOR_DOWN :
case Key.VK_CTRL_CURSOR_DOWN :
delta = 1;
break;
ComboBoxGuiImpl.processSystemKey: action code vs. key code mismatch and incorrect handling in DROP-DOWN/DROP-DOWN-LIST modes. The variable key is assigned from keyEvent.actionCode() (line 761), which returns Keyboard.KA_* action codes. The guard condition at line 764 correctly compares key against Keyboard.KA_* constants, but the new addition compares key against Key.VK_CTRL_CURSOR_DOWN and Key.VK_CTRL_CURSOR_UP, which are key codes (values 2549 and 2550 from Key.java) from a different numeric space. Should the Ctrl+UP/DOWN handling be also added to DROP-DOWN and DROP-DOWN-LIST modes? Currently it is not.
#11 Updated by Delia Mitric 4 months ago
- % Done changed from 90 to 100
- Status changed from WIP to Review
- the history entry
- the new addition from
ComboBoxGuiImpl.processSystemKeyby using the key code, not the action code - the duplicate code from
DefaultList.processKey
Added CTRL + UP/DOWN handling also for DROP-DOWN / DROP-DOWN-LIST COMBO-BOX options.
(All changes for GUI mode)
This is a testcase that contains different types of combo-box:
def var c1 as character view-as combo-box list-items "1", "2", "3", "4", "5", "6", "7", "8", "9" drop-down-list inner-lines 4.
def var c2 as character view-as combo-box list-items "11", "12", "13", "14", "15", "16", "17", "18", "19" simple inner-lines 4 size 12 by 4.
def var c3 as character view-as combo-box list-items "1", "2", "3", "4", "5", "6", "7", "8", "9" drop-down inner-lines 4 size 12 by 4.
def frame f
c1 at row 1 col 1
c2 at row 1 col 20
c3 at row 1 col 40
WITH SIDE-LABELS.
c1:screen-value = "1".
c2:screen-value = "12".
c3:screen-value = "8".
enable all with frame f.
wait-for window-close of current-window.
Committed to *10875a rev. 16479 *.
Please review.
#12 Updated by Hynek Cihlar 4 months ago
- Status changed from Review to Internal Test
Code review 10875a. The changes look good. Please regression test the changes, also include ChUI regression tests.
#14 Updated by Razvan-Nicolae Chichirau 3 months ago
ChUI regression tests passed with 10875a.
#16 Updated by Radu Apetrii 3 months ago
- Status changed from Internal Test to Merge Pending
I think this is good. 10875a can be merged right now.