Merge master.
[dcpomatic.git] / src / wx / content_widget.h
index 30501c1a95f513700289e31fe183874e473ade80..9e1338b7c880eda03c5bfbeed58e00110d4fe94b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
 */
 
+/** @file  src/wx/content_widget.h
+ *  @brief ContentWidget class.
+ */
+
 #ifndef DCPOMATIC_MULTIPLE_WIDGET_H
 #define DCPOMATIC_MULTIPLE_WIDGET_H
 
@@ -26,7 +30,8 @@
 #include <boost/function.hpp>
 #include "wx_util.h"
 
-/** A widget which represents some Content state and which can be used
+/** @class ContentWidget
+ *  @brief A widget which represents some Content state and which can be used
  *  when multiple pieces of content are selected.
  *
  *  @param S Type containing the content being represented (e.g. VideoContent)
@@ -222,6 +227,30 @@ public:
        }
 };
 
+template <class S>
+class ContentSpinCtrlDouble : public ContentWidget<S, wxSpinCtrlDouble, double, double>
+{
+public:
+       ContentSpinCtrlDouble (
+               wxWindow* parent,
+               wxSpinCtrlDouble* wrapped,
+               int property,
+               boost::function<double (S*)> getter,
+               boost::function<void (S*, double)> setter
+               )
+               : ContentWidget<S, wxSpinCtrlDouble, double, double> (
+                       parent,
+                       wrapped,
+                       property,
+                       getter, setter,
+                       &caster<double, double>,
+                       &caster<double, double>
+                       )
+       {
+               wrapped->Bind (wxEVT_COMMAND_SPINCTRLDOUBLE_UPDATED, boost::bind (&ContentWidget<S, wxSpinCtrlDouble, double, double>::view_changed, this));
+       }
+};
+
 template <class S, class U>
 class ContentChoice : public ContentWidget<S, wxChoice, U, int>
 {