Project

General

Profile

Bug #3631

SYSTEM-DIALOG FONT won't accept keyboard input in the selection lists

Added by Hynek Cihlar almost 6 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Alexei Kaigorodov
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:

bug3631-system-dialog-font.p Magnifier (561 Bytes) Alexei Kaigorodov, 05/08/2019 03:59 AM

11312.diff Magnifier (602 Bytes) Alexei Kaigorodov, 05/29/2019 09:24 AM

History

#1 Updated by Greg Shah about 5 years ago

  • Assignee set to Alexei Kaigorodov

#2 Updated by Alexei Kaigorodov almost 5 years ago

A test file (attached) runs successfully under FWD (revision 11304).
Keyboard input is accepted, though after moving focus to the input field labelled "Font:".

So the bug description can be changed to:

SYSTEM-DIALOG FONT window does not set focus on "Font:" field, while it does when running on 4gl.

#3 Updated by Greg Shah almost 5 years ago

If you manually put focus into a selection list, does it accept keyboard input?

#4 Updated by Alexei Kaigorodov almost 5 years ago

If focus manually is pointed into the selection list, keyboard input is possible.

#5 Updated by Greg Shah almost 5 years ago

Please work on the initial focus issue. The dialog is implemented in com/goldencode/p2j/ui/client/gui/FontChooserGuiImpl.java and it is created in ThinClient.chooseFont().

#6 Updated by Alexei Kaigorodov almost 5 years ago

The font chooser is implemented in the class FontChooserGuiImpl, field ComboBoxGuiImpl fontFaceCbx. But ComboBoxGuiImpl is not a Swing class, and we cannot force it to grab the focus. It is unclear where to find creation of the corresponding Swing component, and how to make it to request the focus.

#7 Updated by Hynek Cihlar almost 5 years ago

Alexei Kaigorodov wrote:

The font chooser is implemented in the class FontChooserGuiImpl, field ComboBoxGuiImpl fontFaceCbx. But ComboBoxGuiImpl is not a Swing class, and we cannot force it to grab the focus. It is unclear where to find creation of the corresponding Swing component, and how to make it to request the focus.

As you already figured out, the legacy widgets (i.e. subclasses of AbstractWidget) don't have direct mapping to the Swing components. We handle all the drawing and UI flow ourselves. What Swing (or Web browser in case of Web client) provides to us is only a window component and its graphic context.

For focus handling see AbstractContainer.setFocus and how the method is used. Also see UiUtils.getCurrentFocus() (and its overloads), this method is often used during dispatching of input events.

#8 Updated by Alexei Kaigorodov almost 5 years ago

Fixed in branch secure/code/p2j_repo/p2j/active/3631a, revision 11312.
Diff file attached.
Please review.

#9 Updated by Hynek Cihlar almost 5 years ago

Alexei Kaigorodov wrote:

Fixed in branch secure/code/p2j_repo/p2j/active/3631a, revision 11312.
Diff file attached.
Please review.

Code review 3631a 11312.

The change is good. Only a small modification. Instead of requestFocus() on the combo box widget, call setFocus() on the FontChooserGuiImpl class and pass in the combo box widget. We want to avoid requestFocus() in this case as it triggers legacy focus events.

#10 Updated by Alexei Kaigorodov almost 5 years ago

setFocus(fontFaceCbx); has no visible effect - focus is not set to the combobox.

#11 Updated by Hynek Cihlar almost 5 years ago

Alexei Kaigorodov wrote:

setFocus(fontFaceCbx); has no visible effect - focus is not set to the combobox.

I didn't give you a complete answer, sorry. You have to call setFocus() on the container to which the combo box belongs. So not directly to the frame, but to its "content" container. getContentPane().setFocus(fontFaceCbx); will resolve the issue.

#12 Updated by Alexei Kaigorodov almost 5 years ago

Hynek Cihlar wrote:

I didn't give you a complete answer, sorry. You have to call setFocus() on the container to which the combo box belongs. So not directly to the frame, but to its "content" container. getContentPane().setFocus(fontFaceCbx); will resolve the issue.

Done. Tested. Commited to secure/code/p2j_repo/p2j/active/3631a.

#13 Updated by Alexei Kaigorodov almost 5 years ago

Please review.

#14 Updated by Hynek Cihlar almost 5 years ago

Code review 3631a revision 11311.

The code changes are OK. The changed file is missing history entry.

#15 Updated by Alexei Kaigorodov almost 5 years ago

Description added. Commited to secure/code/p2j_repo/p2j/active/3631a rev 11314

#16 Updated by Hynek Cihlar almost 5 years ago

Alexei Kaigorodov wrote:

Description added. Commited to secure/code/p2j_repo/p2j/active/3631a rev 11314

Also please update the Copyright year.

#17 Updated by Alexei Kaigorodov almost 5 years ago

Updated.

#18 Updated by Hynek Cihlar almost 5 years ago

Code review 3631a. The changes are good, no regression testing is required.

#19 Updated by Greg Shah almost 5 years ago

I made a small edit to remove the reference to OE (it is a trademark) and instead I used the more generic "4GL".

#20 Updated by Greg Shah almost 5 years ago

Please go ahead and merge 3631a revision 11316 (this is with my changes) into the trunk. Follow the instructions (in our Source Management document) exactly. If you have any questions, do not move ahead until we've discussed them. If you understand the instructions, then you can go ahead.

#21 Updated by Alexei Kaigorodov almost 5 years ago

I made a local branch which has revision 11311 (the same as trunk) and 5 small commits after that.
then I made bzr merge to get the changes from my branch back into the source repo (as it is said in the Source_Code_Management document, chapter "How Branching Works", point 10). But instead of expected effect "11. the resulting change will go back into the trunk as a single revision, even if you had 50 branch-specific commits", the reply was:
"Nothing to do."
what am I doing wrong?

#22 Updated by Hynek Cihlar almost 5 years ago

Alexei Kaigorodov wrote:

I made a local branch which has revision 11311 (the same as trunk) and 5 small commits after that.
then I made bzr merge to get the changes from my branch back into the source repo (as it is said in the Source_Code_Management document, chapter "How Branching Works", point 10). But instead of expected effect "11. the resulting change will go back into the trunk as a single revision, even if you had 50 branch-specific commits", the reply was:
"Nothing to do."
what am I doing wrong?

Are you trying to merge the task branch in trunk? If so, follow Merge Back and Commit to the Trunk.

#23 Updated by Alexei Kaigorodov almost 5 years ago

3631a was merged to trunk rev 11312 and was archived.

#24 Updated by Greg Shah almost 5 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF