]> git.saurik.com Git - wxWidgets.git/commitdiff
test centering file dialog on parent frame
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 21 Apr 2006 13:10:51 +0000 (13:10 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 21 Apr 2006 13:10:51 +0000 (13:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38872 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/dialogs/dialogs.cpp

index c6fd7e18fc768043ed3da5c1940f9594acecd80a..13a84b1546fe065e6264a27b2d896fbe639dfa44 100644 (file)
@@ -696,8 +696,8 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) )
 #endif
                  );
 
-    dialog.SetDirectory(wxGetHomeDir());
     dialog.CentreOnParent();
+    dialog.SetDirectory(wxGetHomeDir());
 
     if (dialog.ShowModal() == wxID_OK)
     {
@@ -968,7 +968,7 @@ void MyFrame::DlgCenteredScreen(wxCommandEvent& WXUNUSED(event))
 {
     wxDialog dlg(this, wxID_ANY, _T("Dialog centered on screen"),
                  wxDefaultPosition, wxSize(200, 100));
-    new wxButton(&dlg, wxID_OK, _T("Close"), wxPoint(10, 10));
+    (new wxButton(&dlg, wxID_OK, _T("Close")))->Centre();
     dlg.CentreOnScreen();
     dlg.ShowModal();
 }
@@ -977,7 +977,7 @@ void MyFrame::DlgCenteredParent(wxCommandEvent& WXUNUSED(event))
 {
     wxDialog dlg(this, wxID_ANY, _T("Dialog centered on parent"),
                  wxDefaultPosition, wxSize(200, 100));
-    new wxButton(&dlg, wxID_OK, _T("Close"), wxPoint(10, 10));
+    (new wxButton(&dlg, wxID_OK, _T("Close")))->Centre();
     dlg.CentreOnParent();
     dlg.ShowModal();
 }