ELinks 0.16.1.1
button.h File Reference
#include "bfu/common.h"
#include "util/align.h"
Include dependency graph for button.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  widget_info_button

Macros

#define B_ENTER   1
#define B_ESC   2
#define add_dlg_ok_button(dlg, text, flags, done, data)
 Add a button that will close the dialog if pressed.
#define add_dlg_button(dlg, text, flags, handler, data)
 Add a button that need not close the dialog if pressed.

Typedefs

typedef void done_handler_T(void *)

Functions

void add_dlg_button_do (struct dialog *dlg, char *text, int flags, widget_handler_T *handler, void *data, done_handler_T *done, void *done_data)
void dlg_format_buttons (struct dialog_data *, struct widget_data *, int, int, int *, int, int *, format_align_T, int)

Variables

const struct widget_ops button_ops

Macro Definition Documentation

◆ add_dlg_button

#define add_dlg_button ( dlg,
text,
flags,
handler,
data )
Value:
add_dlg_button_do(dlg, text, flags, handler, data, NULL, NULL)
void add_dlg_button_do(struct dialog *dlg, char *text, int flags, widget_handler_T *handler, void *data, done_handler_T *done, void *done_data)
Definition button.c:45
#define NULL
Definition explodename.c:35

Add a button that need not close the dialog if pressed.

void add_dlg_button(struct dialog *dlg, char *text, int flags, ::widget_handler_T *handler, void *data);

Parameters
handlerA function that BFU calls when the user presses this button. BFU does not automatically check the values of widgets or close the dialog.
dataA pointer to any data needed by handler. It does not get this pointer as a parameter but can read it from widget_data->widget->data.

The other parameters are as in add_dlg_ok_button.

◆ add_dlg_ok_button

#define add_dlg_ok_button ( dlg,
text,
flags,
done,
data )
Value:
add_dlg_button_do(dlg, text, flags, ok_dialog, NULL, done, data)
widget_handler_status_T ok_dialog(struct dialog_data *dlg_data, struct widget_data *widget_data)
Definition dialog.c:542

Add a button that will close the dialog if pressed.

void add_dlg_ok_button(struct dialog *dlg, char *text, int flags, ::done_handler_T *done, void *data);

Parameters
dlgThe dialog in which the button is to be added.
textText displayed in the button. This string should contain a keyboard accelerator, marked with a preceding '~'. The pointer must remain valid as long as the dialog exists.
flagsCan be B_ENTER, B_ESC, or 0.
doneA function that BFU calls when the user presses this button. Before calling this, BFU checks the values of widgets. After the function returns, BFU closes the dialog.
dataA pointer to be passed to the done callback.

◆ B_ENTER

#define B_ENTER   1

◆ B_ESC

#define B_ESC   2

Typedef Documentation

◆ done_handler_T

typedef void done_handler_T(void *)

Function Documentation

◆ add_dlg_button_do()

void add_dlg_button_do ( struct dialog * dlg,
char * text,
int flags,
widget_handler_T * handler,
void * data,
done_handler_T * done,
void * done_data )

◆ dlg_format_buttons()

void dlg_format_buttons ( struct dialog_data * dlg_data,
struct widget_data * widget_data,
int n,
int x,
int * y,
int w,
int * rw,
format_align_T align,
int format_only )

Variable Documentation

◆ button_ops

const struct widget_ops button_ops
extern