From: <ah...@us...> - 2006-10-10 17:05:06
|
Revision: 10967 http://svn.sourceforge.net/jvcl/?rev=10967&view=rev Author: ahuser Date: 2006-10-10 10:04:53 -0700 (Tue, 10 Oct 2006) Log Message: ----------- Fixed ReadOnly requires window handle and the ReadOnly style is lost when the handle is recreated. Modified Paths: -------------- trunk/jvcl/run/JvEditorCommon.pas Modified: trunk/jvcl/run/JvEditorCommon.pas =================================================================== --- trunk/jvcl/run/JvEditorCommon.pas 2006-10-09 08:39:25 UTC (rev 10966) +++ trunk/jvcl/run/JvEditorCommon.pas 2006-10-10 17:04:53 UTC (rev 10967) @@ -3177,6 +3177,11 @@ ExStyle := ExStyle or WS_EX_CLIENTEDGE; end; WindowClass.style := WindowClass.style and not (CS_HREDRAW or CS_VREDRAW); + + if ReadOnly then + Style := Style or ES_READONLY + else + Style := Style and not ES_READONLY; end; end; @@ -3775,10 +3780,13 @@ else {1 :} begin {$IFDEF VCL} - if Value then - SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) or ES_READONLY) - else - SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) and not ES_READONLY); + if HandleAllocated then + begin + if Value then + SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) or ES_READONLY) + else + SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) and not ES_READONLY); + end; {$ENDIF VCL} if FReadOnly <> Value then begin This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |