21 #ifndef __EDELIB_MESSAGEBOX_H__
22 #define __EDELIB_MESSAGEBOX_H__
24 #include "edelib-global.h"
26 #include <FL/Fl_Window.H>
27 #include <FL/Fl_Button.H>
28 #include <FL/Fl_Box.H>
29 #include <FL/Fl_Input.H>
30 #include <FL/Fl_Pixmap.H>
32 #define MSGBOX_MAX_BUTTONS 4 // Max buttons in dialog
34 #define MSGBOX_ICON_ERROR "dialog-error"
35 #define MSGBOX_ICON_INFO "dialog-information"
36 #define MSGBOX_ICON_PASSWORD "dialog-password"
37 #define MSGBOX_ICON_WARNING "dialog-warning"
38 #define MSGBOX_ICON_QUESTION "dialog-question"
208 Fl_Button* buttons[MSGBOX_MAX_BUTTONS];
211 void fix_sizes(
void);
213 void add(Fl_Widget*) { }
314 int run(
bool center =
true);
325 const char* input = 0,
const char* password = 0);
342 const char*
ask = 0,
const char*
input = 0,
const char*
password = 0) EDELIB_DEPRECATED;
355 EDELIB_API
void message(const
char* fmt, ...);
361 EDELIB_API
void alert(const
char* fmt, ...);
368 EDELIB_API
int ask(const
char* fmt, ...);
380 EDELIB_API const
char*
input(const
char* fmt, const
char* deflt = 0, ...);
386 EDELIB_API const
char*
password(const
char* fmt, const
char* deflt = 0, ...);
392 extern void (*fl_message)(
const char* fmt, ...);
393 extern void (*fl_alert)(
const char* fmt, ...);
394 extern int (*fl_ask)(
const char* fmt, ...);
395 extern const char* (*fl_input)(
const char* fmt,
const char* deflt, ...);
396 extern const char* (*fl_password)(
const char* fmt,
const char* deflt, ...);
@ MSGBOX_INPUT
Dialog with input field.
Definition: MessageBox.h:49
@ MSGBOX_ICON_TYPE_INFO
Info-like icon.
Definition: MessageBox.h:69
void add_button(Fl_Button *b, MessageBoxButtonType bt=MSGBOX_BUTTON_PLAIN)
void add_button(const char *l, MessageBoxButtonType bt=MSGBOX_BUTTON_PLAIN, Fl_Callback cb=0, void *param=0)
@ MSGBOX_PLAIN
Plain dialog.
Definition: MessageBox.h:48
static void set_themed_icons(const char *msg, const char *alert=0, const char *ask=0, const char *input=0, const char *password=0)
@ MSGBOX_ICON_TYPE_QUESTION
Question-like icon.
Definition: MessageBox.h:71
Standard dialog.
Definition: MessageBox.h:196
const char * password(const char *fmt, const char *deflt=0,...)
void clear(MessageBoxType t=MSGBOX_PLAIN)
int ask(const char *fmt,...)
@ MSGBOX_BUTTON_PLAIN
Ordinary button (Fl_Button)
Definition: MessageBox.h:59
void message(const char *fmt,...)
const char * input(const char *fmt, const char *deflt=0,...)
void themed_dialog_icons(const char *msg, const char *alert=0, const char *ask=0, const char *input=0, const char *password=0)
@ MSGBOX_ICON_TYPE_PASSWORD
Password-like icon.
Definition: MessageBox.h:73
@ MSGBOX_ICON_TYPE_ALERT
Alert-like icon.
Definition: MessageBox.h:70
void set_icon_from_type(MessageBoxIconType type)
static void clear_themed_icons(void)
void set_xpm_icon(const char *const *arr)
void set_text(const char *t)
int run(bool center=true)
bool set_theme_icon(const char *name)
const char * get_input(void)
void alert(const char *fmt,...)
void run_plain(bool center=true)
@ MSGBOX_ICON_TYPE_INPUT
Input-like icon.
Definition: MessageBox.h:72
MessageBox(MessageBoxType t=MSGBOX_PLAIN)
@ MSGBOX_INPUT_SECRET
Dialog with secret input field.
Definition: MessageBox.h:50
void set_input(const char *txt)
@ MSGBOX_BUTTON_RETURN
Button with 'enter' shortcut (Fl_Return_Button)
Definition: MessageBox.h:60
bool set_icon(const char *path)