]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stubs/dialog.cpp
(very) preliminary DnD docs
[wxWidgets.git] / src / stubs / dialog.cpp
index 9b72fb0f6952560a2ac85697b6c37560d8025e99..7d6d99744dcbc0babd40e4453f57a8136bab0f75 100644 (file)
@@ -107,10 +107,8 @@ wxDialog::~wxDialog()
 // By default, pressing escape cancels the dialog
 void wxDialog::OnCharHook(wxKeyEvent& event)
 {
-  if (GetHWND())
+  if (event.m_keyCode == WXK_ESCAPE)
   {
-    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);
@@ -118,7 +116,6 @@ void wxDialog::OnCharHook(wxKeyEvent& event)
                GetEventHandler()->ProcessEvent(cancelEvent);
 
                return;
-    }
   }
   // We didn't process this event.
   event.Skip();
@@ -167,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 ;
@@ -292,3 +282,6 @@ void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& event)
   Refresh();
 }
 
+void wxDialog::Fit()
+{
+}