[Thinlet-development] thinlet/src/java/thinlet Thinlet.java,1.10,1.11
Brought to you by:
bajzat
From: Andrzej B. <ab...@us...> - 2004-06-07 23:23:17
|
Update of /cvsroot/thinlet/thinlet/src/java/thinlet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8873 Modified Files: Thinlet.java Log Message: Several fixes submitted by Michael Nascimento Santos: "The following patch should solve the following problems: - While using a Thinlet application with a keyboard and doing dynamic removal/addition of components, such as rows, the app may halt when a key is pressed inside some components (eg. table, when all the rows are removed and some are added later); - Invoking an action using the keyboard does not focus the current component as expected." Thank you! Index: Thinlet.java =================================================================== RCS file: /cvsroot/thinlet/thinlet/src/java/thinlet/Thinlet.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Thinlet.java 7 Jun 2004 23:08:24 -0000 1.10 +++ Thinlet.java 7 Jun 2004 23:23:07 -0000 1.11 @@ -2136,6 +2136,9 @@ } else { //if (("list" == classname) || ("table" == classname) || ("tree" == classname)) Object lead = get(component, ":lead"); + if (getIndex(component, lead) == -1) { + set(component, ":lead", lead = null); + } int[] columnwidths = ("table" == classname) ? ((int []) get(component, ":widths")) : null; boolean line = getBoolean(component, "line", true); int iline = line ? 1 : 0; boolean angle = ("tree" == classname) && getBoolean(component, "angle", false); @@ -3278,6 +3281,9 @@ (keycode == KeyEvent.VK_PAGE_DOWN) || (keycode == KeyEvent.VK_HOME) || (keycode == KeyEvent.VK_END)) { Object lead = get(component, ":lead"); + if (getIndex(component, lead) == -1) { + set(component, ":lead", lead = null); + } Object row = getListItem(component, component, keycode, lead, recursive); if (row != null) { String selection = getString(component, "selection", "single"); @@ -4284,6 +4290,8 @@ private boolean invoke(Object component, Object part, String event) { Object method = get(component, event); if (method != null) { + if (focusowner != null && "action".equals(event)) + requestFocus(component); invokeImpl(method, part); return true; } |