Switch the content advanced dialogue to use GridBagSizer.
authorCarl Hetherington <cth@carlh.net>
Sat, 27 Jun 2020 20:49:05 +0000 (22:49 +0200)
committerCarl Hetherington <cth@carlh.net>
Sat, 27 Jun 2020 20:49:05 +0000 (22:49 +0200)
src/wx/content_advanced_dialog.cc
src/wx/content_advanced_dialog.h

index c97047c737c164487e9c68ae916ee5281cdb0e6f..4b13a67d2cc74570ca64480886adab6e0f4146d0 100644 (file)
 */
 
 #include "content_advanced_dialog.h"
 */
 
 #include "content_advanced_dialog.h"
+#include "wx_util.h"
 #include "lib/content.h"
 #include "lib/video_content.h"
 #include "lib/content.h"
 #include "lib/video_content.h"
+#include <wx/gbsizer.h>
 #include <boost/bind.hpp>
 
 using boost::bind;
 using boost::shared_ptr;
 
 ContentAdvancedDialog::ContentAdvancedDialog (wxWindow* parent, shared_ptr<Content> content)
 #include <boost/bind.hpp>
 
 using boost::bind;
 using boost::shared_ptr;
 
 ContentAdvancedDialog::ContentAdvancedDialog (wxWindow* parent, shared_ptr<Content> content)
-       : TableDialog (parent, _("Advanced content settings"), 2, 0, false)
+       : wxDialog (parent, wxID_ANY, _("Advanced content settings"))
        , _content (content)
 {
        , _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"));
        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<bool>(_content->video));
        ignore_video->SetValue (_content->video ? !content->video->use() : false);
 
        ignore_video->Enable (static_cast<bool>(_content->video));
        ignore_video->SetValue (_content->video ? !content->video->use() : false);
index 79b4be85c8e53452bfcec1e201af35dcdfadb93f..5fec35412cecd26403427421b4088e9d5e2d0016 100644 (file)
 */
 
 
 */
 
 
-#include "table_dialog.h"
+#include <wx/wx.h>
 #include <boost/shared_ptr.hpp>
 
 
 class Content;
 
 
 #include <boost/shared_ptr.hpp>
 
 
 class Content;
 
 
-class ContentAdvancedDialog : public TableDialog
+class ContentAdvancedDialog : public wxDialog
 {
 public:
        ContentAdvancedDialog (wxWindow* parent, boost::shared_ptr<Content> content);
 {
 public:
        ContentAdvancedDialog (wxWindow* parent, boost::shared_ptr<Content> content);