summaryrefslogtreecommitdiff
path: root/FL/Fl_Widget.H
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-01-05 13:51:30 +0100
committerGitHub <noreply@github.com>2023-01-05 13:51:30 +0100
commit8826dca1066361b474139bcc5aeed2e3a5246ed0 (patch)
tree6819629ff3f9f014269c7cee090ab20a824af6ad /FL/Fl_Widget.H
parent4d1a508c7e4d28fd53129da79f068a275d7160bd (diff)
Add close buttons for individual tabs in Fl_Tabs (#628)
Add close buttons for Fl_Tabs Introducing callback reasons FLUID shows all FL_WHEN_... options Adding Fl_Tabs overflow types Improved test/tabs to show new features
Diffstat (limited to 'FL/Fl_Widget.H')
-rw-r--r--FL/Fl_Widget.H20
1 files changed, 12 insertions, 8 deletions
diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H
index 5b16555b9..772717856 100644
--- a/FL/Fl_Widget.H
+++ b/FL/Fl_Widget.H
@@ -1,7 +1,7 @@
//
// Widget header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2020 by Bill Spitzak and others.
+// Copyright 1998-2023 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
@@ -707,7 +707,7 @@ public:
FL_WHEN_RELEASE.
\return set of flags
- \see when(uchar)
+ \see when(uchar), Fl_When, do_callback(), Fl::callback_reason()
*/
Fl_When when() const {return (Fl_When)when_;}
@@ -733,6 +733,11 @@ public:
a newline for a Fl_Multiline_Input) - this changes the behavior.
\li FL_WHEN_ENTER_KEY|FL_WHEN_NOT_CHANGED: The Enter key will do the
callback even if the text has not changed. Useful for command fields.
+ \li \ref FL_WHEN_CLOSED : If the user requests that the widget is closed,
+ the callback is called with \ref FL_REASON_CLOSED. The \ref Fl_Tabs
+ widget checks this flag on its children to determine whether to display
+ a close button on the tab of that widget.
+
Fl_Widget::when() is a set of bitflags used by subclasses of
Fl_Widget to decide when to do the callback.
@@ -741,6 +746,7 @@ public:
class so that you can scan a panel and do_callback() on all the ones
that don't do their own callbacks in response to an "OK" button.
\param[in] i set of flags
+ \see Fl_When, do_callback(), Fl::callback_reason()
*/
void when(uchar i) {when_ = i;}
@@ -962,7 +968,7 @@ public:
\see callback()
\see do_callback(Fl_Widget *widget, void *data)
*/
- void do_callback() {do_callback(this, user_data_);}
+ void do_callback(Fl_Callback_Reason reason=FL_REASON_UNKNOWN) {do_callback(this, user_data_, reason);}
/** Calls the widget callback function with arbitrary arguments.
\param[in] widget call the callback with \p widget as the first argument
@@ -970,13 +976,11 @@ public:
\see callback()
\see do_callback(Fl_Widget *widget, void *data)
*/
- void do_callback(Fl_Widget *widget, long arg) {
- do_callback(widget, (void*)(fl_intptr_t)arg);
+ void do_callback(Fl_Widget *widget, long arg, Fl_Callback_Reason reason=FL_REASON_UNKNOWN) {
+ do_callback(widget, (void*)(fl_intptr_t)arg, reason);
}
- // Causes a widget to invoke its callback function with arbitrary arguments.
- // Documentation and implementation in Fl_Widget.cxx
- void do_callback(Fl_Widget *widget, void *arg = 0);
+ void do_callback(Fl_Widget *widget, void *arg = 0, Fl_Callback_Reason reason=FL_REASON_UNKNOWN);
/* Internal use only. */
int test_shortcut();