diff options
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Enumerations.H | 55 | ||||
| -rw-r--r-- | FL/Fl_Counter.H | 4 | ||||
| -rw-r--r-- | FL/Fl_Spinner.H | 4 | ||||
| -rw-r--r-- | FL/fl_draw.H | 21 |
4 files changed, 72 insertions, 12 deletions
diff --git a/FL/Enumerations.H b/FL/Enumerations.H index 365f3fa3f..11a75947a 100644 --- a/FL/Enumerations.H +++ b/FL/Enumerations.H @@ -1,7 +1,7 @@ // // Enumerations for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2020 by Bill Spitzak and others. +// Copyright 1998-2022 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -1223,4 +1223,57 @@ enum Fl_Damage { // FLTK 1.0.x compatibility definitions (FLTK_1_0_COMPAT) dropped in 1.4.0 +/** Arrow types define the type of arrow drawing function. + + FLTK schemes can draw several graphical elements in their particular way. + One of these elements is an arrow type that can be in different GUI + elements like scrollbars, choice buttons, and FLTK's Fl_Return_Button. + + \note This enum is not yet stable (as of FLTK 1.4.0) and may be changed + without notice as necessary. + + \since 1.4.0 +*/ + +enum Fl_Arrow_Type { + FL_ARROW_SINGLE = 0x01, ///< Single arrow, e.g. in Fl_Scrollbar + FL_ARROW_DOUBLE = 0x02, ///< Double arrow, e.g. in Fl_Counter + FL_ARROW_CHOICE = 0x03, ///< Dropdown box, e.g. in Fl_Choice + FL_ARROW_RETURN = 0x04 ///< Return arrow, e.g. in Fl_Return_Button +}; + +/** Fl_Orientation describes the orientation of a GUI element. + + FLTK schemes can draw several graphical elements, for instance arrows, + pointing at different directions. This enum defines the direction + to use for drawing a particular GUI element. + + The definition of this enum was chosen such that the enum value can + be multiplied by 45 to get a rotation angle in degrees starting + at the horizontal axis (0 = right, 1 = NE, 2 = up, ...) that can be + used with fl_rotate(). Note: angle is counter-clockwise in degrees. + + The 'unspecified' value \b FL_ORIENT_NONE shall be used for elements + that would usually not be rotated, like the return arrow of the + Fl_Return_Button. It can still be used as an angle though since it is + the same value as \p FL_ORIENT_RIGHT (0 degrees). + + \note This enum is not yet stable (as of FLTK 1.4.0) and may be changed + without notice as necessary. + + \since 1.4.0 +*/ + +enum Fl_Orientation { + FL_ORIENT_NONE = 0x00, ///< GUI element direction is unspecified + FL_ORIENT_RIGHT = 0x00, ///< GUI element pointing right ( 0°) + FL_ORIENT_NE = 0x01, ///< GUI element pointing NE ( 45°) + FL_ORIENT_UP = 0x02, ///< GUI element pointing up ( 90°) + FL_ORIENT_NW = 0x03, ///< GUI element pointing NW (135°) + FL_ORIENT_LEFT = 0x04, ///< GUI element pointing left (180°) + FL_ORIENT_SW = 0x05, ///< GUI element pointing SW (225°) + FL_ORIENT_DOWN = 0x06, ///< GUI element pointing down (270°) + FL_ORIENT_SE = 0x07 ///< GUI element pointing SE (315°) +}; + #endif 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: diff --git a/FL/Fl_Spinner.H b/FL/Fl_Spinner.H index 541078a8f..aa5442f2b 100644 --- a/FL/Fl_Spinner.H +++ b/FL/Fl_Spinner.H @@ -1,7 +1,7 @@ // // Spinner widget for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2017 by Bill Spitzak and others. +// Copyright 1998-2022 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -66,6 +66,8 @@ protected: up_button_, // Up button down_button_; // Down button + virtual void draw(); + public: // Constructor diff --git a/FL/fl_draw.H b/FL/fl_draw.H index f30c33811..359405b7d 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -1,7 +1,7 @@ // // Portable drawing function header file for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2021 by Bill Spitzak and others. +// Copyright 1998-2022 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -250,15 +250,15 @@ inline void fl_line_style(int style, int width = 0, char *dashes = 0) { fl_graphics_driver->line_style(style, width, dashes); } enum { - FL_SOLID = 0, ///< line style: <tt>___________</tt> - FL_DASH = 1, ///< line style: <tt>_ _ _ _ _ _</tt> - FL_DOT = 2, ///< line style: <tt>. . . . . .</tt> - FL_DASHDOT = 3, ///< line style: <tt>_ . _ . _ .</tt> - FL_DASHDOTDOT = 4, ///< line style: <tt>_ . . _ . .</tt> + FL_SOLID = 0, ///< line style: <tt>___________</tt> + FL_DASH = 1, ///< line style: <tt>_ _ _ _ _ _</tt> + FL_DOT = 2, ///< line style: <tt>. . . . . .</tt> + FL_DASHDOT = 3, ///< line style: <tt>_ . _ . _ .</tt> + FL_DASHDOTDOT = 4, ///< line style: <tt>_ . . _ . .</tt> - FL_CAP_FLAT = 0x100, ///< cap style: end is flat - FL_CAP_ROUND = 0x200, ///< cap style: end is round - FL_CAP_SQUARE = 0x300, ///< cap style: end wraps end point + FL_CAP_FLAT = 0x100, ///< cap style: end is flat + FL_CAP_ROUND = 0x200, ///< cap style: end is round + FL_CAP_SQUARE = 0x300, ///< cap style: end wraps end point FL_JOIN_MITER = 0x1000, ///< join style: line join extends to a point FL_JOIN_ROUND = 0x2000, ///< join style: line join is rounded @@ -939,6 +939,9 @@ FL_EXPORT void fl_draw_box(Fl_Boxtype, int x, int y, int w, int h, Fl_Color); // Draw a check mark in the given color inside the bounding box bb. void fl_draw_check(Fl_Rect bb, Fl_Color col); +// Draw one or more "arrows" (triangles) +FL_EXPORT void fl_draw_arrow(Fl_Rect bb, Fl_Arrow_Type t, Fl_Orientation o, Fl_Color color); + // images: /** |
