FLTK
fl_ask.H
Go to the documentation of this file.
1 //
2 // Standard dialog header file for the Fast Light Tool Kit (FLTK).
3 //
4 // Copyright 1998-2020 by Bill Spitzak and others.
5 //
6 // This library is free software. Distribution and use rights are outlined in
7 // the file "COPYING" which should have been included with this file. If this
8 // file is missing or damaged, see the license at:
9 //
10 // https://www.fltk.org/COPYING.php
11 //
12 // Please see the following page on how to report bugs and issues:
13 //
14 // https://www.fltk.org/bugs.php
15 //
16 
21 #ifndef fl_ask_H
22 # define fl_ask_H
23 
24 # include "Enumerations.H"
25 class Fl_Widget;
26 
29 enum Fl_Beep {
36 };
37 
38 # ifdef __GNUC__
39 /* the GNUC-specific attribute appearing below in prototypes with a variable list of arguments
40  helps detection of mismatches between format string and argument list at compilation time */
41 # define __fl_attr(x) __attribute__ (x)
42 # else
43 # define __fl_attr(x)
44 # endif // __GNUC__
45 
46 FL_EXPORT void fl_beep(int type = FL_BEEP_DEFAULT);
47 FL_EXPORT void fl_message(const char *,...) __fl_attr((__format__ (__printf__, 1, 2)));
48 FL_EXPORT void fl_alert(const char *,...) __fl_attr((__format__ (__printf__, 1, 2)));
49 // fl_ask() is deprecated since it uses "Yes" and "No" for the buttons,
50 // which does not conform to the current FLTK Human Interface Guidelines.
51 // Use fl_choice() instead with the appropriate verbs instead.
52 FL_EXPORT int fl_ask(const char *,...) __fl_attr((__format__ (__printf__, 1, 2), __deprecated__));
53 FL_EXPORT int fl_choice(const char *q,const char *b0,const char *b1,const char *b2,...) __fl_attr((__format__ (__printf__, 1, 5)));
54 FL_EXPORT const char *fl_input(const char *label, const char *deflt = 0, ...) __fl_attr((__format__ (__printf__, 1, 3)));
55 FL_EXPORT const char *fl_password(const char *label, const char *deflt = 0, ...) __fl_attr((__format__ (__printf__, 1, 3)));
56 
57 FL_EXPORT Fl_Widget *fl_message_icon();
58 extern FL_EXPORT Fl_Font fl_message_font_;
59 extern FL_EXPORT Fl_Fontsize fl_message_size_;
60 inline void fl_message_font(Fl_Font f, Fl_Fontsize s) {
61  fl_message_font_ = f; fl_message_size_ = s;}
62 
63 FL_EXPORT void fl_message_hotspot(int enable);
64 FL_EXPORT int fl_message_hotspot(void);
65 
66 FL_EXPORT void fl_message_position(const int x, const int y, const int center = 0);
67 FL_EXPORT void fl_message_position(Fl_Widget *widget);
68 FL_EXPORT int fl_message_position(int *x = 0, int *y = 0);
69 
71 inline void fl_message_position(Fl_Widget &widget) {
72  fl_message_position(&widget);
73 }
74 
75 FL_EXPORT void fl_message_title(const char *title);
76 FL_EXPORT void fl_message_title_default(const char *title);
77 
78 // pointers you can use to change FLTK to another language:
79 extern FL_EXPORT const char* fl_no;
80 extern FL_EXPORT const char* fl_yes;
81 extern FL_EXPORT const char* fl_ok;
82 extern FL_EXPORT const char* fl_cancel;
83 extern FL_EXPORT const char* fl_close;
84 #endif // !fl_ask_H
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:85
Message beep.
Definition: fl_ask.H:31
FL_EXPORT const char * fl_close
string pointer used in common dialogs, you can change it to another language
Definition: fl_ask.cxx:287
void fl_alert(const char *fmt,...)
Shows an alert message dialog box.
Definition: fl_ask.cxx:334
const char * label() const
Gets the current label text.
Definition: Fl_Widget.H:408
void fl_message(const char *fmt,...)
Shows an information message dialog box.
Definition: fl_ask.cxx:311
Error beep.
Definition: fl_ask.H:32
Password beep.
Definition: fl_ask.H:34
FL_EXPORT int FL_EXPORT const char FL_EXPORT const char FL_EXPORT Fl_Widget * fl_message_icon()
Gets the Fl_Box icon container of the current default dialog used in many common dialogs like fl_mess...
Definition: fl_ask.cxx:456
Question beep.
Definition: fl_ask.H:33
int fl_choice(const char *fmt, const char *b0, const char *b1, const char *b2,...)
Shows a dialog displaying the printf style fmt message.
Definition: fl_ask.cxx:438
uchar type() const
Gets the widget type.
Definition: Fl_Widget.H:261
const char * fl_password(const char *fmt, const char *defstr,...)
Shows an input dialog displaying the fmt message.
Definition: fl_ask.cxx:510
Notification beep.
Definition: fl_ask.H:35
FL_EXPORT const char * fl_yes
string pointer used in common dialogs, you can change it to another language
Definition: fl_ask.cxx:284
This file contains type definitions and general enumerations.
FL_EXPORT void fl_message_title(const char *title)
Sets the title of the dialog window used in many common dialogs.
Definition: fl_ask.cxx:641
const char * fl_input(const char *fmt, const char *defstr,...)
Shows an input dialog displaying the fmt message.
Definition: fl_ask.cxx:484
FL_EXPORT const char * fl_no
string pointer used in common dialogs, you can change it to another language
Definition: fl_ask.cxx:283
int y() const
Gets the widget position in its window.
Definition: Fl_Widget.H:276
FL_EXPORT void fl_beep(int type=FL_BEEP_DEFAULT)
Emits a system beep message.
Definition: fl_ask.cxx:296
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:1014
FL_EXPORT void fl_message_title_default(const char *title)
Sets the default title of the dialog window used in many common dialogs.
Definition: fl_ask.cxx:662
FL_EXPORT const char * fl_ok
string pointer used in common dialogs, you can change it to another language
Definition: fl_ask.cxx:285
FL_EXPORT void fl_message_position(const int x, const int y, const int center=0)
Sets the preferred position for the common message box used in many common dialogs like fl_message()...
Definition: fl_ask.cxx:545
Fl_Beep
Different system beeps available.
Definition: fl_ask.H:29
Default beep.
Definition: fl_ask.H:30
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:985
FL_EXPORT const char * fl_cancel
string pointer used in common dialogs, you can change it to another language
Definition: fl_ask.cxx:286
int fl_ask(const char *fmt,...)
Shows a dialog displaying the fmt message, this dialog features 2 yes/no buttons. ...
Definition: fl_ask.cxx:363
int x() const
Gets the widget position in its window.
Definition: Fl_Widget.H:271
FL_EXPORT void fl_message_hotspot(int enable)
Sets whether or not to move the common message box used in many common dialogs like fl_message()...
Definition: fl_ask.cxx:610