From a05ae33e20b09ab952ddbbf6762d5cfec77e4943 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Wed, 2 Jul 2025 16:16:48 +0200 Subject: Remove deprecated methods and functions In FLTK 1.5 we remove most (but not all) methods and functions that were deprecated in FLTK 1.3 or earlier. --- src/Fl.cxx | 4 ++-- src/Fl_Message.cxx | 12 ++++++------ src/Fl_Widget.cxx | 44 ++++++++++++++++++++++---------------------- src/fl_ask.cxx | 8 ++++++-- src/fl_rect.cxx | 4 ++-- 5 files changed, 38 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/Fl.cxx b/src/Fl.cxx index b1c38caf6..818efe39d 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1,7 +1,7 @@ // // Main event handling code for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2024 by Bill Spitzak and others. +// Copyright 1998-2025 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 @@ -1800,7 +1800,7 @@ static Fl_Widget **dwidgets = 0; To avoid early deletion of widgets, this function should be called toward the end of a callback and only after any call to the event - loop (Fl::wait(), Fl::flush(), Fl::check(), fl_ask(), etc.). + loop (Fl::wait(), Fl::flush(), Fl::check(), fl_choice(), etc.). When deleting groups or windows, you must only delete the group or window widget and not the individual child widgets. diff --git a/src/Fl_Message.cxx b/src/Fl_Message.cxx index bd11a18f8..b24072b40 100644 --- a/src/Fl_Message.cxx +++ b/src/Fl_Message.cxx @@ -24,7 +24,7 @@ \file Fl_Message.cxx - Base class for common dialogs. This is the base class for all common FLTK dialog windows used in - fl_message(), fl_ask(), fl_choice(), fl_input(), and fl_password(). + fl_message(), fl_choice(), fl_input(), and fl_password(). \note Internal use only. This class may be changed as required without notice.\n @@ -46,7 +46,7 @@ #include #include "flstring.h" #include -#include "Fl_Message.h" // intentionally "hidden" in src/... +#include "Fl_Message.h" // intentionally "hidden" in src/... #include "FL/fl_string_functions.h" // fl_strdup() #include @@ -403,8 +403,8 @@ int Fl_Message::innards(const char *fmt, va_list ap, const char *b0, const char /** Gets the default icon container (Fl_Box) used in common dialogs. - Many common dialogs like fl_message(), fl_alert(), fl_ask(), - fl_choice(), fl_input(), and fl_password() display an icon. + Many common dialogs like fl_message(), fl_alert(), fl_choice(), + fl_input(), and fl_password() display an icon. You can use this method to get the icon box (Fl_Box) and modify the icon's box type, font, fontsize etc. @@ -514,7 +514,7 @@ const char *Fl_Message::input_innards(const char *fmt, va_list ap, const char *d /** Sets the title of the dialog window used in many common dialogs. This window \p title will be used in the next call of one of the - common dialogs like fl_message(), fl_alert(), fl_ask(), fl_choice(), + common dialogs like fl_message(), fl_alert(), fl_choice(), fl_input(), fl_password(). The \p title string is copied internally, so that you can use a @@ -537,7 +537,7 @@ void Fl_Message::message_title(const char *title) { /** Sets the default title of the dialog window used in many common dialogs. This window \p title will be used in all subsequent calls of one of the - common dialogs like fl_message(), fl_alert(), fl_ask(), fl_choice(), + common dialogs like fl_message(), fl_alert(), fl_choice(), fl_input(), fl_password(), unless a specific title has been set with fl_message_title(const char *title). diff --git a/src/Fl_Widget.cxx b/src/Fl_Widget.cxx index 3a583ca4d..da3cd7638 100644 --- a/src/Fl_Widget.cxx +++ b/src/Fl_Widget.cxx @@ -1,7 +1,7 @@ // // Base widget class for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2022 by Bill Spitzak and others. +// Copyright 1998-2025 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 @@ -110,28 +110,28 @@ Fl_Widget::Fl_Widget(int X, int Y, int W, int H, const char* L) { x_ = X; y_ = Y; w_ = W; h_ = H; - label_.value = L; - label_.image = 0; - label_.deimage = 0; - label_.type = FL_NORMAL_LABEL; - label_.font = FL_HELVETICA; - label_.size = FL_NORMAL_SIZE; - label_.color = FL_FOREGROUND_COLOR; - label_.align_ = FL_ALIGN_CENTER; + label_.value = L; + label_.image = 0; + label_.deimage = 0; + label_.type = FL_NORMAL_LABEL; + label_.font = FL_HELVETICA; + label_.size = FL_NORMAL_SIZE; + label_.color = FL_FOREGROUND_COLOR; + label_.align_ = FL_ALIGN_CENTER; label_.h_margin_ = label_.v_margin_ = 0; - label_.spacing = 0; - tooltip_ = 0; - callback_ = default_callback; - user_data_ = 0; - type_ = 0; - flags_ = VISIBLE_FOCUS; - damage_ = 0; - box_ = FL_NO_BOX; - color_ = FL_GRAY; - color2_ = FL_GRAY; - when_ = FL_WHEN_RELEASE; - - parent_ = 0; + label_.spacing = 0; + tooltip_ = 0; + callback_ = default_callback; + user_data_ = 0; + type_ = 0; + flags_ = VISIBLE_FOCUS; + damage_ = 0; + box_ = FL_NO_BOX; + color_ = FL_GRAY; + selection_color_ = FL_GRAY; + when_ = FL_WHEN_RELEASE; + + parent_ = nullptr; if (Fl_Group::current()) Fl_Group::current()->add(this); } diff --git a/src/fl_ask.cxx b/src/fl_ask.cxx index 49486716a..205979d7e 100644 --- a/src/fl_ask.cxx +++ b/src/fl_ask.cxx @@ -1,7 +1,7 @@ // // Standard dialog functions for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2022 by Bill Spitzak and others. +// Copyright 1998-2025 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 @@ -29,7 +29,7 @@ - fl_alert() - fl_beep() - fl_message() - - fl_ask() + - fl_ask() // deprecated since 1.1.7 (2006), see comment in FL/fl_ask.H - fl_choice() - fl_input() - fl_input_str() @@ -129,6 +129,8 @@ void fl_alert(const char *fmt, ...) { va_end(ap); } +#if FLTK_INCLUDE_FL_ASK // see FL/fl_ask.H + /** Shows a dialog displaying the \p fmt message, this dialog features 2 yes/no buttons. @@ -154,6 +156,8 @@ int fl_ask(const char *fmt, ...) { return r; } +#endif // FLTK_INCLUDE_FL_ASK + /** Shows a dialog displaying the printf style \p fmt message. This dialog features up to 3 customizable choice buttons diff --git a/src/fl_rect.cxx b/src/fl_rect.cxx index 42be703e0..daef27f52 100644 --- a/src/fl_rect.cxx +++ b/src/fl_rect.cxx @@ -1,7 +1,7 @@ // // Rectangle drawing routines for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2018 by Bill Spitzak and others. +// Copyright 1998-2025 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 @@ -21,7 +21,7 @@ // These routines from fl_draw.H are used by the standard boxtypes // and thus are always linked into an fltk program. -// Also all fl_clip routines, since they are always linked in so +// Also all fl_*_clip routines, since they are always linked in so // that minimal update works. #include -- cgit v1.2.3