diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Window.cxx | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx index 38b3da521..e2e0f8237 100644 --- a/src/Fl_Window.cxx +++ b/src/Fl_Window.cxx @@ -606,7 +606,7 @@ int Fl_Window::handle(int ev) } /** - Sets the allowable range the user can resize this window to. + Sets the allowable range to which the user can resize this window. We recommend to call size_range() if you have a resizable() widget in a main window, and to call it after setting the resizable() and @@ -678,6 +678,30 @@ void Fl_Window::size_range(int minWidth, int minHeight, } /** + Gets the allowable range to which the user can resize this window. + + \param[out] minWidth, minHeight, maxWidth, maxHeight, deltaX, deltaY, aspectRatio + are all pointers to integers that will receive the current respective value + during the call. Every pointer can be NULL if that value is not needed. + \retval 0 if size range not set + \retval 1 if the size range was explicitly set by a call to Fl_Window::size_range() + or has been calculated + \see Fl_Window::size_range(int minWidth, int minHeight, int maxWidth, int maxHeight, int deltaX, int deltaY, int aspectRatio) + */ +uchar Fl_Window::get_size_range(int *minWidth, int *minHeight, + int *maxWidth, int *maxHeight, + int *deltaX, int *deltaY, int *aspectRatio) { + if (minWidth) *minWidth = minw_; + if (minHeight) *minHeight = minh_; + if (maxWidth) *maxWidth = maxw_; + if (maxHeight) *maxHeight = maxh_; + if (deltaX) *deltaX = dw_; + if (deltaY) *deltaY = dh_; + if (aspectRatio) *aspectRatio = aspect_; + return size_range_set_; +} + +/** Protected method to calculate the default size range of a window. This method is called internally prior to showing a window to ensure that |
