Locking TextAreas
BlitzPlus Forums/BlitzPlus Programming/Locking TextAreas| 
 | ||
| The latest update broke the application I was working on, be it minorly. I had multiple text areas on my window and to keep users from being able to edit the information inside I used DisabledGadget on them. All was well. 1.34 implements correct behavior and actually greys out disabled text areas where before they appeared normal. Now my text areas are uneditable but look disabled. LockTextArea and UnlockTextArea are used for fast textarea operations (?) just like locked buffers. I tryed changing the color of my textarea back to normal after disabling it but only the Text color changes... this is probably a bug as well. My question is how do I keep users from editing my text area without disabling it? | 
| 
 | ||
| Eek! Forgot about this... Will add a readonly style command for next update. | 
| 
 | ||
| Thanks for the speedy response | 
| 
 | ||
| In the meantime, Eikon, nullmind posted this on Blitzcoder: 
; lib "user32.dll"
; SendMessage%(hWnd%,Msg%,wParam%,lParam%):"SendMessageA"
Const EM_SETREADONLY = $CF
Global win=CreateWindow("Readonly textbox",64,64,320,240)
Global Txt=CreateTextArea(0,0,1,1,win)
SendMessage QueryObject(Txt,1),EM_SETREADONLY,True,0
 | 
| 
 | ||
| Try to enable/disable 'LockTextArea'. I see no different. The flickring is still there and no major speed increase. Anything wrong to this code or 'LockTextArea' not really work? 
win=CreateWindow ("",0,0,300,300) 
txtbox=CreateTextArea(0,0,200,200,win)  
For k=0 To 200
	For KK=0 To 30
		A$=A$+Chr$(Rand (33,126))
	Next
	A$=A$+Chr$(13)
Next
SetGadgetText txtbox,A$  
gt=CreateButton("Color It",200,0,80,20,win)
Repeat 
id=WaitEvent() 
If id=$803 Then End 
If id=$401 And EventSource()=gt Then   
LockTextArea txtbox ;<--Try disable/enable this and see 
For k=0 To 200
	For KK=0 To 30
		FormatTextAreaText txtbox,Rand(1,255),Rand(1,255),Rand(1,255),Rand(0,3),(k*32)+kk,3,1 
Next
Next
UnlockTextArea txtbox ;<---UNLOCK BACK
End If 
Forever  
 | 
| 
 | ||
| Hopefully that readonly format will come in the next update as .35 was only bug fixes. That code works good for now. Thx CS/Null. |