From d3dbe752a3098328d5763f3fc0fd589bac0d5047 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 27 Jun 2020 22:49:05 +0200 Subject: [PATCH] Switch the content advanced dialogue to use GridBagSizer. --- src/wx/content_advanced_dialog.cc | 20 ++++++++++++++++---- src/wx/content_advanced_dialog.h | 4 ++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/wx/content_advanced_dialog.cc b/src/wx/content_advanced_dialog.cc index c97047c73..4b13a67d2 100644 --- a/src/wx/content_advanced_dialog.cc +++ b/src/wx/content_advanced_dialog.cc @@ -19,22 +19,34 @@ */ #include "content_advanced_dialog.h" +#include "wx_util.h" #include "lib/content.h" #include "lib/video_content.h" +#include #include using boost::bind; using boost::shared_ptr; ContentAdvancedDialog::ContentAdvancedDialog (wxWindow* parent, shared_ptr content) - : TableDialog (parent, _("Advanced content settings"), 2, 0, false) + : wxDialog (parent, wxID_ANY, _("Advanced content settings")) , _content (content) { + wxGridBagSizer* sizer = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); + + int r = 0; wxCheckBox* ignore_video = new wxCheckBox (this, wxID_ANY, _("Ignore this content's video and use only audio, subtitles and closed captions")); - add (ignore_video); - add_spacer (); + sizer->Add (ignore_video, wxGBPosition(r, 0), wxGBSpan(1, 2)); + ++r; + + wxSizer* overall = new wxBoxSizer (wxVERTICAL); + overall->Add (sizer, 1, wxALL, DCPOMATIC_DIALOG_BORDER); + wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL); + if (buttons) { + overall->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); + } - layout (); + SetSizerAndFit (overall); ignore_video->Enable (static_cast(_content->video)); ignore_video->SetValue (_content->video ? !content->video->use() : false); diff --git a/src/wx/content_advanced_dialog.h b/src/wx/content_advanced_dialog.h index 79b4be85c..5fec35412 100644 --- a/src/wx/content_advanced_dialog.h +++ b/src/wx/content_advanced_dialog.h @@ -19,14 +19,14 @@ */ -#include "table_dialog.h" +#include #include class Content; -class ContentAdvancedDialog : public TableDialog +class ContentAdvancedDialog : public wxDialog { public: ContentAdvancedDialog (wxWindow* parent, boost::shared_ptr content); -- 2.30.2