Recent

Author Topic: How can I open "modal" window and continue in process?  (Read 1540 times)

Milsa

  • Sr. Member
  • ****
  • Posts: 309
How can I open "modal" window and continue in process?
« on: March 06, 2018, 09:44:25 pm »
I have this situation:
Program needs to do some operations. It will open standard window with text "Please wait" and it continues with occasional Application.ProcessMessages. But this window is no modal and click to the main window allows to work with main window. It is unwanted.

Modal window opening is not solution because if program opens modal window then main window is not accessible (correct) but program halts unless modal window is closed (unwanted).

Does exists easily solution for this without threading and disabling all elements on main window?

Do you understand me? My explanation may be weak.
« Last Edit: March 06, 2018, 09:46:06 pm by Milsa »
I work with Lazarus 2.2.2, FPC 3.2.2, date 2022-05-15
This information is actual to: 28st Dec 2022

balazsszekely

  • Guest
Re: How can I open "modal" window and continue in process?
« Reply #1 on: March 06, 2018, 09:51:48 pm »
Just set Mainwindow.Enabled to false before you show the secondary window, then to true again when you close the "Please wait" window.

Milsa

  • Sr. Member
  • ****
  • Posts: 309
Re: How can I open "modal" window and continue in process?
« Reply #2 on: March 06, 2018, 09:58:23 pm »
I will try it tomorrow.

Easy solution is the best.  :o

Thank you.
I work with Lazarus 2.2.2, FPC 3.2.2, date 2022-05-15
This information is actual to: 28st Dec 2022

 

TinyPortal © 2005-2018