summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2021-12-06 19:49:16 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2021-12-06 19:49:16 +0100
commit39b5ae9e6e957582eddf16c86829d01473458e5d (patch)
treebe069833a7d87934af039341ce79c739fd6d535f /src
parent8bf62c67cfb8349064e2d2104ce9049a233fd914 (diff)
Fix Fl_Window::size_range() documentation (STR 3352)
"Tiny window problem if child group larger than window" See Greg's comment 4: "something is wrong here: either the logic or the docs are incorrect, not sure which." It turned out that both were incorrect. Since we fixed the code this commit completes the STR by fixing the docs as well so they match the behavior.
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Window.cxx58
1 files changed, 31 insertions, 27 deletions
diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx
index 0ca39a5ff..721ff1236 100644
--- a/src/Fl_Window.cxx
+++ b/src/Fl_Window.cxx
@@ -594,39 +594,43 @@ int Fl_Window::handle(int ev)
}
/**
- Sets the allowable range the user can resize this window to.
- This only works for top-level windows.
-
- If this function is not called, FLTK tries to figure out the range
- from the setting of resizable():
- <UL>
- <LI>If resizable() is NULL (this is the default) then the window cannot
- be resized and the resize border and max-size control will not be
- displayed for the window.</LI>
- <LI>If either dimension of resizable() is less than 100, then that is
- considered the minimum size. Otherwise the resizable() has a minimum
- size of 100.</LI>
- <LI>If either dimension of resizable() is zero, then that is also the
- maximum size (so the window cannot resize in that direction).</LI>
- </UL>
-
- It is undefined what happens if the current size does not fit in the
- constraints passed to size_range().
-
- \param[in] minWidth, minHeight The smallest the window can be.
+ Sets the allowable range the user can resize this window to.
+ This only works for top-level windows.
+
+ It is undefined what happens if the current window size does not fit
+ in the constraints passed to size_range().
+
+ If this function is \b not called, FLTK tries to figure out the range
+ from the setting of the window's resizable() widget:
+
+ - If resizable() is NULL (this is the default) then the window cannot
+ be resized and the resize border and max-size control will not be
+ displayed for the window.
+
+ - If either dimension of resizable() is zero, then the minimum size is
+ also the maximum size (so the window cannot resize in that direction).
+
+ - Otherwise the size of the resizable is irrelevant and the window's
+ minimum size is the current size and the maximum size is unlimited
+ like if size_range(w(), h(), 0, 0) was called.
+
+ \param[in] minWidth, minHeight The smallest the window can be.
Either value must be greater than 0.
- \param[in] maxWidth, maxHeight The largest the window can be. If either is
- equal to the minimum then you cannot resize in that direction.
+
+ \param[in] maxWidth, maxHeight The largest the window can be. If either
+ is equal to the minimum then you cannot resize in that direction.
If either is zero then FLTK picks a maximum size in that direction
such that the window will fill the screen.
- \param[in] deltaX, deltaY These are size increments. The window will be
+
+ \param[in] deltaX, deltaY These are size increments. The window will be
constrained to widths of <tt>minWidth + N * deltaX</tt>, where N is any
- non-negative integer. If these are less or equal to 1 they are ignored.
- (this is ignored on Windows)
- \param[in] aspectRatio A flag that indicates that the window should preserve
+ non-negative integer. If these are less or equal to 1 they are ignored
+ (this is ignored on Windows).
+
+ \param[in] aspectRatio A flag that indicates that the window should preserve
its aspect ratio. This only works if both the maximum and minimum have
the same aspect ratio (ignored on Windows and by many X window managers).
- */
+*/
void Fl_Window::size_range(int minWidth, int minHeight,
int maxWidth, int maxHeight,
int deltaX, int deltaY, int aspectRatio) {