[Bf-committers] DELKEY in textbox bug fixed.

Daniel Fairhead bf-committers@blender.org
Tue, 6 Jan 2004 21:20:02 +0200


This is a multi-part message in MIME format.

--Multipart=_Tue__6_Jan_2004_21_20_02_+0200_OBJ2ZIiLlE16ZXOl
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Hi,

Here is a small patch to fix the bug with using the DEL key in a text box.
The patch firstly moves the test to see if the ascii code is an alphanumeric
into mainqueue.c (function mainqread), this means the "if (ascii)" check now
works. It also adds in a missing "break;" after the DELKEY event in interface.c
I hope this patch works.

Dan
PS - My first bf-blender patch!

--Multipart=_Tue__6_Jan_2004_21_20_02_+0200_OBJ2ZIiLlE16ZXOl
Content-Type: text/x-diff;
 name="delkey-in-textbox.patch"
Content-Disposition: attachment;
 filename="delkey-in-textbox.patch"
Content-Transfer-Encoding: 7bit

Index: source/blender/src/interface.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/interface.c,v
retrieving revision 1.98
diff -B -r1.98 interface.c
1186,1195c1186,1193
< 			if( ascii>31 && ascii<127) {
< 				if(len < but->max) {
< 					for(x= but->max; x>but->pos; x--)
< 						str[x]= str[x-1];
< 					str[but->pos]= ascii;
< 					but->pos++; 
< 					len++;
< 					str[len]= '\0';
< 					dodraw= 1;
< 				}
---
> 			if(len < but->max) {
> 				for(x= but->max; x>but->pos; x--)
> 					str[x]= str[x-1];
> 				str[but->pos]= ascii;
> 				but->pos++; 
> 				len++;
> 				str[len]= '\0';
> 				dodraw= 1;
1236a1235
> 				break;
Index: source/blender/src/mainqueue.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/mainqueue.c,v
retrieving revision 1.6
diff -B -r1.6 mainqueue.c
59a60
> 		if((*ascii<30)||(*ascii>126)) *ascii=0;

--Multipart=_Tue__6_Jan_2004_21_20_02_+0200_OBJ2ZIiLlE16ZXOl--