]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stubs/dialog.cpp
wxEVT_COMMAND_CHOICE_SELECTED => wxEVT_COMMAND_COMBOBOX_SELECTED
[wxWidgets.git] / src / stubs / dialog.cpp
index d29f2bbc8f7447b483b7ab7bf9ab70ac3d191a3b..7d6d99744dcbc0babd40e4453f57a8136bab0f75 100644 (file)
@@ -164,20 +164,13 @@ 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 ;