Página 1 de 1

TEdit

Publicado: Vie Feb 21, 2014 9:42 am
por Timm
Hi!
when I use for example oEdit1:Value := " Test " the trailing blank space character is deleted.
How can I avoid that?
Best regards, Timm.

TEdit

Publicado: Vie Feb 21, 2014 10:45 am
por ignacio
Hello,
Sorry I can not reproduce your error.
Regards,

TEdit

Publicado: Vie Feb 21, 2014 12:05 pm
por Timm
Hi Ignacio,
please take a look at the attached modified Edits sample.
Best regards, Timm.

Attached files Edit.zip (3 KB)Â

TEdit

Publicado: Vie Feb 21, 2014 12:30 pm
por ignacio
Hi,
Please see the video.
Regards,

Attached files capture-1.mp4 (109.9 KB)Â

TEdit

Publicado: Vie Feb 21, 2014 2:42 pm
por Timm
Hi Ignacio,
calling ::oEdit1:Value := " Test " a second time does not solve the problem.
Best regards, Timm.

TEdit

Publicado: Mar Feb 25, 2014 10:03 am
por ignacio
Hello,
Sorry I thought my video was clear. I justed want to show you that I'm not able to reproduce your error.
Regards,

TEdit

Publicado: Mar Feb 25, 2014 1:44 pm
por Timm
Hi Ignacio,
this is a missunderstanding. Sorry, my fault.
When you set oEdit1:Value := " Test " the control (oEdit1) receives only " Test".
Best regards, Timm.

TEdit

Publicado: Mié Feb 26, 2014 11:07 am
por ignacio
Hi Timm,
I'm afraid that problem arise due the need to trim all the spaces on DBF fields. As you surely remember all the character DBF fields values are filled with spaces up to the length of its field. That was a problem when editing those fields. If we take off that trim operation I'm sure many people will protest.
I suggest you overload the TEdit:SetValue method this way:
METHOD SetValue( Value, lWithEvent ) CLASS TEdit
DEFAULT lWithEvent TO .F.
::FValue := ToString( Value, "" )
::FcText := ::FValue
IF ! Empty( ::Handle ) .AND. !( GetWindowText( ::Handle ) == ::FcText )
IF ! lWithEvent
::lStopEvent := .T.
ENDIF
SetWindowText( ::Handle, ::FcText )
ENDIF
RETURN ::FValue
Best regards,