diff options
| author | Matthias Melcher <github@matthiasm.com> | 2022-01-27 23:50:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-27 23:50:06 +0100 |
| commit | cdb51045dda7076be33147cc8e9138035ad9b97e (patch) | |
| tree | bdb05911b0514aa39ab442d0caac761c529f8c53 /FL/Fl_Text_Display.H | |
| parent | 84c0b7495b0859cce8b79fc6e4ceee19bc4f2f35 (diff) | |
Background color attribute for Fl_Text_Display. (#378)
* Background color attribute for Fl_Text_Display.
* Adding attributes.
* Avoid clipping horizontal
* Fl_Text_Display underlining.
* Better line positions
* Typos, testing.
* Documentation.
Diffstat (limited to 'FL/Fl_Text_Display.H')
| -rw-r--r-- | FL/Fl_Text_Display.H | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/FL/Fl_Text_Display.H b/FL/Fl_Text_Display.H index 58d71ea94..375ee4eed 100644 --- a/FL/Fl_Text_Display.H +++ b/FL/Fl_Text_Display.H @@ -142,10 +142,25 @@ public: \see Fl_Text_Display::highlight_data() */ struct Style_Table_Entry { - Fl_Color color; ///< text color - Fl_Font font; ///< text font - Fl_Fontsize size; ///< text font size - unsigned attr; ///< currently unused (this may be changed in the future) + Fl_Color color; ///< text color + Fl_Font font; ///< text font + Fl_Fontsize size; ///< text font size + unsigned attr; ///< further attributes for the text style (see `ATTR_BGCOLOR`, etc.) + Fl_Color bgcolor; ///< text background color if `ATTR_BGCOLOR` or `ATTR_BGCOLOR_EXT` is set + }; + + /** + attribute flags in `Style_Table_Entry.attr` + */ + enum { + ATTR_BGCOLOR = 0x0001, ///< use the background color in the `bgcolor` field + ATTR_BGCOLOR_EXT_ = 0x0002, ///< (internal use) + ATTR_BGCOLOR_EXT = 0x0003, ///< extend background color to the end of the line + ATTR_UNDERLINE = 0x0004, ///< a single underline, underline types are mutually exclusive + ATTR_GRAMMAR = 0x0008, ///< grammar suggestion (blue dotted underline) + ATTR_SPELLING = 0x000C, ///< spelling suggestion (red dotted underline) + ATTR_STRIKE_THROUGH = 0x0010, ///< line through the middle of the text + ATTR_LINES_MASK = 0x001C, ///< the mask for all underline and strike through types }; Fl_Text_Display(int X, int Y, int W, int H, const char *l = 0); |
