[Lazarus] How to limit editor area of a TEdit

Gabor Boros gaborboros at yahoo.com
Mon Feb 2 15:57:58 CET 2015


2015.02.02. 15:13 keltezéssel, zeljko írta:
>
> It should look like this:
>
> procedure TMyEdit.UpdateEditRect;
> {$IFDEF LCLQt}
> var
>    R: TRect;
> {$ENDIF}
> begin
>    if not HandleAllocated then
>      exit;
>    {$IFDEF LCLQt}
>    if FButtonVisible then
>      R := Rect(0, 0, FSB.Width, 0)
>    else
>      R := Rect(0, 0, 0, 0);
>    TQtLineEdit(Handle).TextMargins := R;
>    {$ENDIF}
> end;
>
> And it should be changed in FontChanged, Resize, button
> visible/true/false etc ... FSB.Width = YOurButton.Width
>
> z.

Works like a charm! Thank you very much Zeljko!

Gabor




More information about the Lazarus mailing list