Jump to content

Synchronize


Gustavo_GRSoft

Recommended Posts

Hello my friends, i want to make a process in which the system switches messages when each part of the process is finished, but unigui does not show all the messages...

 

   MainForm.ShowMask('Salvando dados...');
   UniSession.Synchronize;

   sleep(1000);

   MainForm.HideMask;

   MainForm.ShowMask('Criando banco de dados...');
   UniSession.Synchronize;

   sleep(1000);

   MainForm.HideMask;

   MainForm.ShowMask('Finalizando...');
   UniSession.Synchronize;

   sleep(1000);

   MainForm.HideMask;
 

Link to comment
Share on other sites

one more question, I saw the example you asked me for, but when I call a modal form and I have a positive return, the message is above the form that was called, I would like the form to close first and only after that, the message appears.

  if UniForm5.ShowModal() = mrOK then
    ShowMessage('Completed');
 

Link to comment
Share on other sites

Hello @Gustavo_GRSoft

Don't use Synchronize.

Try to use this code for example:

procedure TMainForm.UniButton2Click(Sender: TObject);
begin
  UniForm1.ShowModal(ShowCallBack);
end;

procedure TMainForm.ShowCallBack(Sender: TComponent; AResult:Integer);
begin
  //UniMemo1.Lines.Add('Form: '+(Sender as TuniForm).Name+', Result: '+IntToStr(AResult));
  if AResult = mrOk then
    ShowMessage('OK')
end;

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...