Value slider's value display box size

조회수 24회
읽지 않은 첫 메시지로 건너뛰기

Vimal Parikh

읽지 않음,
2016. 12. 22. 오후 1:58:4216. 12. 22.
받는사람 fltk.general
I have created a value slider with following parameters:

min = 0.0
max = 1.0
step = 0.005

The slider is showing ok but the value display area (i.e. between label and slider) is not wide enough to show 4 digits (i.e. 0.000)
Is there a way to increase the size of the value display box?

Vimal Parikh

Albrecht Schlosser

읽지 않음,
2016. 12. 23. 오후 12:18:0416. 12. 23.
받는사람 fltkg...@googlegroups.com
No, unfortunately not. The width of the value display box is currently
hard coded with a fixed size of 35 pixels.

This is a known issue that should be improved in FLTK 1.4 and there is
STR #3222 that provides a patch for 1.3.4:
http://www.fltk.org/str.php?L3222
http://www.fltk.org/strfiles/3222/Fl_Value_Slider.patch

For now you can try if this patch can help you (it makes the value
display width user settable). It applies cleanly to FLTK 1.3.4, but I
didn't really test its behavior. It looks correct at a first glance.

Anyway: if you use it please be aware that the given API may change in
FLTK 1.4 if it is included in the library.

Advanced mode: If you don't want to patch your FLTK library you can
derive your own widget from Fl_Value_Slider and override the draw() and
maybe also the handle() method...

Karl Harbinger

읽지 않음,
2016. 12. 31. 오전 10:56:5616. 12. 31.
받는사람 fltk.general
Is it possible to just put the value text below the slider?

Ian MacArthur

읽지 않음,
2016. 12. 31. 오전 11:01:2416. 12. 31.
받는사람 fltkg...@googlegroups.com
On 31 Dec 2016, at 15:56, Karl Harbinger wrote:

Is it possible to just put the value text below the slider?


I seem to recall Greg’s cheatsheet having a few examples of things to do with displaying the value of a slider, so there may well be something there you can copy.


Probably starting with something like: http://seriss.com/people/erco/fltk/#SliderInput or http://seriss.com/people/erco/fltk/#SliderTooltip and then tweaking from there?



Vimal Parikh

읽지 않음,
2017. 1. 3. 오후 12:24:5317. 1. 3.
받는사람 fltk.general, Albrech...@online.de
Hi Albrecht-

I tried the patch for 1.3.4 and it works perfectly.
Thanks.

PS: the SlideInput group gadget from Greg's cheat sheet looks good too. I may try that next.

Vimal
전체답장
작성자에게 답글
전달
새 메시지 0개