summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2022-02-22 23:28:04 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2022-03-01 13:45:51 +0100
commit091712bea8ff5aab89f0f8483ca572c118ca5715 (patch)
treea6afc62f1ebd7bb33e9b1036124d0037d09f0e09 /FL
parentd4ceb20ad30662861fe5a1471de2b5a202772937 (diff)
Fix default size_range() calculation (issue #392, STR 3352)
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Group.H5
-rw-r--r--FL/Fl_Window.H16
2 files changed, 15 insertions, 6 deletions
diff --git a/FL/Fl_Group.H b/FL/Fl_Group.H
index 2d4cef152..a7b6c393c 100644
--- a/FL/Fl_Group.H
+++ b/FL/Fl_Group.H
@@ -163,9 +163,12 @@ public:
See the \ref resize chapter for more examples and detailed explanation.
\note The resizable() widget of a window can also affect the window's
- resizing behavior if Fl_Window::size_range() is not called.
+ resizing behavior if Fl_Window::size_range() is not called. Please
+ see Fl_Window::default_size_range() for more information on how the
+ default size range is calculated.
\see Fl_Window::size_range()
+ \see Fl_Window::default_size_range()
*/
void resizable(Fl_Widget* o) {resizable_ = o;}
/**
diff --git a/FL/Fl_Window.H b/FL/Fl_Window.H
index 27465c433..9340ef629 100644
--- a/FL/Fl_Window.H
+++ b/FL/Fl_Window.H
@@ -1,7 +1,7 @@
//
// Window header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2016 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
@@ -74,10 +74,12 @@ private:
const char* iconlabel_;
char* xclass_;
- // size_range stuff:
- int minw, minh, maxw, maxh;
- int dw, dh, aspect;
- uchar size_range_set;
+
+ // private size_range stuff:
+ int minw_, minh_, maxw_, maxh_;
+ int dw_, dh_, aspect_;
+ uchar size_range_set_; // true (1) if size_range() has been set or calculated
+
// cursor stuff
Fl_Cursor cursor_default;
@@ -119,6 +121,9 @@ protected:
void free_icons();
+ void default_size_range(); // calculate size_range() if not set explicitly
+ int is_resizable(); // calculate size_range() and return whether this is resizable
+
public:
/**
@@ -321,6 +326,7 @@ public:
\deprecated please use force_position(0) instead
*/
void free_position() {clear_flag(FORCE_POSITION);}
+
void size_range(int minw, int minh, int maxw=0, int maxh=0, int dw=0, int dh=0, int aspect=0);
/** See void Fl_Window::label(const char*) */