33 #define RANGE_INT_MAX 1000000
55 QAbstractSlider* slider)
60 slider->setTracking (
false);
62 slider->setOrientation (bb(2) > bb(3) ? Qt::Horizontal : Qt::Vertical);
64 slider->setMinimum (0);
69 if (value.
numel () > 0)
73 slider->setValue (
xround (((value(0) - dmin) / (dmax - dmin))
88 QScrollBar* slider = qWidget<QScrollBar> ();
106 if (value.
numel () > 0)
108 int ival =
xround (((value(0) - dmin) / (dmax - dmin))
112 slider->setValue (ival);
139 int ival_tmp = (value.numel () > 0 ?
140 xround (((value(0) - dmin) / (dmax - dmin))
144 if (ival != ival_tmp || value.numel () > 0)
146 double dval = dmin + (ival * (dmax - dmin) / RANGE_INT_MAX);
static SliderControl * create(const graphics_object &go)
static void post_callback(const graphics_handle &h, const std::string &name, const octave_value &data=Matrix())
Matrix get_boundingbox(bool internal=false, const Matrix &parent_pix_size=Matrix()) const
octave_idx_type numel(void) const
Number of elements in the array.
SliderControl(const graphics_object &go, QAbstractSlider *slider)
static Object * parentObject(const graphics_object &go)
virtual Container * innerContainer(void)=0
octave_value get_sliderstep(void) const
Matrix matrix_value(bool frc_str_conv=false) const
void valueChanged(int ival)
double get_min(void) const
graphics_object object(void) const
bool valid_object(void) const
octave_value get_value(void) const
double get_max(void) const
static void post_set(const graphics_handle &h, const std::string &name, const octave_value &value, bool notify_toolkit=true)