]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dialog.cpp
argc == 0 bug fixed
[wxWidgets.git] / src / msw / dialog.cpp
index d64bf0d7e771bfded96d41f0c47ae027af15a1de..60ee421c6914d997cfe416f6a7d57a29805b3b41 100644 (file)
@@ -29,6 +29,7 @@
 #endif
 
 #include "wx/msw/private.h"
+#include "wx/log.h"
 
 #if wxUSE_COMMON_DIALOGS
 #include <commdlg.h>
@@ -57,11 +58,6 @@ extern wxList WXDLLEXPORT wxPendingDelete;
     END_EVENT_TABLE()
 #endif
 
-bool wxDialog::MSWProcessMessage(WXMSG* pMsg)
-{
-  return (::IsDialogMessage((HWND) GetHWND(), (MSG*)pMsg) != 0);
-}
-
 bool wxDialog::MSWOnClose(void)
 {
     return Close();
@@ -212,13 +208,13 @@ void wxDialog::OnCharHook(wxKeyEvent& event)
   {
     if (event.m_keyCode == WXK_ESCAPE)
     {
-    // Behaviour changed in 2.0: we'll send a Cancel message
-    // to the dialog instead of Close.
-    wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
-    cancelEvent.SetEventObject( this );
-    GetEventHandler()->ProcessEvent(cancelEvent);
+        // Behaviour changed in 2.0: we'll send a Cancel message
+        // to the dialog instead of Close.
+        wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
+        cancelEvent.SetEventObject( this );
+        GetEventHandler()->ProcessEvent(cancelEvent);
 
-    return;
+        return;
     }
   }
   // We didn't process this event.
@@ -247,11 +243,11 @@ bool wxDialog::IsIconized(void) const
   return FALSE;
 }
 
-void wxDialog::SetClientSize(int width, int height)
+void wxDialog::DoSetClientSize(int width, int height)
 {
   HWND hWnd = (HWND) GetHWND();
   RECT rect;
-  GetClientRect(hWnd, &rect);
+  ::GetClientRect(hWnd, &rect);
 
   RECT rect2;
   GetWindowRect(hWnd, &rect2);
@@ -360,12 +356,14 @@ bool wxDialog::Show(bool show)
       // a message before the deletion.
       while (wxModalDialogs.Member(this) && m_modalShowing && GetMessage(&msg, NULL, 0, 0))
       {
-        if (m_acceleratorTable.Ok() &&
-          ::TranslateAccelerator((HWND) GetHWND(), (HACCEL) m_acceleratorTable.GetHACCEL(), &msg))
+        if ( m_acceleratorTable.Ok() &&
+             ::TranslateAccelerator((HWND)GetHWND(),
+                                     (HACCEL)m_acceleratorTable.GetHACCEL(),
+                                     &msg) )
         {
             // Have processed the message
         }
-        else if (!IsDialogMessage((HWND) GetHWND(), &msg))
+        else if ( !wxTheApp->ProcessMessage((WXMSG *)&msg) )
         {
           TranslateMessage(&msg);
           DispatchMessage(&msg);
@@ -559,7 +557,7 @@ void wxDialog::OnCancel(wxCommandEvent& event)
     else
     {
         SetReturnCode(wxID_CANCEL);
-    this->Show(FALSE);
+        this->Show(FALSE);
     }
 }