fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
  SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation)  

Common Dialogs classes and functions

Classes

class  Fl_Color_Chooser
 The Fl_Color_Chooser widget provides a standard RGB color chooser. More...
class  Fl_File_Chooser

Functions

void fl_beep (int type)
void fl_message (const char *fmt,...)
void fl_alert (const char *fmt,...)
int fl_ask (const char *fmt,...)
int fl_choice (const char *fmt, const char *b0, const char *b1, const char *b2,...)
Fl_Widgetfl_message_icon ()
const char * fl_input (const char *fmt, const char *defstr,...)
const char * fl_password (const char *fmt, const char *defstr,...)
int Fl_Color_Chooser::fl_color_chooser (const char *name, double &r, double &g, double &b, int cmode)
 Pops up a window to let the user pick an arbitrary RGB color.
int Fl_Color_Chooser::fl_color_chooser (const char *name, uchar &r, uchar &g, uchar &b, int cmode)
 Pops up a window to let the user pick an arbitrary RGB color.
void Fl_File_Chooser::fl_file_chooser_callback (void(*cb)(const char *))
void Fl_File_Chooser::fl_file_chooser_ok_label (const char *l)
char * Fl_File_Chooser::fl_file_chooser (const char *message, const char *pat, const char *fname, int relative)
char * Fl_File_Chooser::fl_dir_chooser (const char *message, const char *fname, int relative)

Variables

static void(* Fl::warning )(const char *,...) = ::warning
static void(* Fl::error )(const char *,...) = ::error
static void(* Fl::fatal )(const char *,...) = ::fatal
const char * fl_no = "No"
 string pointer used in common dialogs, you can change it to a foreign language
const char * fl_yes = "Yes"
 string pointer used in common dialogs, you can change it to a foreign language
const char * fl_ok = "OK"
 string pointer used in common dialogs, you can change it to a foreign language
const char * fl_cancel = "Cancel"
 string pointer used in common dialogs, you can change it to a foreign language
const char * fl_close = "Close"
 string pointer used in common dialogs, you can change it to a foreign language

Function Documentation

void fl_alert ( const char *  fmt,
  ... 
)

Shows an alert message dialog box

Note:
Common dialog boxes are application modal. No more than one common dialog box can be open at any time. Requests for additional dialog boxes are ignored.
#include <FL/fl_ask.H>
Parameters:
[in]fmtcan be used as an sprintf-like format and variables for the message text

Definition at line 340 of file fl_ask.cxx.

References fl_beep(), and FL_BEEP_ERROR.

int fl_ask ( const char *  fmt,
  ... 
)

Shows a dialog displaying the fmt message, this dialog features 2 yes/no buttons

Note:
Common dialog boxes are application modal. No more than one common dialog box can be open at any time. Requests for additional dialog boxes are ignored.
#include <FL/fl_ask.H>
Parameters:
[in]fmtcan be used as an sprintf-like format and variables for the message text
Return values:
0if the no button is selected or another dialog box is still open
1if yes is selected

Definition at line 365 of file fl_ask.cxx.

References fl_beep(), and FL_BEEP_QUESTION.

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

Note:
Common dialog boxes are application modal. No more than one common dialog box can be open at any time. Requests for additional dialog boxes are ignored.
#include <FL/fl_ask.H>
Parameters:
[in]fmtcan be used as an sprintf-like format and variables for the message text
[in]b0text label of button 0
[in]b1text label of button 1
[in]b2text label of button 2
Return values:
0if the first button with b0 text is selected or another dialog box is still open
1if the second button with b1 text is selected
2if the third button with b2 text is selected

Definition at line 395 of file fl_ask.cxx.

References fl_beep(), and FL_BEEP_QUESTION.

int fl_color_chooser ( const char *  name,
double &  r,
double &  g,
double &  b,
int  cmode 
) [related, inherited]

Pops up a window to let the user pick an arbitrary RGB color.

Note:
#include <FL/Fl_Color_Chooser.H>
fl_color_chooser.jpg
Parameters:
[in]nameTitle label for the window
[in,out]r,g,bColor components in the range 0.0 to 1.0.
[in]cmodeOptional mode for color chooser. See mode(int). Default -1 if none (rgb mode).
Return values:
1if user confirms the selection
0if user cancels the dialog

Definition at line 573 of file Fl_Color_Chooser.cxx.

References Fl_Color_Chooser::b(), ColorChip::b, Fl_Widget::callback(), Fl_Group::end(), Fl_Color_Chooser::g(), ColorChip::g, Fl_Window::hotspot(), Fl_Color_Chooser::mode(), Fl_Color_Chooser::r(), ColorChip::r, Fl_Group::resizable(), Fl_Color_Chooser::rgb(), Fl_Window::set_modal(), Fl_Window::show(), Fl_Window::shown(), and Fl::wait().

