// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
-#ifdef __VMS
-#define XtDisplay XTDISPLAY
-#define XtWindow XTWINDOW
-#define XtParent XTPARENT
-#define XtScreen XTSCREEN
-#endif
-
#include "wx/dialog.h"
#ifndef WX_PRECOMP
#define wxUSE_INVISIBLE_RESIZE 1
-IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow)
-
wxDialog::wxDialog()
{
m_modalShowing = false;
XtSetArg (args[1], XmNautoUnmanage, False);
Widget dialogShell =
XmCreateBulletinBoardDialog( parentWidget,
- wxConstCast(name.mb_str(), char),
+ name.char_str(),
args, 2);
m_mainWidget = (WXWidget) dialogShell;
wxDialog::~wxDialog()
{
- m_isBeingDeleted = true;
+ SendDestroyEvent();
+
+ // if the dialog is modal, this will end its event loop
+ Show(false);
delete m_eventLoop;
{
wxXmString str( title );
XtVaSetValues( (Widget)m_mainWidget,
- XmNtitle, title.mb_str(),
+ XmNtitle, (const char*)title.mb_str(),
XmNdialogTitle, str(),
- XmNiconName, title.mb_str(),
+ XmNiconName, (const char*)title.mb_str(),
NULL );
}
}
if( !wxWindowBase::Show( show ) )
return false;
+ if ( !show && IsModal() )
+ EndModal(wxID_CANCEL);
+
m_isShown = show;
if (show)
{
+ if (CanDoLayoutAdaptation())
+ DoLayoutAdaptation();
+
// this usually will result in TransferDataToWindow() being called
// which will change the controls values so do it before showing as
// otherwise we could have some flicker
// Now process all events in case they get sent to a destroyed dialog
wxFlushEvents( display );
- delete m_eventLoop;
- m_eventLoop = NULL;
+ wxDELETE(m_eventLoop);
// TODO: is it safe to call this, if the dialog may have been deleted
// by now? Probably only if we're using delayed deletion of dialogs.