From 46253603de6ac40df5403efe1c059b33b89ee2e2 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 7 May 2020 17:43:04 +0200 Subject: Extend fl_message_position() with 'center' option Add argument 'center' to position the message box centered over the given x/y coordinates. Add another method to supply a widget or window to center the message box over. Fix documentation and don't use INT_MIN to avoid having to include limits.h in user code. --- FL/fl_ask.H | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'FL') diff --git a/FL/fl_ask.H b/FL/fl_ask.H index 9fad23d8e..2a9f1b107 100644 --- a/FL/fl_ask.H +++ b/FL/fl_ask.H @@ -3,17 +3,17 @@ // // Standard dialog header file for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2011 by Bill Spitzak and others. +// Copyright 1998-2020 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 // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // // Please report all bugs and problems on the following page: // -// http://www.fltk.org/str.php +// https://www.fltk.org/str.php // /** \file fl_ask.H @@ -65,8 +65,14 @@ inline void fl_message_font(Fl_Font f, Fl_Fontsize s) { FL_EXPORT void fl_message_hotspot(int enable); FL_EXPORT int fl_message_hotspot(void); -FL_EXPORT void fl_message_position(const int x = 0, const int y = 0); -FL_EXPORT void fl_message_position(int* x = 0, int* y = 0); +FL_EXPORT void fl_message_position(const int x, const int y, const int center = 0); +FL_EXPORT void fl_message_position(Fl_Widget *widget); +FL_EXPORT int fl_message_position(int *x = 0, int *y = 0); + +/** \see fl_message_position(Fl_Widget *widget). */ +inline void fl_message_position(Fl_Widget &widget) { + fl_message_position(&widget); +} FL_EXPORT void fl_message_title(const char *title); FL_EXPORT void fl_message_title_default(const char *title); -- cgit v1.2.3