Board index » kylix » VCLX Patch: z-order introduced by patch 3.4 - poll

VCLX Patch: z-order introduced by patch 3.4 - poll


2005-02-05 06:43:13 AM
kylix0
The UnVCLX patch version 3.5 fixed this:
Delphi only:
* Improved: The new z-order handling (patch 3.4) keeps the main form in
background of all other forms. This patch prevents this.
The problem I have is that with this fix I had to write code that acts
against Qt's behaviour (keeping the main form behind all child forms). And
this "against Qt code" will never be stable because it works by setting
and resetting the HWND_PARENT field of each window (SetWindowLong) in
event handlers. It is more a pain than a solution.
So I want to revert this "improvement" to version 3.4. The result would be
that we have forms that act in Qt's behaviour.
Disadvantage:
1. The main form is always behind all other forms.
Advantage:
1. The z-order is always correct (because Qt handles all z-order
problems)
2. Minimizing the main form minimizes all other forms and restoring them
restores the z-order (no form is hidden even if it was shown)
Personally I can live with this single disadvantage.
Going back to the original code (by Borland) would solve the disadvantage
but removes the advantages because the not shown AppWidget cannot be shown
in Restore()/Maximize(). If it would we would see an empty window on the
desktop.
Comments and suggestions on this issue are welcome.
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
(andy.jgknet.de/blog)
 
 

Re:VCLX Patch: z-order introduced by patch 3.4 - poll

Andreas Hausladen wrote:
..
Quote
So I want to revert this "improvement" to version 3.4. The result would be
that we have forms that act in Qt's behaviour.
Disadvantage:
1. The main form is always behind all other forms.
Fine by me - go ahead you have my vote.
siegs
 

Re:VCLX Patch: z-order introduced by patch 3.4 - poll

I would prefer the 3.4 behavior to the 3.5 behavior.
"Andreas Hausladen" < XXXX@XXXXX.COM >wrote:
Quote
The UnVCLX patch version 3.5 fixed this:

Delphi only:
* Improved: The new z-order handling (patch 3.4) keeps the main form in
background of all other forms. This patch prevents this.


The problem I have is that with this fix I had to write code that acts
against Qt's behaviour (keeping the main form behind all child forms). And
this "against Qt code" will never be stable because it works by setting
and resetting the HWND_PARENT field of each window (SetWindowLong) in
event handlers. It is more a pain than a solution.

So I want to revert this "improvement" to version 3.4. The result would be
that we have forms that act in Qt's behaviour.
Disadvantage:
1. The main form is always behind all other forms.
Advantage:
1. The z-order is always correct (because Qt handles all z-order
problems)
2. Minimizing the main form minimizes all other forms and restoring them
restores the z-order (no form is hidden even if it was shown)

Personally I can live with this single disadvantage.

Going back to the original code (by Borland) would solve the disadvantage
but removes the advantages because the not shown AppWidget cannot be shown
in Restore()/Maximize(). If it would we would see an empty window on the
desktop.


Comments and suggestions on this issue are welcome.
 

{smallsort}

Re:VCLX Patch: z-order introduced by patch 3.4 - poll

Andreas Hausladen wrote:
Quote
1. The main form is always behind all other forms.
Advantage:
1. The z-order is always correct (because Qt handles all z-order
problems)
2. Minimizing the main form minimizes all other forms and restoring them
restores the z-order (no form is hidden even if it was shown)
Ok.
 

Re:VCLX Patch: z-order introduced by patch 3.4 - poll

I have re-thinked the z-order problem. And now I try it with a AppWidget
(as Borland did) with the difference that I can show it because it has no
border and is transparent.
Let's see if that work.
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
(andy.jgknet.de/blog)
 

Re:VCLX Patch: z-order introduced by patch 3.4 - poll

"rbwinston" < XXXX@XXXXX.COM >wrote in message
Quote
I would prefer the 3.4 behavior to the 3.5 behavior.

"Andreas Hausladen" < XXXX@XXXXX.COM >wrote:

