wxASSERT_MSG( (parentWidget != (Widget) 0), "Could not find a suitable parent shell for dialog." );
- Arg args[1];
+ Arg args[2];
XtSetArg (args[0], XmNdefaultPosition, False);
- Widget dialogShell = XmCreateBulletinBoardDialog(parentWidget, (char*) (const char*) name, args, 1);
+ XtSetArg (args[1], XmNautoUnmanage, False);
+ Widget dialogShell = XmCreateBulletinBoardDialog(parentWidget, (char*) (const char*) name, args, 2);
m_mainWidget = (WXWidget) dialogShell;
// We don't want margins, since there is enough elsewhere.
// Note that this might need to be done for wxFrame also.
DestroyChildren();
+ // This causes a crash in e.g. the resource sample when closing
+ // the example dialog. TODO: Probably not necessary (?)
+#if 0
// Now process all events, because otherwise
// this might remain on the screen.
Display* display;
XtAppNextEvent((XtAppContext) wxTheApp->GetAppContext(), &event);
XtDispatchEvent(&event);
}
+#endif
}
// By default, pressing escape cancels the dialog
m_modalShowing = TRUE;
XtAddGrab((Widget) m_mainWidget, TRUE, FALSE);
+
XEvent event;
// Loop until we signal that the dialog should be closed
- while ((wxModalShowingStack.Number() > 0) && (bool)wxModalShowingStack.First()->Data())
+ while ((wxModalShowingStack.Number() > 0) && ((int)(wxModalShowingStack.First()->Data()) != 0))
{
- XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
+// XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
+
+ XtAppNextEvent((XtAppContext) wxTheApp->GetAppContext(), &event);
+ wxTheApp->ProcessXEvent((WXEvent*) &event);
}
// Remove modal dialog flag from stack
{
XFlush(XtDisplay((Widget) wxTheApp->GetTopLevelWidget()));
XtAppNextEvent((XtAppContext) wxTheApp->GetAppContext(), &event);
- XtDispatchEvent(&event);
+
+ wxTheApp->ProcessXEvent((WXEvent*) &event);
}
// TODO: is it safe to call this, if the dialog may have been deleted
SetReturnCode(retCode);
- XtRemoveGrab((Widget) m_mainWidget);
+ // Strangely, we don't seem to need this now.
+ // XtRemoveGrab((Widget) m_mainWidget);
Show(FALSE);
*/
}
-void wxDialog::ChangeFont(bool WXUNUSED(keepOriginalSize))
+void wxDialog::ChangeFont(bool keepOriginalSize)
{
- // TODO
+ wxWindow::ChangeFont(keepOriginalSize);
}
void wxDialog::ChangeBackgroundColour()
{
- // TODO
+ if (GetMainWidget())
+ DoChangeBackgroundColour(GetMainWidget(), m_backgroundColour);
}
void wxDialog::ChangeForegroundColour()
{
- // TODO
+ if (GetMainWidget())
+ DoChangeForegroundColour(GetMainWidget(), m_foregroundColour);
}