]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/msgdlg.cpp
Deallocate wxThreadSpecificInfo when wxThread ends.
[wxWidgets.git] / src / os2 / msgdlg.cpp
index 7577e564ec2b1b004786c12f527583d4057cfb5e..858ff3d73de5c4c47925cff4ae5fd45e1d4dc601 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      David Webster
 // Modified by:
 // Created:     10/10/99
 // Author:      David Webster
 // Modified by:
 // Created:     10/10/99
-// RCS-ID:      $Id$
 // Copyright:   (c) David Webster
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) David Webster
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
+#include "wx/msgdlg.h"
+
 #ifndef WX_PRECOMP
     #include <stdio.h>
     #include "wx/utils.h"
     #include "wx/dialog.h"
     #include "wx/app.h"
 #ifndef WX_PRECOMP
     #include <stdio.h>
     #include "wx/utils.h"
     #include "wx/dialog.h"
     #include "wx/app.h"
-    #include "wx/msgdlg.h"
     #include "wx/math.h"
 #endif
 
     #include "wx/math.h"
 #endif
 
+#include "wx/modalhook.h"
 #include "wx/os2/private.h"
 
 #include <stdlib.h>
 #include "wx/os2/private.h"
 
 #include <stdlib.h>
 
 IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
 
 
 IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
 
-wxMessageDialog::wxMessageDialog( wxWindow*       WXUNUSED(pParent),
-                                  const wxString& rsMessage,
-                                  const wxString& rsCaption,
-                                  long            lStyle,
-                                  const wxPoint&  WXUNUSED(pPos) )
-{
-    m_sCaption     = rsCaption;
-    m_sMessage     = rsMessage;
-    m_pParent      = NULL; // pParent;
-    SetMessageDialogStyle(lStyle);
-} // end of wxMessageDialog::wxMessageDialog
-
 int wxMessageDialog::ShowModal()
 {
 int wxMessageDialog::ShowModal()
 {
+    WX_HOOK_MODAL_DIALOG();
+
     HWND                            hWnd = 0;
     ULONG                           ulStyle = MB_OK;
     int                             nAns = wxOK;
     HWND                            hWnd = 0;
     ULONG                           ulStyle = MB_OK;
     int                             nAns = wxOK;
@@ -62,8 +53,8 @@ int wxMessageDialog::ShowModal()
             wxTheApp->Dispatch();
     }
 
             wxTheApp->Dispatch();
     }
 
-    if (m_pParent)
-        hWnd = (HWND) m_pParent->GetHWND();
+    if (m_parent)
+        hWnd = (HWND) m_parent->GetHWND();
     else
         hWnd = HWND_DESKTOP;
     if (lStyle & wxYES_NO)
     else
         hWnd = HWND_DESKTOP;
     if (lStyle & wxYES_NO)
@@ -84,14 +75,25 @@ int wxMessageDialog::ShowModal()
         else
             ulStyle = MB_OK;
     }
         else
             ulStyle = MB_OK;
     }
-    if (lStyle & wxICON_EXCLAMATION)
-        ulStyle |= MB_ICONEXCLAMATION;
-    else if (lStyle & wxICON_HAND)
-        ulStyle |= MB_ICONHAND;
-    else if (lStyle & wxICON_INFORMATION)
-        ulStyle |= MB_ICONEXCLAMATION;
-    else if (lStyle & wxICON_QUESTION)
-        ulStyle |= MB_ICONQUESTION;
+
+    switch ( GetEffectiveIcon() )
+    {
+        case wxICON_ERROR:
+            ulStyle |= MB_ERROR;
+            break;
+
+        case wxICON_WARNING:
+            ulStyle |= MB_WARNING;
+            break;
+
+        case wxICON_QUESTION:
+            ulStyle |= MB_QUERY;
+            break;
+
+        case wxICON_INFORMATION:
+            ulStyle |= MB_INFORMATION;
+            break;
+    }
 
     if (hWnd != HWND_DESKTOP)
         ulStyle |= MB_APPLMODAL;
 
     if (hWnd != HWND_DESKTOP)
         ulStyle |= MB_APPLMODAL;
@@ -108,8 +110,8 @@ int wxMessageDialog::ShowModal()
 
     ULONG                           ulAns = ::WinMessageBox( hWnd
                                                             ,hWnd
 
     ULONG                           ulAns = ::WinMessageBox( hWnd
                                                             ,hWnd
-                                                            ,(PSZ)m_sMessage.c_str()
-                                                            ,(PSZ)m_sCaption.c_str()
+                                                            ,GetFullMessage().c_str()
+                                                            ,m_caption.c_str()
                                                             ,0L
                                                             ,ulStyle);
     switch (ulAns)
                                                             ,0L
                                                             ,ulStyle);
     switch (ulAns)