|
|
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR Active]
Link: https://www.fltk.org/str.php?L3533
Version: 1.3-feature
I'm still testing and trying some modifications but I can report progress
as promised:
For now I refactored the sources of Fl_Counter, including functions as you
suggested and some more. The gist of the current mods is that I introduced
upper and lower size *limits* for the arrow boxes which prevent those large
arrows as the old Fl_Counter could draw. I kept the fl_symbol arrow drawing
for now but this is now contained in one function.
My intention is to further refactor Fl_Counter to enable users to derive
their own classes easier to do such things like you did with "pretty arrow
drawing" or other mods.
Note: I'm using Fl_Counter as a prototype and I intend to modify similar
widgets (sliders, valuators) in similar ways, but that's ... future.
My work in progress has these two protected members that might help you or
others to derive their own classes:
void compute_sizes(int *xx, int *ww);
void draw_arrow(int i, Fl_Boxtype boxtype, int X, int W, Fl_Color col);
// index i = 1..4
Just FYI for now, but this is all subject to be changed. I'm not yet
posting source code because it's still in development.
I attach an image that compares the old Fl_Counter with my modified version
in a test program after resizing (enlarging) the windows by a similar
amount. See 'Fl_Counter_limit-v1.png'.
Link: https://www.fltk.org/str.php?L3533
Version: 1.3-feature Attachment:
Fl_Counter_limit-v1.png
Description: PNG image
[ Direct Link to Message ] | |
|
| |