diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-11-22 19:19:19 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2022-11-22 19:32:54 +0100 |
| commit | ecc47d0cc3e1784e17ac94829202f2bdbd38a682 (patch) | |
| tree | 2519c9b11a598ed4ad1faf9d07c205da5c4903c7 /FL/Fl_Counter.H | |
| parent | 4daec2a9408c674f8d62f8770ec8c035c25f2294 (diff) | |
Refactor and simplify "arrow drawing" in widgets
"Arrows" in widgets are those GUI elements mostly represented by
triangles pointing in a particular direction as in scrollbars,
choice widgets, some menus, valuators and Fl_Counter widgets.
The code has been simplified and standardized such that all these
GUI elements are drawn identically per FLTK scheme.
Widget authors no longer need to write code to calculate arrow sizes
and draw polygons etc.
Different schemes can and do implement different drawing functions.
Todo: see comments "FIXME_ARROW" in src/Fl_Menu_Button.cxx and
src/Fl_Menu.cxx
Diffstat (limited to 'FL/Fl_Counter.H')
| -rw-r--r-- | FL/Fl_Counter.H | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/FL/Fl_Counter.H b/FL/Fl_Counter.H index 7553416e7..fc1ce48f0 100644 --- a/FL/Fl_Counter.H +++ b/FL/Fl_Counter.H @@ -49,7 +49,7 @@ class FL_EXPORT Fl_Counter : public Fl_Valuator { Fl_Fontsize textsize_; Fl_Color textcolor_; double lstep_; - uchar mouseobj; + uchar mouseobj_; static void repeat_callback(void *); int calc_mouseobj(); void increment_cb(); @@ -57,6 +57,8 @@ class FL_EXPORT Fl_Counter : public Fl_Valuator { protected: void draw(); + // compute widths of arrow boxes + void arrow_widths(int &w1, int &w2); public: |
