Dillo v3.1.1-111-gd4f56d0d
Loading...
Searching...
No Matches
dialog.cc File Reference

UI dialogs. More...

#include <math.h>
#include <string.h>
#include <FL/fl_ask.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_File_Chooser.H>
#include <FL/Fl_Return_Button.H>
#include <FL/Fl_Text_Display.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Output.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Secret_Input.H>
#include <FL/Fl_Choice.H>
#include <FL/Fl_Menu_Item.H>
#include "msg.h"
#include "dialog.hh"
#include "misc.h"
#include "prefs.h"
#include "dlib/dlib.h"
Include dependency graph for dialog.cc:

Go to the source code of this file.

Functions

void a_Dialog_msg (const char *title, const char *msg)
 Display a message in a popup window.
 
static void input_cb (Fl_Widget *button, void *number)
 Callback for a_Dialog_input()
 
const char * a_Dialog_input (const char *title, const char *msg)
 Dialog for one line of Input with a message.
 
const char * a_Dialog_passwd (const char *title, const char *msg)
 Dialog for password.
 
const char * a_Dialog_save_file (const char *title, const char *pattern, const char *fname)
 Show the save file dialog.
 
const char * a_Dialog_select_file (const char *title, const char *pattern, const char *fname)
 Show the select file dialog.
 
char * a_Dialog_open_file (const char *title, const char *pattern, const char *fname)
 Show the open file dialog.
 
static void text_window_close_cb (Fl_Widget *, void *vtd)
 Close text window.
 
void a_Dialog_text_window (const char *title, const char *txt)
 Show a new window with the provided text.
 
static void choice_cb (Fl_Widget *button, void *number)
 
int a_Dialog_choice (const char *title, const char *msg,...)
 Make a question-dialog with a question and alternatives.
 
static void Dialog_user_password_cb (Fl_Widget *button, void *)
 
int a_Dialog_user_password (const char *title, const char *msg, UserPasswordCB cb, void *vp)
 Make a user/password dialog.
 

Variables

static int input_answer
 
static char * input_str = NULL
 
static int choice_answer
 

Detailed Description

UI dialogs.

Definition in file dialog.cc.

Function Documentation

◆ a_Dialog_choice()

int a_Dialog_choice ( const char *  title,
const char *  msg,
  ... 
)

Make a question-dialog with a question and alternatives.

Last parameter must be NULL.

Returns
0 = dialog was cancelled, >0 = selected alternative.

Definition at line 342 of file dialog.cc.

References _MSG, choice_answer, choice_cb(), DilloPrefs::font_factor, INT2VOIDP, MSG_ERR, prefs, and window.

Referenced by a_Dpiapi_dialog(), a_UIcmd_close_all_bw(), Nav_reload_callback(), Tls_check_cert_hostname(), Tls_check_cert_strength(), Tls_examine_certificate(), Tls_examine_certificate(), UIcmd_save_file_check(), and win_cb().

◆ a_Dialog_input()

const char * a_Dialog_input ( const char *  title,
const char *  msg 
)

Dialog for one line of Input with a message.

avoids the sound bell in fl_input(), and allows customization

Returns
string on success, NULL upon Cancel or Close window

Definition at line 151 of file dialog.cc.

References a_Misc_parse_search_url(), dFree(), dList_length(), dList_nth_data(), dStrdup(), input_answer, input_cb(), input_str, INT2VOIDP, prefs, DilloPrefs::search_url_idx, DilloPrefs::search_urls, and window.

Referenced by a_UIcmd_search_dialog().

◆ a_Dialog_msg()

void a_Dialog_msg ( const char *  title,
const char *  msg 
)

Display a message in a popup window.

Definition at line 127 of file dialog.cc.

Referenced by a_UIcmd_view_page_bugs().

◆ a_Dialog_open_file()

char * a_Dialog_open_file ( const char *  title,
const char *  pattern,
const char *  fname 
)

Show the open file dialog.

Returns
pointer to chosen filename, or NULL on Cancel.

Definition at line 272 of file dialog.cc.

References a_Misc_escape_chars().

Referenced by a_UIcmd_open_file().

◆ a_Dialog_passwd()

const char * a_Dialog_passwd ( const char *  title,
const char *  msg 
)

Dialog for password.

Definition at line 233 of file dialog.cc.

Referenced by a_UIcmd_get_passwd().

◆ a_Dialog_save_file()

const char * a_Dialog_save_file ( const char *  title,
const char *  pattern,
const char *  fname 
)

Show the save file dialog.

Returns
pointer to chosen filename, or NULL on Cancel.

Definition at line 246 of file dialog.cc.

Referenced by a_Dialog_select_file(), and UIcmd_save().

◆ a_Dialog_select_file()

const char * a_Dialog_select_file ( const char *  title,
const char *  pattern,
const char *  fname 
)

Show the select file dialog.

Returns
pointer to chosen filename, or NULL on Cancel.

Definition at line 257 of file dialog.cc.

References a_Dialog_save_file().

Referenced by a_UIcmd_select_file().

◆ a_Dialog_text_window()

void a_Dialog_text_window ( const char *  title,
const char *  txt 
)

Show a new window with the provided text.

Definition at line 296 of file dialog.cc.

References DilloPrefs::font_factor, DilloPrefs::height, prefs, text_window_close_cb(), DilloPrefs::width, and window.

Referenced by a_UIcmd_view_page_bugs().

◆ a_Dialog_user_password()

int a_Dialog_user_password ( const char *  title,
const char *  msg,
UserPasswordCB  cb,
void *  vp 
)

Make a user/password dialog.

Call the callback with the result (OK or not) and the given user and password if OK.

Definition at line 414 of file dialog.cc.

References _MSG, Dialog_user_password_cb(), and window.

Referenced by Auth_do_auth_dialog().

◆ choice_cb()

static void choice_cb ( Fl_Widget *  button,
void *  number 
)
static

Definition at line 328 of file dialog.cc.

References _MSG, choice_answer, and VOIDP2INT.

Referenced by a_Dialog_choice().

◆ Dialog_user_password_cb()

static void Dialog_user_password_cb ( Fl_Widget *  button,
void *   
)
static

Definition at line 403 of file dialog.cc.

Referenced by a_Dialog_user_password().

◆ input_cb()

static void input_cb ( Fl_Widget *  button,
void *  number 
)
static

Callback for a_Dialog_input()

Definition at line 139 of file dialog.cc.

References input_answer, and VOIDP2INT.

Referenced by a_Dialog_input().

◆ text_window_close_cb()

static void text_window_close_cb ( Fl_Widget *  ,
void *  vtd 
)
static

Close text window.

Definition at line 284 of file dialog.cc.

Referenced by a_Dialog_text_window().

Variable Documentation

◆ choice_answer

int choice_answer
static

Definition at line 43 of file dialog.cc.

Referenced by a_Dialog_choice(), and choice_cb().

◆ input_answer

int input_answer
static

Definition at line 41 of file dialog.cc.

Referenced by a_Dialog_input(), and input_cb().

◆ input_str

char* input_str = NULL
static

Definition at line 42 of file dialog.cc.

Referenced by a_Dialog_input().