New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting width of display area of slider value #285
Comments
Some parts of the given answer with code suggestions: The problem is that the size is hardcoded to 35 for horizontal or 25 for vertical. You need to modify Fl_Value_Slider.cxx. In the routine draw, it has if (horizontal()) {
bww = 35; sxx += 35; sww -= 35;
} else {
syy += 25; bhh = 25; shh -= 25;
} This is based on a textsize of 10. If you change the text size, then it needs to go up based on the text size. Something like if (horizontal()) {
int width = textsize() * 3 + 5;
bww = width; sxx += width; sww -= width;
} else {
int height = textsize() * 2 + 5;
syy += height; bhh = height; shh -= height;
} Then rebuild the fltk library. Either keep this patch or send it to FLTK ... Thanks to In the final version this should likely get a new method to set the different drawing sizes. This is not only true for |
All value sliders in 1.4 have the method https://www.fltk.org/doc-1.4/classFl__Value__Slider.html#af2e23cdfcd2417445d08e6f8a3783dfd |
The method @MatthiasWM My point "... and some more widgets" was off the top of my head and should be interpreted that there are some other widgets with hardcoded values, sizes, or colors for some aspects. Since I don't know which ones there are two options: you can either search for such hardcoded properties that users can't change, or ... we close this issue and wait for other reports. I wouldn't mind if you closed it as "fixed". |
Referring to stackoverflow question "FLTK Setting width of display area of slider value":
We should consider making the value display size of sliders changeable by the user so they can use larger numbers or larger fonts.
Citation from the question: "I was wondering how to change the width of the area responsible for showing the current value of a Fl_Hor_Value_Slider. The thing is, I want to be able to select a year (that's 4 digits) and the space on the side of the slider is not enough to display the year number correctly."
The text was updated successfully, but these errors were encountered: