+
+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));
+ dlg.CentreOnScreen();
+ dlg.ShowModal();
+}
+
+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));
+ dlg.CentreOnParent();
+ dlg.ShowModal();
+}
+