Referenced by Fl_Color_Chooser::fl_color_chooser().

int fl_color_chooser ( const char *  name,
uchar r,
uchar g,
uchar b,
int  cmode 
) [related, inherited]

Pops up a window to let the user pick an arbitrary RGB color.

Note:
#include <FL/Fl_Color_Chooser.H>
fl_color_chooser.jpg
Parameters:
[in]nameTitle label for the window
[in,out]r,g,bColor components in the range 0 to 255.
[in]cmodeOptional mode for color chooser. See mode(int). Default -1 if none (rgb mode).
Return values:
1if user confirms the selection
0if user cancels the dialog

Definition at line 616 of file Fl_Color_Chooser.cxx.

References Fl_Color_Chooser::fl_color_chooser().

char * fl_dir_chooser ( const char *  message,
const char *  fname,
int  relative 
) [related, inherited]

Shows a file chooser dialog and gets a directory.

Note:
#include <FL/Fl_File_Chooser.H>
Parameters:
[in]messagetitle bar text
[in]fnameinitial/default directory name
[in]relative0 for absolute path return, relative otherwise
Returns:
the directory path string chosen by the user or NULL if user cancels

Definition at line 162 of file fl_file_dir.cxx.

References Fl_File_Chooser::callback(), Fl_File_Chooser::CREATE, Fl_File_Chooser::DIRECTORY, Fl_File_Chooser::filter(), fl_filename_relative(), FL_PATH_MAX, Fl_File_Chooser::label(), Fl_File_Chooser::show(), Fl_File_Chooser::shown(), Fl_File_Chooser::type(), Fl_File_Chooser::value(), and Fl::wait().

char * fl_file_chooser ( const char *  message,
const char *  pat,
const char *  fname,
int  relative 
) [related, inherited]

Shows a file chooser dialog and gets a filename.

Note:
#include <FL/Fl_File_Chooser.H>
Fl_File_Chooser.jpg
Parameters:
[in]messagetext in title bar
[in]patfilename pattern filter
[in]fnameinitial/default filename selection
[in]relative0 for absolute path name, relative path name otherwise
Returns:
the user selected filename, in absolute or relative format or NULL if user cancels

Definition at line 79 of file fl_file_dir.cxx.

References Fl_File_Chooser::callback(), Fl_File_Chooser::CREATE, Fl_File_Chooser::directory(), Fl_File_Chooser::filter(), fl_filename_name(), fl_filename_relative(), FL_PATH_MAX, Fl_File_Chooser::label(), Fl_File_Chooser::ok_label(), Fl_File_Chooser::show(), Fl_File_Chooser::shown(), strlcpy, Fl_File_Chooser::type(), Fl_File_Chooser::value(), and Fl::wait().

Referenced by fl_show_file_selector(), open_cb(), print_cb(), save_cb(), and ui_find_image().

void fl_file_chooser_callback ( void(*)(const char *)  cb) [related, inherited]

Set the file chooser callback

Note:
#include <FL/Fl_File_Chooser.H>

Definition at line 52 of file fl_file_dir.cxx.

void fl_file_chooser_ok_label ( const char *  l) [related, inherited]

Set the "OK" button label

Note:
#include <FL/Fl_File_Chooser.H>

Definition at line 61 of file fl_file_dir.cxx.

References fl_ok.

Referenced by open_cb(), print_cb(), save_cb(), and ui_find_image().

const char* fl_input ( const char *  fmt,
const char *  defstr,
  ... 
)

Shows an input dialog displaying the fmt message

Note:
Common dialog boxes are application modal. No more than one common dialog box can be open at any time. Requests for additional dialog boxes are ignored.
#include <FL/fl_ask.H>
Parameters:
[in]fmtcan be used as an sprintf-like format and variables for the message text
[in]defstrdefines the default returned string if no text is entered
Returns:
the user string input if OK was pushed, NULL if Cancel was pushed or another dialog box was still open

Definition at line 440 of file fl_ask.cxx.

References fl_beep(), FL_BEEP_QUESTION, and FL_NORMAL_INPUT.

void fl_message ( const char *  fmt,
  ... 
)

Shows an information message dialog box.

Note:
Common dialog boxes are application modal. No more than one common dialog box can be open at any time. Requests for additional dialog boxes are ignored.
#include <FL/fl_ask.H>
Parameters:
[in]fmtcan be used as an sprintf-like format and variables for the message text

Definition at line 317 of file fl_ask.cxx.

