TextArea, RowCanvas

Henk Blik hjblik at dds.nl
Thu Jan 28 05:56:03 PST 1999


I am using kaffe-1.0.b3 on a NCR mp-ras system an ran into some problems
using the TextArea.

1. Missing newline after an insert of a line, I fixedit using a mail
from the archive

2. setCaretPosition after determing the position by searching in the
text placed the caret at a wrong postion because the (virtual) newlines
were not counted in TextArea. Visa Versa give te getCaretPosition a
wrong offset in the text string

3. It is possible a non editable TextArea to insert tabs and newlines
and to delete characters.

4. Vertical scrolling the text in a TextArea using the scrollbar, the
page-up/down or cursor-up/down keys caused overwritting of area outside
the text area, this was caused by the rgr.copyArea in RowCanvas

I fixed all these problems for myself and send you de diff -e output for
TextArea.java and RowCanvas.java. I hope these fixes will be of some use
in the further development of kaffe. If there are any questions or if
you need othe diff output don't hesitate to concact me.


Henk Blik
-------------- next part --------------
	if ( i0 <= n ){
		        if ( ! isEditable)
		        if ( ! isEditable)
		        if ( ! isEditable)
		    if ( ! isEditable)  // hjb 01-27-1999: do nothing for TAB,
			break;          // ENTER, DEL and BS if not editable
		pos --;  // hjb 01-27-1999: substract 1 for the virtual newline
		xt ++;  // hjb 01-27-1999: count the virtual newline
-------------- next part --------------
	// hjb, 01-28-1999: only move the area that will fall in
	// pane after the copy.
	// otherwise text is displayed above or under the pane
	// obscuring the scrollbar and/or other fields
	if (rows < 0)
	    rgr.copyArea( d, d + rows * rowHeight, width- 2*d, height- 2*d,
			  0, rows * rowHeight );
	    rgr.copyArea( d, d, width- 2*d, height- 2*d - rows * rowHeight,
			  0, rows * rowHeight );

More information about the kaffe mailing list