comparison src/org/tn5250j/framework/tn5250/Screen5250.java @ 186:61a90cb1938d

setfield positions the cursor properly as if the characters were typed
author Carl Byington <carl@five-ten-sg.com>
date Wed, 02 Jul 2014 15:03:06 -0700
parents c51bcf9f0516
children 81f9ba83c0e9
comparison
equal deleted inserted replaced
185:c51bcf9f0516 186:61a90cb1938d
2659 public void setField(int l, int c, char [] data) { 2659 public void setField(int l, int c, char [] data) {
2660 ScreenField cf; 2660 ScreenField cf;
2661 2661
2662 if (l >= 0) { 2662 if (l >= 0) {
2663 int position = l * numCols + c; 2663 int position = l * numCols + c;
2664 isInField(position, true); 2664 if (!isInField(position, true)) {
2665 cf = screenFields.getCurrentField(); 2665 gotoFieldNext();
2666 lastPos = cf.getStartPos(); 2666 isInField();
2667 cf = screenFields.getCurrentField();
2668 lastPos = cf.getStartPos();
2669 }
2670 else {
2671 lastPos = position;
2672 }
2667 setDirty(lastPos); 2673 setDirty(lastPos);
2668 fireCursorChanged(); 2674 fireCursorChanged();
2669 } 2675 }
2670 2676
2671 if ((data != null) && (data.length > 0)) { 2677 if ((data != null) && (data.length > 0)) {