Forum > General

ShowModal disables form minimise

<< < (2/5) > >>

dseligo:

--- Quote from: Martin_fr on May 06, 2021, 06:35:44 pm ---Modalforms themself should probably be bsDialog. I do not know if it is strictly required. I also do not know what happens otherwise, maybe its enforced.  But that should not affect the main form.

--- End quote ---

Why BorderStyle should be bsDialog? I think BorderStyle has nothing to do with ShowModal.

dseligo:

--- Quote from: llion on May 06, 2021, 05:29:37 pm ---I am using Lazarus vn 2.0.6 on XUbuntu 18.04.

I have a problem which can be demonstrated easily using a project with just 3 forms : formA, formB, formC. FormA is the main form for the project. With formA visible I execute the following code

formB.show ;
application.processmessages ; // this ensures that formB is displayed in front of formA
{do other stuff not related to forms} ;
formC.showmodal ; // for example to display a  message relating to the "other stuff" above

In the course of displaying formC the Minimise button in the title bar of formB, & the corresponding Minimise menu option, become disabled, and remain so until the application is terminated.

This would appear to be a bug with showmodal, since if "formC.showmodal" above is replaced with "formC.show" the problem does not appear. Can anyone suggest a fix or work-around please?

--- End quote ---

Are you saying that when you close formC, you can't minimize formB? Then that is a bug. Please prepare test project showing this.
If you don't close formC then it is expected behaviour (not to be able to minimize other forms).

lucamar:

--- Quote from: dseligo on May 06, 2021, 07:11:35 pm ---
--- Quote from: Martin_fr on May 06, 2021, 06:35:44 pm ---Modalforms themself should probably be bsDialog. I do not know if it is strictly required. I also do not know what happens otherwise, maybe its enforced.  But that should not affect the main form.
--- End quote ---
Why BorderStyle should be bsDialog? I think BorderStyle has nothing to do with ShowModal.
--- End quote ---

Indeed, it has nothing to do; you can show any form modally, whatever its border style or what not. That the "minimize" (and other) button(s) is disabled for the non-modal forms is just a gimmick of the GTK2 widgetset.

Note also that only the main form has a minimize button/menu item: no matter how the others are shown they only have the roll-up, maximize and close options.  Oops! No, no, I was wrong in this, sorry; I was thinking of another completely different thing :-[

Martin_fr:

--- Quote from: dseligo on May 06, 2021, 07:11:35 pm ---
--- Quote from: Martin_fr on May 06, 2021, 06:35:44 pm ---Modalforms themself should probably be bsDialog. I do not know if it is strictly required. I also do not know what happens otherwise, maybe its enforced.  But that should not affect the main form.

--- End quote ---

Why BorderStyle should be bsDialog? I think BorderStyle has nothing to do with ShowModal.

--- End quote ---
As, I said: "I don't know, if".

I just wonder what a modal dialog, with a minimize button on the actual modal form would do?
- Minimize the entire app, IMHO unexpected, since that minimize button belongs to the modal form only?
- Minimize the modal dialog, and leave the "frozen" app on the screen?

I haven't tried. I have no idea what will be displayed and/or happen in such a case.
Are there any apps (Lazarus or other) out there that have a mimize-able modal form?


---EDIT:
I mixed that up. I meant the BorderIcons, not the BorderStyle.

dseligo:

--- Quote from: Martin_fr on May 06, 2021, 07:38:19 pm ---I just wonder what a modal dialog, with a minimize button on the actual modal form would do?
- Minimize the entire app, IMHO unexpected, since that minimize button belongs to the modal form only?
- Minimize the modal dialog, and leave the "frozen" app on the screen?

I haven't tried. I have no idea what will be displayed and/or happen in such a case.
Are there any apps (Lazarus or other) out there that have a mimize-able modal form?


---EDIT:
I mixed that up. I meant the BorderIcons, not the BorderStyle.

--- End quote ---

When you click minimize button in Windows 10 the whole app is minimized to the lower left of desktop. If you click on program icon in the taskbar then whole app is minimized normally - nothing is in the lower left of desktop (same is if you minimize of windows, i.e. with Windows key + D).
I don't bother removing minimize icons from my modal forms.
Oh, and I think it's less confusing for user when the whole app is minimized. If I remember correctly, on some version of Windows (or Lazarus), if you minimized modal form the rest of app stayed, but it was (of course) unresponsive. Users sometimes wasn't aware that they minimized modal form and just keep clicking on rest of the forms.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version