Deleting non-modal dialogs Topic is solved
Deleting non-modal dialogs
How does one go about deleting/destroying/closing a non modal dialog? Show( false ) just hides it. The dialog gets created on the click of a button. The parent has a pointer to the dialog to allow for it to be updated. Now how do I go about deleting/destroying/closing the dialog when the close button or the ok button is clicked.
Code: Select all
MyModal* modal = new MyModal(this);
// Show the modal dialog.. this function blocks
modal->ShowModal();
// After they push "OK" on modal and the OK button calls Hide();
// we destroy the dialog
modal->Destroy();
hope that helps...
What I really am looking for is this:
I have a panel with a button, on the click it initiates a non-modal dialog at this time the button is disabled. When the dialog closes (the user clicks the ok button or the close button) the button should be re-enabled.
The dialog needs to be model since there are controls on the panel that change things on the dialog.
I have a panel with a button, on the click it initiates a non-modal dialog at this time the button is disabled. When the dialog closes (the user clicks the ok button or the close button) the button should be re-enabled.
The dialog needs to be model since there are controls on the panel that change things on the dialog.
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
What happens is the button captures a frame from a video feed and displays the image in a dialog box.
A panel is the parent of the dialog box. It contains controls that are used to change some attributes on the image frame hence why the dialog must be non-model.
When they close the dialog box, obviously the capture button needs to be re-enabled such that another sample can be taken.
Unfortunately the image can not be shown in the panel which would solve a lot of problems hence why the dialog.
A panel is the parent of the dialog box. It contains controls that are used to change some attributes on the image frame hence why the dialog must be non-model.
When they close the dialog box, obviously the capture button needs to be re-enabled such that another sample can be taken.
Unfortunately the image can not be shown in the panel which would solve a lot of problems hence why the dialog.
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
So, what the problem creating non-modal dialog or disabling the buttons.
Disabling the buttons:
Save the pointer of the parent passed in the dialog constructor, and before calling the dialog disable the panel button by Enable(false); in the dialog OK button or in OnClose handler, from the parent pointer call a function to renable the panel button by Enable(true);
Disabling the buttons:
Save the pointer of the parent passed in the dialog constructor, and before calling the dialog disable the panel button by Enable(false); in the dialog OK button or in OnClose handler, from the parent pointer call a function to renable the panel button by Enable(true);
Thats what I am actually implementing now. The problem was that I was making use of a slider for a threshold level on the image. On a slider event it would update the image. So when the dialog box was hidden the images still get updated hence moving the threshold slider was slow/delayed.
I have since then dropped that idea.
Ahhh, I forgot about the close event.
I have since then dropped that idea.
Ahhh, I forgot about the close event.
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact: