]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dialog.cpp
somehow log target wasn't being created automatically anymore. Restored.
[wxWidgets.git] / src / msw / dialog.cpp
index 4c8cbcbae703bdc7bdd652edd0cec27c7a859156..a55bda8b5c3750919f0505ffc7a9c39ccd4a73cd 100644 (file)
@@ -351,7 +351,12 @@ bool wxDialog::Show(bool show)
       // a message before the deletion.
       while (wxModalDialogs.Member(this) && m_modalShowing && GetMessage(&msg, NULL, 0, 0))
       {
-        if (!IsDialogMessage((HWND) GetHWND(), &msg))
+        if (m_acceleratorTable.Ok() &&
+          ::TranslateAccelerator((HWND) GetHWND(), (HACCEL) m_acceleratorTable.GetHACCEL(), &msg))
+        {
+            // Have processed the message
+        }
+        else if (!IsDialogMessage((HWND) GetHWND(), &msg))
         {
           TranslateMessage(&msg);
           DispatchMessage(&msg);
@@ -459,27 +464,19 @@ void wxDialog::Centre(int direction)
   int x_offset,y_offset ;
   int display_width, display_height;
   int  width, height, x, y;
-  wxFrame *frame ;
-  if (direction & wxCENTER_FRAME)
+  wxWindow *parent = GetParent();
+  if ((direction & wxCENTER_FRAME) && parent)
   {
-    frame = (wxFrame*)GetParent() ;
-    if (frame)
-    {
-      frame->GetPosition(&x_offset,&y_offset) ;
-      frame->GetSize(&display_width,&display_height) ;
-    }
+      parent->GetPosition(&x_offset,&y_offset) ;
+      parent->GetSize(&display_width,&display_height) ;
   }
   else
-    frame = NULL ;
-
-  if (frame==NULL)
   {
     wxDisplaySize(&display_width, &display_height);
     x_offset = 0 ;
     y_offset = 0 ;
   }
 
-
   GetSize(&width, &height);
   GetPosition(&x, &y);