summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-07-07 15:21:04 +0200
committerCarl Hetherington <cth@carlh.net>2022-07-20 10:25:54 +0200
commit704bc0f8be05ddca94a3853a6e112f22f8f2df70 (patch)
tree5260a018bc1ec58b729e61b84589971c2f8ef01f /src
parent5d171ed359993d2be4bc7e0e52de329cc9fca091 (diff)
Add option to give HTMLDialog an OK button.
Diffstat (limited to 'src')
-rw-r--r--src/wx/html_dialog.cc9
-rw-r--r--src/wx/html_dialog.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/src/wx/html_dialog.cc b/src/wx/html_dialog.cc
index cce62e1eb..19c3aaf2a 100644
--- a/src/wx/html_dialog.cc
+++ b/src/wx/html_dialog.cc
@@ -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());
+ }
+ }
}
diff --git a/src/wx/html_dialog.h b/src/wx/html_dialog.h
index 1792d86ed..c5a538a5c 100644
--- a/src/wx/html_dialog.h
+++ b/src/wx/html_dialog.h
@@ -31,7 +31,7 @@ class wxHtmlLinkEvent;
class HTMLDialog : public wxDialog
{
public:
- HTMLDialog (wxWindow* parent, wxString title, wxString html);
+ HTMLDialog (wxWindow* parent, wxString title, wxString html, bool ok = false);
private:
void link_clicked (wxHtmlLinkEvent& ev);