Re: [Lazarus] Modal forms: block parent form or application

2011-01-30 Thread Andreas Schneider
On Sunday, January 30, 2011 00:13 cobines wrote:
 But what about dialog boxes with buttons requiring user input? Usually
 you want to have result which button was pressed and such dialog boxes
 are shown as modal with ModalResult returned. Showing OpenFile dialog,
 showing messages with ShowMessage or asking user for input with
 InputQuery, all such cases result in all windows in the application
 being blocked.

Well, IMHO these windows are called dialog for a reason. If you were
in  a dialog with me and I asked you something, I would be offended if
you turned away, talked to a bunch of other people first and THEN come
back to finally answer my question.
Or  more  specifically  in these cases: if you click a button to enter
some  information  (InputQuery),  you  most  likely  already know - or
should  know  -  what  you  want to enter. Similarly for the Open/Save
Dialogs.  If  you intent on saving or opening a file, you usually have
in  mind which one. So why should you be able to click around in other
windows in that time?

-- 
Best Regards,
Andreas


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Modal forms: block parent form or application

2011-01-30 Thread cobines
2011/1/30 Andreas Schneider ak...@gmx.de:
 On Sunday, January 30, 2011 00:13 cobines wrote:
 But what about dialog boxes with buttons requiring user input? Usually
 you want to have result which button was pressed and such dialog boxes
 are shown as modal with ModalResult returned. Showing OpenFile dialog,
 showing messages with ShowMessage or asking user for input with
 InputQuery, all such cases result in all windows in the application
 being blocked.

 Well, IMHO these windows are called dialog for a reason. If you were
 in  a dialog with me and I asked you something, I would be offended if
 you turned away, talked to a bunch of other people first and THEN come
 back to finally answer my question.
 Or  more  specifically  in these cases: if you click a button to enter
 some  information  (InputQuery),  you  most  likely  already know - or
 should  know  -  what  you  want to enter. Similarly for the Open/Save
 Dialogs.  If  you intent on saving or opening a file, you usually have
 in  mind which one. So why should you be able to click around in other
 windows in that time?


Well, I look at other native applications, they behave differently
than Lazarus applications, hence I ask if that's intended difference.
That's all.

--
cobines

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Modal forms: block parent form or application

2011-01-29 Thread cobines
Hello,

I have two forms Form1 and Form2. Form1 is MainForm with
ShowInTaskbar=stDefault and Form2 has ShowInTaskbar=True, so they both
have taskbar buttons, I treat them as separate windows. I show a modal
form from Form2 which blocks the whole application. Is it possible to
have it block only Form2, so I can still activate and work in Form1?

--
cobines

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Modal forms: block parent form or application

2011-01-29 Thread zeljko
On Saturday 29 of January 2011 09:29:02 cobines wrote:
 Hello,
 
 I have two forms Form1 and Form2. Form1 is MainForm with
 ShowInTaskbar=stDefault and Form2 has ShowInTaskbar=True, so they both
 have taskbar buttons, I treat them as separate windows. I show a modal
 form from Form2 which blocks the whole application. Is it possible to
 have it block only Form2, so I can still activate and work in Form1?

There are 2 kinds of modality (at least under qt, but can be applied to any 
X11 app ... don't know for win32 or mac how to do that).
1.Window modal
2.App modal
So, with proper implementation it's possible to make
1.Form modal for 1 form eg. parent form
2.Form modal for application (usual behaviour).

zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Modal forms: block parent form or application

2011-01-29 Thread Paul Ishenin

29.01.2011 15:29, cobines wrote:

Hello,

I have two forms Form1 and Form2. Form1 is MainForm with
ShowInTaskbar=stDefault and Form2 has ShowInTaskbar=True, so they both
have taskbar buttons, I treat them as separate windows. I show a modal
form from Form2 which blocks the whole application. Is it possible to
have it block only Form2, so I can still activate and work in Form1?

Yes. You don't need a modal form then.

1. Change your modal form to be a regular form with PopupParent = Form2.
2. Disable Form2 when you show your popup form.

Of course the logic requires a small reimplementation because you can't 
use ModalResult and Show is not a blocking method as ShowModal.


Best regards,
Paul Ishenin

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Modal forms: block parent form or application

2011-01-29 Thread cobines
2011/1/29 zeljko zel...@holobit.net:
 On Saturday 29 of January 2011 09:29:02 cobines wrote:
 Hello,

 I have two forms Form1 and Form2. Form1 is MainForm with
 ShowInTaskbar=stDefault and Form2 has ShowInTaskbar=True, so they both
 have taskbar buttons, I treat them as separate windows. I show a modal
 form from Form2 which blocks the whole application. Is it possible to
 have it block only Form2, so I can still activate and work in Form1?

 There are 2 kinds of modality (at least under qt, but can be applied to any
 X11 app ... don't know for win32 or mac how to do that).
 1.Window modal
 2.App modal
 So, with proper implementation it's possible to make
 1.Form modal for 1 form eg. parent form
 2.Form modal for application (usual behaviour).

I also think it is like that on GTK2, at least that's how I saw it in
one application (medit).

In Windows only parent window (and all its children I think) is
blocked, since each window is independent. For example, you can create
two windows and in both show modal dialog boxes and switch between
them via Alt-Tab, yet still have a third window completely
operational.

--
cobines

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus