Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2018-12

BeginFormUpdate/EndFormUpdate should be public?

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

AlexeyT

%subj - they are not public so I must use now dirty code:

 1.
    procedure DoControlLock(Ctl: TWinControl);
 2.
    begin
 3.
    {$ifdef fpc}
 4.
    if Application.MainFormnil then
 5.
         TFormHack(Application.MainForm).BeginFormUpdate;
 6.
    {$else}
 7.
       Ctl.Perform(WM_SetRedraw, 0, 0);
 8.
    {$endif}
 9.
    end;
Regards, Alexey -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20181223/954410e8/attachment.html>

Reply by email

Juha Manninen
to AlexeyT
PM AlexeyT wrote 12 lines
%subj - they are not public so I must use now dirty code: procedure DoControlLock(Ctl: TWinControl); begin {$ifdef fpc} if Application.MainFormnil then TFormHack(Application.MainForm).BeginFormUpdate; {$else} Ctl.Perform(WM_SetRedraw, 0, 0); {$endif} end;

Your code is somehow flawed.
TCustomForm.BeginFormUpdate should not be needed in application code.

Juha

Reply by email

AlexeyT
to Juha Manninen

 I dont think so. It is ATGroups component (in ATTabs repo). This call is needed for me to hide flickering of controls. When ATGroups changes Mode prop. W/o this call, i see how child panels rearrange for 0.N seconds.

> Your code is somehow flawed. > TCustomForm.BeginFormUpdate should not be needed in application code. > > Juha
Regards, Alexey

Reply by email

Juha Manninen
to AlexeyT
AM AlexeyT wrote
I dont think so. It is ATGroups component (in ATTabs repo). This call is needed for me to hide flickering of controls. When ATGroups changes Mode prop. W/o this call, i see how child panels rearrange for 0.N seconds.

See what TCustomForm.BeginFormUpdate does. It calls DisableAutoSizing, but only once.
Use DisableAutoSizing and EnableAutoSizing in your code and it works equally well.

Juha

Reply by email