FLTK 1.3.0
fl_ask.H
1 //
2 // "$Id: fl_ask.H 8441 2011-02-18 08:52:48Z AlbrechtS $"
3 //
4 // Standard dialog header file for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2011 by Bill Spitzak and others.
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Library General Public License for more details.
17 //
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 // USA.
22 //
23 // Please report all bugs and problems on the following page:
24 //
25 // http://www.fltk.org/str.php
26 //
27 
28 #ifndef fl_ask_H
29 # define fl_ask_H
30 
31 # include "Enumerations.H"
32 
33 class Fl_Widget;
35 enum {
36  FL_BEEP_DEFAULT = 0,
37  FL_BEEP_MESSAGE,
38  FL_BEEP_ERROR,
39  FL_BEEP_QUESTION,
40  FL_BEEP_PASSWORD,
41  FL_BEEP_NOTIFICATION
42 };
43 
44 # ifdef __GNUC__
45 # define __fl_attr(x) __attribute__ (x)
46 # else
47 # define __fl_attr(x)
48 # endif // __GNUC__
49 
50 FL_EXPORT void fl_beep(int type = FL_BEEP_DEFAULT);
51 FL_EXPORT void fl_message(const char *,...) __fl_attr((__format__ (__printf__, 1, 2)));
52 FL_EXPORT void fl_alert(const char *,...) __fl_attr((__format__ (__printf__, 1, 2)));
53 // fl_ask() is deprecated since it uses "Yes" and "No" for the buttons,
54 // which does not conform to the current FLTK Human Interface Guidelines.
55 // Use fl_choice() instead with the appropriate verbs instead.
56 FL_EXPORT int fl_ask(const char *,...) __fl_attr((__format__ (__printf__, 1, 2), __deprecated__));
57 FL_EXPORT int fl_choice(const char *q,const char *b0,const char *b1,const char *b2,...) __fl_attr((__format__ (__printf__, 1, 5)));
58 FL_EXPORT const char *fl_input(const char *label, const char *deflt = 0, ...) __fl_attr((__format__ (__printf__, 1, 3)));
59 FL_EXPORT const char *fl_password(const char *label, const char *deflt = 0, ...) __fl_attr((__format__ (__printf__, 1, 3)));
60 
61 FL_EXPORT Fl_Widget *fl_message_icon();
62 extern FL_EXPORT Fl_Font fl_message_font_;
63 extern FL_EXPORT Fl_Fontsize fl_message_size_;
64 inline void fl_message_font(Fl_Font f, Fl_Fontsize s) {
65  fl_message_font_ = f; fl_message_size_ = s;}
66 
67 FL_EXPORT void fl_message_hotspot(int enable);
68 FL_EXPORT int fl_message_hotspot(void);
69 
70 FL_EXPORT void fl_message_title(const char *title);
71 FL_EXPORT void fl_message_title_default(const char *title);
72 
73 // pointers you can use to change FLTK to a foreign language:
74 extern FL_EXPORT const char* fl_no;
75 extern FL_EXPORT const char* fl_yes;
76 extern FL_EXPORT const char* fl_ok;
77 extern FL_EXPORT const char* fl_cancel;
78 extern FL_EXPORT const char* fl_close;
79 #endif // !fl_ask_H
80 
81 //
82 // End of "$Id: fl_ask.H 8441 2011-02-18 08:52:48Z AlbrechtS $".
83 //
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:109
FL_EXPORT const char * fl_close
string pointer used in common dialogs, you can change it to another language
Definition: fl_ask.cxx:271
void fl_alert(const char *fmt,...)
Shows an alert message dialog box.
Definition: fl_ask.cxx:356
void fl_message(const char *fmt,...)
Shows an information message dialog box.
Definition: fl_ask.cxx:333
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:429
int fl_choice(const char *fmt, const char *b0, const char *b1, const char *b2,...)
Shows a dialog displaying the fmt message, this dialog features up to 3 customizable choice buttons...
Definition: fl_ask.cxx:411
const char * fl_password(const char *fmt, const char *defstr,...)
Shows an input dialog displaying the fmt message.
Definition: fl_ask.cxx:482
FL_EXPORT const char * fl_yes
string pointer used in common dialogs, you can change it to another language
Definition: fl_ask.cxx:268
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:537
const char * fl_input(const char *fmt, const char *defstr,...)
Shows an input dialog displaying the fmt message.
Definition: fl_ask.cxx:456
FL_EXPORT const char * fl_no
string pointer used in common dialogs, you can change it to another language
Definition: fl_ask.cxx:267
FL_EXPORT void fl_beep(int type=FL_BEEP_DEFAULT)
Emits a system beep message.
Definition: fl_ask.cxx:278
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:741
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:558
FL_EXPORT const char * fl_ok
string pointer used in common dialogs, you can change it to another language
Definition: fl_ask.cxx:269
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:712
FL_EXPORT const char * fl_cancel
string pointer used in common dialogs, you can change it to another language
Definition: fl_ask.cxx:270
int fl_ask(const char *fmt,...)
Shows a dialog displaying the fmt message, this dialog features 2 yes/no buttons. ...
Definition: fl_ask.cxx:381
const char * label() const
Gets the current label text.
Definition: Fl_Widget.H:417
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:506
uchar type() const
Gets the widget type.
Definition: Fl_Widget.H:270