Merge master.
[dcpomatic.git] / src / wx / wx_util.cc
index 632dbc32e034b8ee39b8d507bfff97779a43b005..720a058cb771425b67f0828aed0ba7f9fb8deb63 100644 (file)
@@ -43,6 +43,14 @@ add_label_to_sizer (wxSizer* s, wxWindow* p, wxString t, int prop)
        return m;
 }
 
+wxStaticText *
+add_label_to_grid_bag_sizer (wxGridBagSizer* s, wxWindow* p, wxString t, wxGBPosition pos, wxGBSpan span)
+{
+       wxStaticText* m = new wxStaticText (p, wxID_ANY, t);
+       s->Add (m, pos, span, wxALIGN_CENTER_VERTICAL | wxALL, 6);
+       return m;
+}
+
 /** Pop up an error dialogue box.
  *  @param parent Parent.
  *  @param m Message.
@@ -170,6 +178,14 @@ checked_set (wxTextCtrl* widget, string value)
        }
 }
 
+void
+checked_set (wxStaticText* widget, string value)
+{
+       if (widget->GetLabel() != std_to_wx (value)) {
+               widget->SetLabel (std_to_wx (value));
+       }
+}
+
 void
 checked_set (wxCheckBox* widget, bool value)
 {