summaryrefslogtreecommitdiff
path: root/src/wx/content_widget.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-06-09 23:56:33 +0100
committerCarl Hetherington <cth@carlh.net>2014-06-09 23:56:33 +0100
commit93c996b302589dee7d43d990f3650d636345a545 (patch)
tree976732dc7774b8b4ae5a3f2490bc4a6259d2892b /src/wx/content_widget.h
parent7e690d21278df14b113f3602cbbd43f6214fd614 (diff)
Use a SpinCtrlDouble for audio gain, and change its representation
from float to double. Requested-by: Mattias Mattsson
Diffstat (limited to 'src/wx/content_widget.h')
-rw-r--r--src/wx/content_widget.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/wx/content_widget.h b/src/wx/content_widget.h
index 30501c1a9..ca9485006 100644
--- a/src/wx/content_widget.h
+++ b/src/wx/content_widget.h
@@ -222,6 +222,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>
{