>The UnVCLX patch version 3.5 fixed this:
>
>Delphi only:
>* Improved: The new z-order handling (patch 3.4) keeps the main form in
>background of all other forms. This patch prevents this.
>
>
>The problem I have is that with this fix I had to write code that acts
>against Qt's behaviour (keeping the main form behind all child forms).
And
>this "against Qt code" will never be stable because it works by setting
>and resetting the HWND_PARENT field of each window (SetWindowLong) in
>event handlers. It is more a pain than a solution.
>
>So I want to revert this "improvement" to version 3.4. The result would
be
>that we have forms that act in Qt's behaviour.
>Disadvantage:
>1. The main form is always behind all other forms.
>Advantage:
>1. The z-order is always correct (because Qt handles all z-order
>problems)
>2. Minimizing the main form minimizes all other forms and restoring
them
>restores the z-order (no form is hidden even if it was shown)
>
>Personally I can live with this single disadvantage.
>
>Going back to the original code (by Borland) would solve the disadvantage
>but removes the advantages because the not shown AppWidget cannot be
shown
>in Restore()/Maximize(). If it would we would see an empty window on the
>desktop.
>
>
>Comments and suggestions on this issue are welcome.
Could the the same thing be accomplished by putting a call to the
TForm.ReSubmitFlags procedure as the first line of the TForm.DoShow or
perhaps by overriding each form's DoShow method like this:
type TMyForm = class(TForm)
protected
procedure DoShow; override;
end;
procedure TMyForm.DoShow;
begin
Self.ReSubmitFlags;
inherited;
end;
 

Re:VCLX Patch: z-order introduced by patch 3.4 - poll

"Jason" < XXXX@XXXXX.COM >wrote:
Quote

"rbwinston" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>I would prefer the 3.4 behavior to the 3.5 behavior.
>
>"Andreas Hausladen" < XXXX@XXXXX.COM >wrote:
>
>>The UnVCLX patch version 3.5 fixed this:
>>
>>Delphi only:
>>* Improved: The new z-order handling (patch 3.4) keeps the main form in
>>background of all other forms. This patch prevents this.
>>
>>
>>The problem I have is that with this fix I had to write code that acts
>>against Qt's behaviour (keeping the main form behind all child forms).
And
>>this "against Qt code" will never be stable because it works by setting
>>and resetting the HWND_PARENT field of each window (SetWindowLong) in
>>event handlers. It is more a pain than a solution.
>>
>>So I want to revert this "improvement" to version 3.4. The result would
be
>>that we have forms that act in Qt's behaviour.
>>Disadvantage:
>>1. The main form is always behind all other forms.
>>Advantage:
>>1. The z-order is always correct (because Qt handles all z-order
>>problems)
>>2. Minimizing the main form minimizes all other forms and restoring
them
>>restores the z-order (no form is hidden even if it was shown)
>>
>>Personally I can live with this single disadvantage.
>>
>>Going back to the original code (by Borland) would solve the disadvantage
>>but removes the advantages because the not shown AppWidget cannot be
shown
>>in Restore()/Maximize(). If it would we would see an empty window on the
>>desktop.
>>
>>
>>Comments and suggestions on this issue are welcome.

Could the the same thing be accomplished by putting a call to the
TForm.ReSubmitFlags procedure as the first line of the TForm.DoShow or
perhaps by overriding each form's DoShow method like this:

type TMyForm = class(TForm)
protected
procedure DoShow; override;
end;

procedure TMyForm.DoShow;
begin
Self.ReSubmitFlags;
inherited;
end;

What I would like is for a form that is not the main form to be on top
of the main form all the time if FormStyle is set to fsStayOnTop. So
far, the only way I've been able to do that is to override WidgetFlags
to include WidgetFlags_WStyle_StaysOnTop. However, that keeps the
form on top of the forms of other applications as well as my own. I
don't like that. I tried your suggestion but it didn't seem to do
anything about keeping forms on top of the main form of my
application.
The best I've been able to come up with is to call Show for each
visible form other than the main form in Appliation.OnActivate.
 

Re:VCLX Patch: z-order introduced by patch 3.4 - poll

rbwinston wrote:
Quote
"Jason" < XXXX@XXXXX.COM >wrote:

The best I've been able to come up with is to call Show for each
visible form other than the main form in Appliation.OnActivate.
Hey man please stop overquoting!
Is imposible to read messages innthat way.
German.
 

Re:VCLX Patch: z-order introduced by patch 3.4 - poll

