+
+// Common processing to invert slider values based on wxSL_INVERSE
+int wxSlider::ValueInvertOrNot(int value) const
+{
+ if (m_windowStyle & wxSL_VERTICAL)
+ {
+ // The reason for the backwards logic is that Mac's vertical sliders are
+ // inverted compared to Windows and GTK, hence we want inversion to be the
+ // default, and if wxSL_INVERSE is set, then we do not invert (use native)
+ if (m_windowStyle & wxSL_INVERSE)
+ return value;
+ else
+ return (m_rangeMax + m_rangeMin) - value;
+ }
+ else // normal logic applies to HORIZONTAL sliders
+ {
+ return wxSliderBase::ValueInvertOrNot(value);
+ }
+}
+
+#endif // wxUSE_SLIDER