summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2026-01-04 15:50:49 +0100
committerMatthias Melcher <github@matthiasm.com>2026-01-04 15:50:56 +0100
commit0e570fb6729ff6b97249256c2c9d5f3aa58c7bb4 (patch)
tree7140e3b2d97c6f7852e915759918d14bf6b35b00 /FL
parent357336bd40d868fd65e95c61d1adaf9de0fb7811 (diff)
Add C++11 Fl_Valuator::format API.
This is helpful for writing language wrapper, in this particular case for PyFLTK.
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Color_Chooser.H5
-rw-r--r--FL/Fl_Valuator.H5
2 files changed, 8 insertions, 2 deletions
diff --git a/FL/Fl_Color_Chooser.H b/FL/Fl_Color_Chooser.H
index e1f085b91..d3e56bdef 100644
--- a/FL/Fl_Color_Chooser.H
+++ b/FL/Fl_Color_Chooser.H
@@ -1,7 +1,7 @@
//
// Color chooser header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2019 by Bill Spitzak and others.
+// Copyright 1998-2026 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
@@ -30,6 +30,8 @@
#include <FL/Fl_Choice.H>
#include <FL/Fl_Value_Input.H>
+#include <string>
+
#ifndef FL_DOXYGEN
/** For internal use only */
@@ -60,6 +62,7 @@ public:
class FL_EXPORT Flcc_Value_Input : public Fl_Value_Input {
public:
int format(char*) override;
+ std::string format_str() override;
Flcc_Value_Input(int X, int Y, int W, int H) : Fl_Value_Input(X,Y,W,H) {}
};
diff --git a/FL/Fl_Valuator.H b/FL/Fl_Valuator.H
index 7587bb298..74f17049a 100644
--- a/FL/Fl_Valuator.H
+++ b/FL/Fl_Valuator.H
@@ -1,7 +1,7 @@
//
// Valuator header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2022 by Bill Spitzak and others.
+// Copyright 1998-2026 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
@@ -24,6 +24,8 @@
#include "Fl_Widget.H"
#endif
+#include <string>
+
// shared type() values for classes that work in both directions:
#define FL_VERTICAL 0 ///< The valuator can work vertically
#define FL_HORIZONTAL 1 ///< The valuator can work horizontally
@@ -126,6 +128,7 @@ public:
int value(double);
virtual int format(char*);
+ virtual std::string format_str();
double round(double); // round to nearest multiple of step
double clamp(double); // keep in range
double increment(double, int); // add n*step to value