"rbwinston" < XXXX@XXXXX.COM >wrote in message
Quote
"Jason" < XXXX@XXXXX.COM >wrote:
>
>Could the the same thing be accomplished by putting a call to the
>TForm.ReSubmitFlags procedure as the first line of the TForm.DoShow or
>perhaps by overriding each form's DoShow method like this:
>
>type TMyForm = class(TForm)
>protected
>procedure DoShow; override;
>end;
>
>procedure TMyForm.DoShow;
>begin
>Self.ReSubmitFlags;
>inherited;
>end;
>

What I would like is for a form that is not the main form to be on top
of the main form all the time if FormStyle is set to fsStayOnTop. So
far, the only way I've been able to do that is to override WidgetFlags
to include WidgetFlags_WStyle_StaysOnTop. However, that keeps the
form on top of the forms of other applications as well as my own. I
don't like that. I tried your suggestion but it didn't seem to do
anything about keeping forms on top of the main form of my
application.

The best I've been able to come up with is to call Show for each
visible form other than the main form in Appliation.OnActivate.
Did the "ReSubmitFlags" have no effect at all for you or did it produce an
effect other than what you want? I only ecently tried the ReSubmitFlags
things after I found a problem on Red Hat Fedora Core 3 where some of my
forms would display underneath thier parent form when the were activated by
"ShowModal" from the parent. Previously the application was running on Red
Hat 7.3 and Red Hat Enterpise 3 and there was not problem at all. I tried
all sort of things until I discoved that the problem on Fedora Core 3 could
be overcome by changing the child form's FormStyle property in it's "OnShow"
event. Then when I looked at the QForms source code I discoved that the
only necessary thing that changing the FormStyle was doing at that point was
calling ReSubmitFlags. ReSubmitFlags does solve my problme on Fedore Code 3
and doesn't break the code on RH 7.3 or Enterprise 3, but I don't know if it
does anythign good, bad, or indifferent on other distrubutions. However I
am not trying to keep the child form from ever going behind the parent form,
I am just trying to keep the child from displaying undeneath the parent when
initially displayed.
About the behavior you note where setting WidgetFlags_WStyle_StaysOnTop
causing the form to always stay on top of everything from all other running
applications, I'm pretty sure that is the effect that FormStyle:=
fsStayOnTop has on Windows also (or at least it is in non-CLX Delphi
applications). I don't like it either but I guess that it could be defended
on the basis of portability..
 

Re:VCLX Patch: z-order introduced by patch 3.4 - poll

"Jason" < XXXX@XXXXX.COM >wrote:
Quote
>
>What I would like is for a form that is not the main form to be on top
>of the main form all the time if FormStyle is set to fsStayOnTop. So
>far, the only way I've been able to do that is to override WidgetFlags
>to include WidgetFlags_WStyle_StaysOnTop. However, that keeps the
>form on top of the forms of other applications as well as my own. I
>don't like that. I tried your suggestion but it didn't seem to do
>anything about keeping forms on top of the main form of my
>application.
>
>The best I've been able to come up with is to call Show for each
>visible form other than the main form in Appliation.OnActivate.

Did the "ReSubmitFlags" have no effect at all for you or did it produce an
effect other than what you want? I only ecently tried the ReSubmitFlags
things after I found a problem on Red Hat Fedora Core 3 where some of my
forms would display underneath thier parent form when the were activated by
"ShowModal" from the parent. Previously the application was running on Red
Hat 7.3 and Red Hat Enterpise 3 and there was not problem at all. I tried
all sort of things until I discoved that the problem on Fedora Core 3 could
be overcome by changing the child form's FormStyle property in it's "OnShow"
event. Then when I looked at the QForms source code I discoved that the
only necessary thing that changing the FormStyle was doing at that point was
calling ReSubmitFlags. ReSubmitFlags does solve my problme on Fedore Code 3
and doesn't break the code on RH 7.3 or Enterprise 3, but I don't know if it
does anythign good, bad, or indifferent on other distrubutions. However I
am not trying to keep the child form from ever going behind the parent form,
I am just trying to keep the child from displaying undeneath the parent when
initially displayed.

About the behavior you note where setting WidgetFlags_WStyle_StaysOnTop
causing the form to always stay on top of everything from all other running
applications, I'm pretty sure that is the effect that FormStyle:=
fsStayOnTop has on Windows also (or at least it is in non-CLX Delphi
applications). I don't like it either but I guess that it could be defended
on the basis of portability..

Resubmit flags had no noticeable effect. The form would not stay on
top of the main form even though FormStyle was fsStayOnTop..