BOOST_FOREACH.
[dcpomatic.git] / src / wx / wx_util.cc
index 758d57a80a022a54db586668c638368de534b524..3386b2700c522c7047c4bb0e0c738473cf1b6303 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -44,7 +44,7 @@ DCPOMATIC_ENABLE_WARNINGS
 using std::string;
 using std::vector;
 using std::pair;
-using boost::shared_ptr;
+using std::shared_ptr;
 using boost::optional;
 using dcp::locale_convert;
 using namespace dcpomatic;
@@ -522,7 +522,7 @@ display_progress (wxString title, wxString task)
                dcpomatic_sleep_seconds (1);
                if (!progress.Pulse()) {
                        /* user pressed cancel */
-                       BOOST_FOREACH (shared_ptr<Job> i, jm->get()) {
+                       for (auto i: jm->get()) {
                                i->cancel();
                        }
                        ok = false;
@@ -592,3 +592,14 @@ bitmap_path (string name)
        return std_to_wx (p.string());
 }
 
+
+wxSize
+small_button_size (wxWindow* parent, wxString text)
+{
+       wxClientDC dc (parent);
+       wxSize size = dc.GetTextExtent (text);
+       size.SetHeight (-1);
+       size.IncBy (24, 0);
+       return size;
+}
+