From: Lennart P. <le...@us...> - 2005-02-20 11:02:28
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6220/src/org/redpos/client/ui/plugin/function Modified Files: ConfirmActionUI.java Log Message: Added dispose when leaving by pressing SWT.ESC Index: ConfirmActionUI.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function/ConfirmActionUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ConfirmActionUI.java 23 Nov 2004 16:02:27 -0000 1.1 --- ConfirmActionUI.java 20 Feb 2005 11:02:16 -0000 1.2 *************** *** 113,116 **** --- 113,117 ---- } + } /** * Inits this class *************** *** 188,191 **** --- 189,197 ---- if(e.keyCode == SWT.ARROW_LEFT || e.keyCode == SWT.ARROW_RIGHT) noButton.setFocus(); + else if(e.character == SWT.ESC) + { + listener.selectionMade(ConfirmActionUI.NO_OPTION); + selectionMade = true; + } } }; *************** *** 204,207 **** --- 210,218 ---- if(e.keyCode == SWT.ARROW_LEFT || e.keyCode == SWT.ARROW_RIGHT) yesButton.setFocus(); + else if(e.character == SWT.ESC) + { + listener.selectionMade(ConfirmActionUI.NO_OPTION); + selectionMade = true; + } } }; *************** *** 252,255 **** --- 263,278 ---- okButton.addListener(SWT.Selection, buttonListener); + KeyListener okButtonKeyListener = new KeyAdapter() + { + public void keyPressed(KeyEvent e) + { + if(e.character == SWT.ESC) + { + listener.selectionMade(ConfirmActionUI.OK_OPTION); + } + } + }; + okButton.addKeyListener(okButtonKeyListener); + okButton.setFocus(); |