FLTK logo

Re: [RFE] STR #3533: Fl_Counter with fixed arrow widths - preliminary code sample

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.bugs  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [RFE] STR #3533: Fl_Counter with fixed arrow widths - preliminary code sample Albrecht Schlosser Nov 16, 2020  
 
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 ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.