X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9b135950383287e57c465f19879238fb7150a2fa..d3b6beab1cb0dcf2c689cb76993a4ad60eb2e311:/src/motif/dialog.cpp diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp index 9eceb43581..3955a68d45 100644 --- a/src/motif/dialog.cpp +++ b/src/motif/dialog.cpp @@ -12,13 +12,6 @@ // 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 @@ -75,7 +68,6 @@ wxDialog::wxDialog() { m_modalShowing = false; m_eventLoop = NULL; - m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); } bool wxDialog::Create(wxWindow *parent, wxWindowID id, @@ -94,16 +86,10 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id, m_modalShowing = false; m_eventLoop = NULL; - m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); - m_foregroundColour = *wxBLACK; - Widget dialogShell = (Widget) m_mainWidget; SetTitle( title ); - m_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); - ChangeFont(false); - // Can't remember what this was about... but I think it's necessary. #if wxUSE_INVISIBLE_RESIZE if (pos.x > -1) @@ -135,7 +121,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id, XtAddEventHandler(dialogShell,ExposureMask,False, wxUniversalRepaintProc, (XtPointer) this); - ChangeBackgroundColour(); + PostCreation(); return true; } @@ -162,7 +148,7 @@ bool wxDialog::XmDoCreateTLW(wxWindow* parent, XtSetArg (args[1], XmNautoUnmanage, False); Widget dialogShell = XmCreateBulletinBoardDialog( parentWidget, - wxConstCast(name.mb_str(), char), + name.char_str(), args, 2); m_mainWidget = (WXWidget) dialogShell; @@ -197,6 +183,9 @@ wxDialog::~wxDialog() { m_isBeingDeleted = true; + // if the dialog is modal, this will end its event loop + Show(false); + delete m_eventLoop; if (m_mainWidget) @@ -243,9 +232,9 @@ void wxDialog::SetTitle(const wxString& title) { 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 ); } } @@ -255,10 +244,16 @@ bool wxDialog::Show( bool show ) 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