making wxFrame Modal Topic is solved

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
rakeshthp
I live to help wx-kind
I live to help wx-kind
Posts: 154
Joined: Mon Apr 06, 2009 10:02 am
Location: India

making wxFrame Modal

Post by rakeshthp » Thu Jul 30, 2009 7:16 am

Hello guys..

I have developed an MDI form using class wxFrame.. I have included menus and tool bars as per my requirement..

There is one facility where in a user can enable or disable the autosave oprion.. Thus i have designed an interface (using wxMiniFrame) with a checkbox, so that user can enable or disable the autosave functionality..

Everything is working fine.. But i need to make it modal.. Similar to the one that dialogbox does.. we say,

(dialogbox).ShowModal(true);

I need a similar thing that has to be applicable in my case.. Till user closes this call form, the application should not allow them to access the MDI form..

Thanks in advance

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 5013
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Post by ONEEYEMAN » Thu Jul 30, 2009 7:27 am

Hi,
Why can't you create a dialog and then put all you controls on it?

Or you can use wxPanel to make it work...

Thank you.

swapd0
I live to help wx-kind
I live to help wx-kind
Posts: 169
Joined: Mon May 14, 2007 11:16 am
Location: Spain

Post by swapd0 » Thu Jul 30, 2009 10:08 am


rakeshthp
I live to help wx-kind
I live to help wx-kind
Posts: 154
Joined: Mon Apr 06, 2009 10:02 am
Location: India

Post by rakeshthp » Thu Aug 27, 2009 11:42 am

there is an option called makemodal for the form..

this->MakeModal(true);

will do the thing..

Thanks anyways..

cdpadmin
In need of some credit
In need of some credit
Posts: 4
Joined: Mon Jan 23, 2012 5:14 am

Re: making wxFrame Modal

Post by cdpadmin » Fri May 10, 2013 3:45 pm

this->MakeModal(true);
I found this->MakeModal(true) does not work with wxFrame; it doesn't create an event loop.

I used Jason's modalwindow class in place of wxFrame. modalwindow->ShowModal() now works as expected.

http://forums.wxwidgets.org/viewtopic.p ... log#p89334

:D

Post Reply