mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-18 17:29:28 +03:00
* widget.h: Use exact type in the listbox callback. Adjust all
legitimate users, remove all unused callbacks.
This commit is contained in:
parent
339bd16e5e
commit
58545e65c2
@ -2719,13 +2719,6 @@ edit_collect_completions (WEdit *edit, long start, int word_len,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
compllist_callback (void *data)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* let the user select its preferred completion */
|
/* let the user select its preferred completion */
|
||||||
static void
|
static void
|
||||||
edit_completion_dialog (WEdit *edit, int max_len, int word_len,
|
edit_completion_dialog (WEdit *edit, int max_len, int word_len,
|
||||||
@ -2766,8 +2759,7 @@ edit_completion_dialog (WEdit *edit, int max_len, int word_len,
|
|||||||
|
|
||||||
/* create the listbox */
|
/* create the listbox */
|
||||||
compl_list =
|
compl_list =
|
||||||
listbox_new (1, 1, compl_dlg_w - 2, compl_dlg_h - 2, 0,
|
listbox_new (1, 1, compl_dlg_w - 2, compl_dlg_h - 2, 0, NULL);
|
||||||
compllist_callback);
|
|
||||||
|
|
||||||
/* add the dialog */
|
/* add the dialog */
|
||||||
add_widget (compl_dlg, compl_list);
|
add_widget (compl_dlg, compl_list);
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
2003-09-01 Pavel Roskin <proski@gnu.org>
|
2003-09-01 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* widget.h: Use exact type in the listbox callback. Adjust all
|
||||||
|
legitimate users, remove all unused callbacks.
|
||||||
|
|
||||||
* boxes.c: Fix GUI code for some non-default configurations.
|
* boxes.c: Fix GUI code for some non-default configurations.
|
||||||
* listmode.c: Likewise.
|
* listmode.c: Likewise.
|
||||||
|
|
||||||
|
@ -217,11 +217,6 @@ static void update_mode (Dlg_head * h)
|
|||||||
send_message (h->current->widget, WIDGET_FOCUS, 0);
|
send_message (h->current->widget, WIDGET_FOCUS, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int l_call (void *data)
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int chl_callback (Dlg_head * h, int Par, int Msg)
|
static int chl_callback (Dlg_head * h, int Par, int Msg)
|
||||||
{
|
{
|
||||||
switch (Msg) {
|
switch (Msg) {
|
||||||
@ -265,7 +260,7 @@ do_enter_key (Dlg_head * h, int f_pos)
|
|||||||
"[Advanced Chown]", title, DLG_COMPACT);
|
"[Advanced Chown]", title, DLG_COMPACT);
|
||||||
|
|
||||||
/* get new listboxes */
|
/* get new listboxes */
|
||||||
chl_list = listbox_new (1, 1, 15, 11, 0, l_call);
|
chl_list = listbox_new (1, 1, 15, 11, 0, NULL);
|
||||||
|
|
||||||
listbox_add_item (chl_list, 0, 0, "<Unknown>", NULL);
|
listbox_add_item (chl_list, 0, 0, "<Unknown>", NULL);
|
||||||
|
|
||||||
|
10
src/chown.c
10
src/chown.c
@ -141,12 +141,6 @@ chown_callback (Dlg_head * h, int Par, int Msg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
l_call (void *data)
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Dlg_head *
|
static Dlg_head *
|
||||||
init_chown (void)
|
init_chown (void)
|
||||||
{
|
{
|
||||||
@ -177,8 +171,8 @@ init_chown (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* get new listboxes */
|
/* get new listboxes */
|
||||||
l_user = listbox_new (UY + 1, UX + 1, 19, 10, 0, l_call);
|
l_user = listbox_new (UY + 1, UX + 1, 19, 10, 0, NULL);
|
||||||
l_group = listbox_new (GY + 1, GX + 1, 19, 10, 0, l_call);
|
l_group = listbox_new (GY + 1, GX + 1, 19, 10, 0, NULL);
|
||||||
|
|
||||||
/* add fields for unknown names (numbers) */
|
/* add fields for unknown names (numbers) */
|
||||||
listbox_add_item (l_user, 0, 0, _("<Unknown user>"), NULL);
|
listbox_add_item (l_user, 0, 0, _("<Unknown user>"), NULL);
|
||||||
|
@ -909,11 +909,6 @@ query_callback (Dlg_head * h, int Par, int Msg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int querylist_callback (void *data)
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define DO_INSERTION 1
|
#define DO_INSERTION 1
|
||||||
#define DO_QUERY 2
|
#define DO_QUERY 2
|
||||||
/* Returns 1 if the user would like to see us again */
|
/* Returns 1 if the user would like to see us again */
|
||||||
@ -985,7 +980,7 @@ complete_engine (WInput *in, int what_to_do)
|
|||||||
query_dlg = create_dlg (y, x, query_height, query_width,
|
query_dlg = create_dlg (y, x, query_height, query_width,
|
||||||
dialog_colors, query_callback,
|
dialog_colors, query_callback,
|
||||||
"[Completion]", NULL, DLG_COMPACT);
|
"[Completion]", NULL, DLG_COMPACT);
|
||||||
query_list = listbox_new (1, 1, w - 2, h - 2, 0, querylist_callback);
|
query_list = listbox_new (1, 1, w - 2, h - 2, 0, NULL);
|
||||||
add_widget (query_dlg, query_list);
|
add_widget (query_dlg, query_list);
|
||||||
for (p = in->completions + 1; *p; p++)
|
for (p = in->completions + 1; *p; p++)
|
||||||
listbox_add_item (query_list, 0, 0, *p, NULL);
|
listbox_add_item (query_list, 0, 0, *p, NULL);
|
||||||
|
@ -476,9 +476,8 @@ l1:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int l_call (void *l)
|
static int l_call (WListbox *list)
|
||||||
{
|
{
|
||||||
WListbox *list = (WListbox *) l;
|
|
||||||
Dlg_head *dlg = hotlist_state.moving ? movelist_dlg : hotlist_dlg;
|
Dlg_head *dlg = hotlist_state.moving ? movelist_dlg : hotlist_dlg;
|
||||||
|
|
||||||
if (list->current){
|
if (list->current){
|
||||||
|
@ -147,12 +147,6 @@ listmode_callback (Dlg_head * h, int Par, int Msg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
l_call (void *data)
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Dlg_head *
|
static Dlg_head *
|
||||||
init_listmode (char *oldlistformat)
|
init_listmode (char *oldlistformat)
|
||||||
{
|
{
|
||||||
@ -198,7 +192,7 @@ init_listmode (char *oldlistformat)
|
|||||||
radio_justify->sel = 1;
|
radio_justify->sel = 1;
|
||||||
|
|
||||||
/* get new listbox */
|
/* get new listbox */
|
||||||
l_listmode = listbox_new (UY + 5, UX + 1, 16, 9, 0, l_call);
|
l_listmode = listbox_new (UY + 5, UX + 1, 16, 9, 0, NULL);
|
||||||
|
|
||||||
if (strncmp (oldlistformat, "full ", 5) == 0) {
|
if (strncmp (oldlistformat, "full ", 5) == 0) {
|
||||||
format_width = 1;
|
format_width = 1;
|
||||||
|
@ -113,11 +113,6 @@ panelize_callback (Dlg_head * h, int Par, int Msg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int l_call (void *data)
|
|
||||||
{
|
|
||||||
return listbox_nothing;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
init_panelize (void)
|
init_panelize (void)
|
||||||
{
|
{
|
||||||
@ -171,13 +166,11 @@ init_panelize (void)
|
|||||||
"in");
|
"in");
|
||||||
add_widget (panelize_dlg, pname);
|
add_widget (panelize_dlg, pname);
|
||||||
|
|
||||||
add_widget (panelize_dlg,
|
add_widget (panelize_dlg, label_new (UY + 13, UX, _("Command")));
|
||||||
label_new (UY + 13, UX, _("Command")));
|
|
||||||
|
|
||||||
/* get new listbox */
|
/* get new listbox */
|
||||||
l_panelize =
|
l_panelize =
|
||||||
listbox_new (UY + 1, UX + 1, panelize_dlg->cols - 12, 10, 0,
|
listbox_new (UY + 1, UX + 1, panelize_dlg->cols - 12, 10, 0, NULL);
|
||||||
l_call);
|
|
||||||
|
|
||||||
while (current) {
|
while (current) {
|
||||||
listbox_add_item (l_panelize, 0, 0, current->label, current);
|
listbox_add_item (l_panelize, 0, 0, current->label, current);
|
||||||
|
12
src/widget.h
12
src/widget.h
@ -91,10 +91,6 @@ typedef struct WLEntry {
|
|||||||
struct WLEntry *prev;
|
struct WLEntry *prev;
|
||||||
} WLEntry;
|
} WLEntry;
|
||||||
|
|
||||||
enum {
|
|
||||||
listbox_begin, listbox_end
|
|
||||||
} /* listbox_insert */;
|
|
||||||
|
|
||||||
/* Listbox actions when selecting an option: */
|
/* Listbox actions when selecting an option: */
|
||||||
enum {
|
enum {
|
||||||
listbox_nothing,
|
listbox_nothing,
|
||||||
@ -102,9 +98,11 @@ enum {
|
|||||||
listbox_cback /* call the callback routine */
|
listbox_cback /* call the callback routine */
|
||||||
} /* listbox_action */;
|
} /* listbox_action */;
|
||||||
|
|
||||||
typedef int (*lcback) (void *);
|
struct WListbox;
|
||||||
|
typedef struct WListbox WListbox;
|
||||||
|
typedef int (*lcback) (WListbox *);
|
||||||
|
|
||||||
typedef struct WListbox {
|
struct WListbox {
|
||||||
Widget widget;
|
Widget widget;
|
||||||
WLEntry *list; /* Pointer to the circular double linked list. */
|
WLEntry *list; /* Pointer to the circular double linked list. */
|
||||||
WLEntry *top; /* The first element displayed */
|
WLEntry *top; /* The first element displayed */
|
||||||
@ -118,7 +116,7 @@ typedef struct WListbox {
|
|||||||
int scrollbar; /* Draw a scrollbar? */
|
int scrollbar; /* Draw a scrollbar? */
|
||||||
lcback cback; /* The callback function */
|
lcback cback; /* The callback function */
|
||||||
int cursor_x, cursor_y; /* Cache the values */
|
int cursor_x, cursor_y; /* Cache the values */
|
||||||
} WListbox;
|
};
|
||||||
|
|
||||||
typedef void (*buttonbarfn)(void *);
|
typedef void (*buttonbarfn)(void *);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user