Cannot find a Z-order policy that works for this

17 views
Skip to first unread message

ardi

unread,
Aug 2, 2012, 7:21:31 AM8/2/12
to wx-users
Hi!

In my apps, I need that all dialogs are always on top of the app frame
(otherwise, when a user clicks the frame, all non-modal dialogs are
hidden behind the frame, and that's undesired for these apps). So I
create my non-modal dialogs with wxSTAY_ON_TOP, and it works fine.

The problem is when the app needs to post a modal dialog asking the
user for some urgent or important question. Modal dialogs -with
ShowModal()- are shown behind wxSTAY_ON_TOP non-modal dialogs, even if
I create modal dialogs with wxSTAY_ON_TOP style too.

I checked this on both MSW and OSX-Cocoa, and both platforms exhibit
the same behaviour.

So, how can I achieve that all my dialogs (modal and non-modal) are
always on top of the app frame, and also that modal dialogs have
always higher Z-order priority than non-modal dialogs?

TIA

ardi

Eric Jensen

unread,
Aug 2, 2012, 7:28:33 AM8/2/12
to ardi
Hello ardi,

Thursday, August 2, 2012, 1:21:31 PM, you wrote:

a> In my apps, I need that all dialogs are always on top of the app frame
a> (otherwise, when a user clicks the frame, all non-modal dialogs are
a> hidden behind the frame, and that's undesired for these apps). So I
a> create my non-modal dialogs with wxSTAY_ON_TOP, and it works fine.

a> The problem is when the app needs to post a modal dialog asking the
a> user for some urgent or important question. Modal dialogs -with
a> ShowModal()- are shown behind wxSTAY_ON_TOP non-modal dialogs, even if
a> I create modal dialogs with wxSTAY_ON_TOP style too.

Have you tried wxFRAME_FLOAT_ON_PARENT instead of wxSTAY_ON_TOP for
your non-modal dialogs?

Regards,
Eric


ardi

unread,
Aug 2, 2012, 8:21:36 AM8/2/12
to wx-users


On Aug 2, 1:28 pm, Eric Jensen <m...@j-dev.de> wrote:
[...]
>
> Have you tried wxFRAME_FLOAT_ON_PARENT instead of wxSTAY_ON_TOP for
> your non-modal dialogs?
>

Thanks, Eric. That style is for wxFrame, not wxDialog. Anyway, I tried
it and didn't work.

Explaining it with less words, the Z-order I wish is this:

1- modal dialogs -> always on top of all app windows and dialogs, no
matter what.

2- non-modal dialogs -> always on top of the app frame, but always
below modal dialogs.

3- app frame -> always below all the app dialogs.

ardi

Reply all
Reply to author
Forward
0 new messages