References fl_beep(), and FL_BEEP_MESSAGE.

Fl_Widget* fl_message_icon ( )

Gets the Fl_Box icon container of the current default dialog used in many common dialogs like fl_message(), fl_alert(), fl_ask(), fl_choice(), fl_input(), fl_password()

Note:
#include <FL/fl_ask.H>

Definition at line 413 of file fl_ask.cxx.

const char* fl_password ( const char *  fmt,
const char *  defstr,
  ... 
)

Shows an input dialog displaying the fmt message.

Like fl_input() except the input text is not shown, '*' characters are displayed instead.

Note:
Common dialog boxes are application modal. No more than one common dialog box can be open at any time. Requests for additional dialog boxes are ignored.
#include <FL/fl_ask.H>
Parameters:
[in]fmtcan be used as an sprintf-like format and variables for the message text
[in]defstrdefines the default returned string if no text is entered
Returns:
the user string input if OK was pushed, NULL if Cancel was pushed or aother dialog box was still open

Definition at line 466 of file fl_ask.cxx.

References fl_beep(), FL_BEEP_PASSWORD, and FL_SECRET_INPUT.


Variable Documentation

void(* Fl::error)(const char *format,...) = ::error [static, inherited]

FLTK calls Fl::error() to output a normal error message.

The default version on Windows displays the error message in a MessageBox window.

The default version on all other platforms prints the error message to stderr.

You can override the behavior by setting the function pointer to your own routine.

Fl::error() means there is a recoverable error such as the inability to read an image file. The default implementation returns after displaying the message.

Note:
#include <FL/Fl.H>

Definition at line 398 of file Fl.H.

Referenced by Fl::args(), Fl_GIF_Image::Fl_GIF_Image(), Fl_PNM_Image::Fl_PNM_Image(), fl_pop_matrix(), fl_push_matrix(), Fl_Graphics_Driver::line_style(), Fl_File_Icon::load_fti(), Fl_Text_Display::position_to_line(), Fl_Text_Buffer::remove_modify_callback(), and Fl_Text_Buffer::remove_predelete_callback().

void(* Fl::fatal)(const char *format,...) = ::fatal [static, inherited]

FLTK calls Fl::fatal() to output a fatal error message.

The default version on Windows displays the error message in a MessageBox window.

The default version on all other platforms prints the error message to stderr.

You can override the behavior by setting the function pointer to your own routine.

Fl::fatal() must not return, as FLTK is in an unusable state, however your version may be able to use longjmp or an exception to continue, as long as it does not call FLTK again. The default implementation exits with status 1 after displaying the message.

Note:
#include <FL/Fl.H>

Definition at line 415 of file Fl.H.

Referenced by Fl_Gl_Window::draw(), fl_open_display(), and fl_width().

const char* fl_cancel = "Cancel"

string pointer used in common dialogs, you can change it to a foreign language

Definition at line 254 of file fl_ask.cxx.

Referenced by Fl_File_Chooser::Fl_File_Chooser().

const char* fl_close = "Close"

string pointer used in common dialogs, you can change it to a foreign language

Definition at line 255 of file fl_ask.cxx.

const char* fl_no = "No"

string pointer used in common dialogs, you can change it to a foreign language

Definition at line 251 of file fl_ask.cxx.

const char* fl_ok = "OK"

string pointer used in common dialogs, you can change it to a foreign language

Definition at line 253 of file fl_ask.cxx.

Referenced by Fl_File_Chooser::Fl_File_Chooser(), and Fl_File_Chooser::fl_file_chooser_ok_label().

const char* fl_yes = "Yes"

string pointer used in common dialogs, you can change it to a foreign language

Definition at line 252 of file fl_ask.cxx.

void(* Fl::warning)(const char *format,...) = ::warning [static, inherited]

FLTK calls Fl::warning() to output a warning message.

The default version on Windows returns without printing a warning message, because Windows programs normally don't have stderr (a console window) enabled.

The default version on all other platforms prints the warning message to stderr.

You can override the behavior by setting the function pointer to your own routine.

Fl::warning() means that there was a recoverable problem, the display may be messed up, but the user can probably keep working - all X protocol errors call this, for example. The default implementation returns after displaying the message.

Note:
#include <FL/Fl.H>

Definition at line 383 of file Fl.H.

Referenced by Fl_GIF_Image::Fl_GIF_Image(), fl_init_xim(), Fl_PNG_Image::Fl_PNG_Image(), Fl_File_Icon::load(), Fl_Graphics_Driver::pop_clip(), Fl_Graphics_Driver::push_clip(), and Fl_Graphics_Driver::push_no_clip().