Atozed Forums
The computer freezes when clicking to fast - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: The computer freezes when clicking to fast (/thread-1667.html)

Pages: 1 2


The computer freezes when clicking to fast - newuser - 05-14-2020

Hi,
I experience unexpected freezing.
The program runs much slower then in Delphi, so a simple procedure of a few lines the wait sign appears for less then a second.
So for example when I click on a listbox, the first command is disabling the listbox and at the and of the procedure enabling again, otherwise when you click 2 times the program freezes.
The same I have when switching form one form to another and back.
Is this normal and what to do?


RE: The computer freezes when clicking to fast - kudzu - 05-14-2020

There is not nearly enough info in this message to even begin to help.

Do you have any issues with the Guess demo?


RE: The computer freezes when clicking to fast - newuser - 05-14-2020

No, just a small new application, with a few listboxes with on click a few lines of code.
Just 4 form-pages, nothing complex.
What information do you need?
I can send you the code... or give you the page and login code.


RE: The computer freezes when clicking to fast - joelcc - 05-14-2020

(05-14-2020, 04:45 PM)newuser Wrote: No, just a small new application, with a few listboxes with on click a few lines of code.
Just 4 form-pages, nothing complex.
What information do you need?
I can send you the code... or give you the page and login code.

Are you setting

LockUntilLoaded := true;

  LockOnSubmit    := true;


RE: The computer freezes when clicking to fast - newuser - 05-15-2020

Yes, both are checked on every form


RE: The computer freezes when clicking to fast - newuser - 05-16-2020

I used the on click.
Now I tried the onAsincClick and set the LockOnAsyncEvents true.
Now there is no freezing.
Is this normal and should one not use the onClick?


RE: The computer freezes when clicking to fast - kudzu - 05-16-2020

You have not even shown your code for your onclick. Im sorry but we are not mind readers.


RE: The computer freezes when clicking to fast - newuser - 05-16-2020

I'm sorry,
It is on most click events.
Code:
procedure TfmReserveer.lbLessoortClick(Sender: TObject);
begin
  if lbLessoort.ItemIndex >= 0 then
  begin
    lbLessoort.Enabled := false;
    UserSession.qLessoort.Locate('Volgnr', Lesnrs[lbLessoort.ItemIndex], []);
    UserSession.qLessen.First;
    lbLessen.Clear;
    while not UserSession.qLessen.Eof do
    begin
      UserSession.qCheckOfVol.Parameters[0].Value := UserSession.qLessenVOLGNR.AsInteger;
      UserSession.qCheckOfVol.Parameters[1].Value := DatumVanLes;
      UserSession.qCheckOfVol.Open;
      if UserSession.qCheckOfVolaantal.AsInteger >= UserSession.qLessenMAXAANTAL.AsInteger then
        lbLessen.Items.Addpair(weekdagen[UserSession.qLessenDAG.AsInteger] + ' ' + UserSession.qLessenSTARTUUR.AsString + ':' + PadLeft(UserSession.qLessenSTARTMIN.AsString, 2, '0'), 'vol')
      else
        lbLessen.Items.Add(weekdagen[UserSession.qLessenDAG.AsInteger] + ' ' + UserSession.qLessenSTARTUUR.AsString + ':' + PadLeft(UserSession.qLessenSTARTMIN.AsString, 2, '0'));
      UserSession.qLessen.Next;
    end;
    lbLessoort.Enabled := true;
  end;
  lReserveer.Caption := '';
  bReserveer.Enabled := false;
end;
Thank you for your quick respons!


RE: The computer freezes when clicking to fast - kudzu - 05-16-2020

If you are cycling an entire dataset its likely slow. Replace your click event with something simple like updating a label or button and no extra code and you will see that it is not IW slowing things down.

You are setting params and opening a dataset inside of a loop which will be very slow as well.... If that loop is 1000 items then its repreparing and reopening a qCheckOfVol that many times. This code would run just as slow in a desktop app as it does in IW. There is no difference in such code desktop or IW.


RE: The computer freezes when clicking to fast - newuser - 05-24-2020

So, I noticed that in contrast with a Delphi program, you can press a button while it is still processing.
Which way to go?
You one lock / disable every button on click when there is a litle bit more code to process?
When yes, a suggestion for new releases to make a property for this?
Or is there a better way?