Add option to give HTMLDialog an OK button.
[dcpomatic.git] / src / wx / html_dialog.cc
index cce62e1eb6a4291c40de4dc45943e3092c55bb1b..19c3aaf2a11591987678cf666f105d66c5e7cbd1 100644 (file)
@@ -35,7 +35,7 @@ using namespace boost::placeholders;
 #endif
 
 
-HTMLDialog::HTMLDialog (wxWindow* parent, wxString title, wxString html)
+HTMLDialog::HTMLDialog (wxWindow* parent, wxString title, wxString html, bool ok)
        : wxDialog (parent, wxID_ANY, title)
 {
        auto sizer = new wxBoxSizer (wxVERTICAL);
@@ -62,6 +62,13 @@ HTMLDialog::HTMLDialog (wxWindow* parent, wxString title, wxString html)
 
        /* Set height */
        SetSize (h->GetInternalRepresentation()->GetWidth(), h->GetInternalRepresentation()->GetHeight() + 256);
+
+       if (ok) {
+               auto buttons = CreateSeparatedButtonSizer(wxOK);
+               if (buttons) {
+                       sizer->Add(buttons, wxSizerFlags().Expand().DoubleBorder());
+               }
+       }
 }