Multiple wxFrames and modal wxDialog issue

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
chris_bern
Earned some good credits
Earned some good credits
Posts: 125
Joined: Wed Mar 05, 2008 3:30 pm

Multiple wxFrames and modal wxDialog issue

Post by chris_bern » Fri Feb 27, 2009 11:18 am

Hi,

I have a main wxFrame started in wxApp. Then I have functions that create additional wxFrame(s) with NULL parent, by user intervention. The problem is that, if I run a modal wxDialog with any wxFrame as a parent, then all wxFrames created so far are blocked-disabled. Frames that are created after the creation and during the life of the modal dialog are not blocked.

I would like a modal dialog that will block only it's parent which will be a particular wxFrame, and not all other wxFrames.

Thanks for the input.

Chris

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Fri Feb 27, 2009 3:01 pm

Unfortunately, that's not the definition of a modal-dialog; the bug is probably that windows created after the modal dialog are clickable. I do not have any direct solution since I do not know what kind of app you are making; I however can't help but wonder howcome you need that many windows (i.e. you may need to describe what you're doing to get alternative suggestions)

Frank
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 211
Joined: Sat Jan 01, 2005 6:19 pm

Post by Frank » Fri Feb 27, 2009 5:00 pm

No, that's only wx's defnition of Modal.

In WinAPI and other toolkits I used before, modal has the normal meaning: Modal to it's parent.

But wx is doing some stange stuff, so sadly, this is how it "works" in wx.

In my book, this is a bug in wx, because when all others doing it right, and your the only one who's doing it wrong, the bug is clearly on your side.

chris_bern
Earned some good credits
Earned some good credits
Posts: 125
Joined: Wed Mar 05, 2008 3:30 pm

Post by chris_bern » Fri Feb 27, 2009 11:58 pm

I'm making instant messenger like program. I need each conversation in a separate frame. If the user has modal dialog open in the main frame, I need all other frames enabled not disabled.

The scenario I get now:
As soon as the modal dialog is shown, all frames created till then are blocked. If, let's say there is an incoming message for a new conversation while the modal dialog is running, the new conversation frame is created and runs in non-blocking mode.

The scenario I need:
Modal dialog to block only it's parent, not all other frames.

Chris

chris_bern
Earned some good credits
Earned some good credits
Posts: 125
Joined: Wed Mar 05, 2008 3:30 pm

Post by chris_bern » Sat Feb 28, 2009 12:17 pm

I just got reply from one of the wxWidgets developers that this feature is planed for the next release.

User avatar
moraldi
Earned some good credits
Earned some good credits
Posts: 123
Joined: Sun Nov 18, 2007 9:45 pm
Location: Hellas

Post by moraldi » Sat Feb 28, 2009 12:46 pm

I just got reply from one of the wxWidgets developers that this feature is planed for the next release.
Until then and assuming that each conversation requires the same functionality by the application, you could create a new application instance for every conversation

chris_bern
Earned some good credits
Earned some good credits
Posts: 125
Joined: Wed Mar 05, 2008 3:30 pm

Post by chris_bern » Sat Feb 28, 2009 1:46 pm

moraldi wrote:
I just got reply from one of the wxWidgets developers that this feature is planed for the next release.
Until then and assuming that each conversation requires the same functionality by the application, you could create a new application instance for every conversation
In this kind of application there are a lot of relations between the application and it's frames, so running another instance will not do the trick.

I would probably wait for a while for the new release or make modeless dialog and disable/enable the main frame manually.

Chris

User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2293
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

Post by evstevemd » Tue Dec 07, 2010 1:06 pm

chris_bern wrote:
moraldi wrote:
I just got reply from one of the wxWidgets developers that this feature is planed for the next release.
Until then and assuming that each conversation requires the same functionality by the application, you could create a new application instance for every conversation
In this kind of application there are a lot of relations between the application and it's frames, so running another instance will not do the trick.

I would probably wait for a while for the new release or make modeless dialog and disable/enable the main frame manually.

Chris
You can well add dialogs instead of wxframe and add horizontal sizer to mimic the Toolbar or just add Pop up menu!
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 19.04/Windows 10 Pro/MacOS 10.13 - GCC/MinGW/Clang, CodeLite IDE]

Post Reply