* dlg.h (struct Widget): Remove tkname field.
(init_widget): Remove tkname argument. * widget.h (listbox_new): Likewise. Adjust all dependencies.
Этот коммит содержится в:
родитель
78ddb598a6
Коммит
10f65ac83d
@ -2767,7 +2767,7 @@ edit_completion_dialog (WEdit *edit, int max_len, int word_len,
|
||||
/* create the listbox */
|
||||
compl_list =
|
||||
listbox_new (1, 1, compl_dlg_w - 2, compl_dlg_h - 2, 0,
|
||||
compllist_callback, NULL);
|
||||
compllist_callback);
|
||||
|
||||
/* add the dialog */
|
||||
add_widget (compl_dlg, compl_list);
|
||||
|
@ -187,7 +187,7 @@ edit (const char *_file, int line)
|
||||
|
||||
init_widget (&(wedit->widget), 0, 0, LINES - 1, COLS,
|
||||
(callback_fn) edit_callback, (destroy_fn) edit_clean,
|
||||
(mouse_h) edit_mouse_event, 0);
|
||||
(mouse_h) edit_mouse_event);
|
||||
|
||||
widget_want_cursor (wedit->widget, 1);
|
||||
|
||||
|
@ -1,3 +1,10 @@
|
||||
2003-08-31 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* dlg.h (struct Widget): Remove tkname field.
|
||||
(init_widget): Remove tkname argument.
|
||||
* widget.h (listbox_new): Likewise.
|
||||
Adjust all dependencies.
|
||||
|
||||
2003-08-29 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||
|
||||
* cmd.c (edit_symlink_cmd): Fix possible off-by-one after
|
||||
|
@ -265,7 +265,7 @@ do_enter_key (Dlg_head * h, int f_pos)
|
||||
"[Advanced Chown]", title, DLG_COMPACT);
|
||||
|
||||
/* get new listboxes */
|
||||
chl_list = listbox_new (1, 1, 15, 11, 0, l_call, NULL);
|
||||
chl_list = listbox_new (1, 1, 15, 11, 0, l_call);
|
||||
|
||||
listbox_add_item (chl_list, 0, 0, "<Unknown>", NULL);
|
||||
|
||||
|
@ -975,7 +975,7 @@ jobs_cmd (void)
|
||||
"[Background jobs]", _("Background Jobs"),
|
||||
DLG_CENTER);
|
||||
|
||||
bg_list = listbox_new (2, 3, JOBS_X-7, JOBS_Y-9, listbox_nothing, 0, "listbox");
|
||||
bg_list = listbox_new (2, 3, JOBS_X-7, JOBS_Y-9, listbox_nothing, 0);
|
||||
add_widget (jobs_dlg, bg_list);
|
||||
|
||||
i = n_buttons;
|
||||
|
@ -177,8 +177,8 @@ init_chown (void)
|
||||
}
|
||||
|
||||
/* get new listboxes */
|
||||
l_user = listbox_new (UY + 1, UX + 1, 19, 10, 0, l_call, NULL);
|
||||
l_group = listbox_new (GY + 1, GX + 1, 19, 10, 0, l_call, NULL);
|
||||
l_user = listbox_new (UY + 1, UX + 1, 19, 10, 0, l_call);
|
||||
l_group = listbox_new (GY + 1, GX + 1, 19, 10, 0, l_call);
|
||||
|
||||
/* add fields for unknown names (numbers) */
|
||||
listbox_add_item (l_user, 0, 0, _("<Unknown user>"), NULL);
|
||||
|
@ -985,7 +985,7 @@ complete_engine (WInput *in, int what_to_do)
|
||||
query_dlg = create_dlg (y, x, query_height, query_width,
|
||||
dialog_colors, query_callback,
|
||||
"[Completion]", NULL, DLG_COMPACT);
|
||||
query_list = listbox_new (1, 1, w - 2, h - 2, 0, querylist_callback, NULL);
|
||||
query_list = listbox_new (1, 1, w - 2, h - 2, 0, querylist_callback);
|
||||
add_widget (query_dlg, query_list);
|
||||
for (p = in->completions + 1; *p; p++)
|
||||
listbox_add_item (query_list, 0, 0, *p, NULL);
|
||||
|
@ -119,7 +119,7 @@ void dlg_erase (Dlg_head *h)
|
||||
void
|
||||
init_widget (Widget *w, int y, int x, int lines, int cols,
|
||||
callback_fn callback, destroy_fn destroy,
|
||||
mouse_h mouse_handler, char *tkname)
|
||||
mouse_h mouse_handler)
|
||||
{
|
||||
w->x = x;
|
||||
w->y = y;
|
||||
@ -129,12 +129,7 @@ init_widget (Widget *w, int y, int x, int lines, int cols,
|
||||
w->destroy = destroy;
|
||||
w->mouse = mouse_handler;
|
||||
w->parent = 0;
|
||||
w->tkname = tkname;
|
||||
|
||||
if (tkname && *tkname == 0) {
|
||||
fprintf (stderr, "Got a null string for the tkname\n");
|
||||
abort ();
|
||||
}
|
||||
/* Almost all widgets want to put the cursor in a suitable place */
|
||||
w->options = W_WANT_CURSOR;
|
||||
}
|
||||
|
@ -112,7 +112,6 @@ typedef struct Widget {
|
||||
destroy_fn destroy;
|
||||
mouse_h mouse;
|
||||
struct Dlg_head *parent;
|
||||
char *tkname; /* name used for history saving */
|
||||
} Widget;
|
||||
|
||||
/* The options for the widgets */
|
||||
@ -171,7 +170,7 @@ void dlg_broadcast_msg (Dlg_head *h, int message, int reverse);
|
||||
|
||||
void init_widget (Widget *w, int y, int x, int lines, int cols,
|
||||
callback_fn callback, destroy_fn destroy,
|
||||
mouse_h mouse_handler, char *tkname);
|
||||
mouse_h mouse_handler);
|
||||
|
||||
/* Default callback for dialogs */
|
||||
int default_dlg_callback (Dlg_head *h, int id, int msg);
|
||||
|
@ -802,9 +802,9 @@ setup_gui (void)
|
||||
fbuts[7].x = fbuts[6].x + fbuts[6].len + l2;
|
||||
}
|
||||
|
||||
find_dlg = create_dlg (0, 0, FIND2_Y, FIND2_X, dialog_colors,
|
||||
find_callback, "[Find File]", _("Find File"),
|
||||
DLG_CENTER);
|
||||
find_dlg =
|
||||
create_dlg (0, 0, FIND2_Y, FIND2_X, dialog_colors, find_callback,
|
||||
"[Find File]", _("Find File"), DLG_CENTER);
|
||||
|
||||
add_widget (find_dlg,
|
||||
button_new (FIND2_Y - 3, fbuts[7].x, B_VIEW, NORMAL_BUTTON,
|
||||
@ -841,8 +841,7 @@ setup_gui (void)
|
||||
add_widget (find_dlg, status_label);
|
||||
|
||||
find_list =
|
||||
listbox_new (2, 2, FIND2_X - 4, FIND2_Y - 9, listbox_finish, 0,
|
||||
"listbox");
|
||||
listbox_new (2, 2, FIND2_X - 4, FIND2_Y - 9, listbox_finish, 0);
|
||||
add_widget (find_dlg, find_list);
|
||||
}
|
||||
|
||||
|
@ -592,7 +592,7 @@ static Widget *mousedispatch_new (int y, int x, int yl, int xl)
|
||||
Widget *w = g_new (Widget, 1);
|
||||
|
||||
init_widget (w, y, x, yl, xl,
|
||||
(callback_fn) md_callback, 0, (mouse_h) help_event, NULL);
|
||||
(callback_fn) md_callback, 0, (mouse_h) help_event);
|
||||
|
||||
return w;
|
||||
}
|
||||
|
@ -645,7 +645,7 @@ init_hotlist (int list_type)
|
||||
/* get new listbox */
|
||||
l_hotlist =
|
||||
listbox_new (UY + 1, UX + 1, COLS - 2 * UX - 8, LINES - 14,
|
||||
listbox_cback, l_call, "listbox");
|
||||
listbox_cback, l_call);
|
||||
|
||||
/* Fill the hotlist with the active VFS or the hotlist */
|
||||
#ifdef USE_VFS
|
||||
@ -694,8 +694,7 @@ init_movelist (int list_type, struct hotlist *item)
|
||||
/* get new listbox */
|
||||
l_movelist =
|
||||
listbox_new (UY + 1, UX + 1, movelist_dlg->cols - 2 * UX - 2,
|
||||
movelist_dlg->lines - 8, listbox_cback, l_call,
|
||||
"listbox");
|
||||
movelist_dlg->lines - 8, listbox_cback, l_call);
|
||||
|
||||
fill_listbox ();
|
||||
|
||||
|
@ -248,7 +248,7 @@ WInfo *info_new ()
|
||||
|
||||
init_widget (&info->widget, 0, 0, 0, 0, (callback_fn)
|
||||
info_callback, (destroy_fn) info_destroy,
|
||||
(mouse_h) info_event, NULL);
|
||||
(mouse_h) info_event);
|
||||
|
||||
/* We do not want the cursor */
|
||||
widget_want_cursor (info->widget, 0);
|
||||
|
@ -195,7 +195,7 @@ init_listmode (char *oldlistformat)
|
||||
radio_justify->sel = 1;
|
||||
|
||||
/* get new listbox */
|
||||
l_listmode = listbox_new (UY + 5, UX + 1, 16, 9, 0, l_call, NULL);
|
||||
l_listmode = listbox_new (UY + 5, UX + 1, 16, 9, 0, l_call);
|
||||
|
||||
if (strncmp (oldlistformat, "full ", 5) == 0) {
|
||||
format_width = 1;
|
||||
|
14
src/menu.c
14
src/menu.c
@ -531,21 +531,21 @@ destroy_menu (Menu *menu)
|
||||
g_free (menu);
|
||||
}
|
||||
|
||||
WMenu *menubar_new (int y, int x, int cols, Menu *menu [], int items)
|
||||
WMenu *
|
||||
menubar_new (int y, int x, int cols, Menu *menu[], int items)
|
||||
{
|
||||
WMenu *menubar = g_new0 (WMenu, 1); /* FIXME: subsel used w/o being set */
|
||||
|
||||
WMenu *menubar = g_new0 (WMenu, 1); /* FIXME: subsel used w/o being set */
|
||||
|
||||
init_widget (&menubar->widget, y, x, 1, cols,
|
||||
(callback_fn) menubar_callback,
|
||||
(destroy_fn) menubar_destroy,
|
||||
(mouse_h) menubar_event, NULL);
|
||||
(callback_fn) menubar_callback,
|
||||
(destroy_fn) menubar_destroy, (mouse_h) menubar_event);
|
||||
menubar->menu = menu;
|
||||
menubar->active = 0;
|
||||
menubar->dropped = 0;
|
||||
menubar->items = items;
|
||||
menubar->selected = 0;
|
||||
widget_want_cursor (menubar->widget, 0);
|
||||
menubar_arrange(menubar);
|
||||
menubar_arrange (menubar);
|
||||
|
||||
return menubar;
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ static void init_panelize (void)
|
||||
add_widget (panelize_dlg, label_new (UY+13, UX, _("Command"), "label-command"));
|
||||
|
||||
/* get new listbox */
|
||||
l_panelize = listbox_new (UY + 1, UX + 1, panelize_dlg->cols-12, 10, 0, l_call, "li");
|
||||
l_panelize = listbox_new (UY + 1, UX + 1, panelize_dlg->cols-12, 10, 0, l_call);
|
||||
|
||||
while (current){
|
||||
listbox_add_item (l_panelize, 0, 0, current->label, current);
|
||||
|
@ -934,7 +934,7 @@ panel_new (const char *panel_name)
|
||||
/* No know sizes of the panel at startup */
|
||||
init_widget (&panel->widget, 0, 0, 0, 0, (callback_fn)
|
||||
panel_callback, (destroy_fn) panel_destroy,
|
||||
(mouse_h) panel_event, NULL);
|
||||
(mouse_h) panel_event);
|
||||
|
||||
/* We do not want the cursor */
|
||||
widget_want_cursor (panel->widget, 0);
|
||||
|
@ -1072,7 +1072,7 @@ tree_new (int is_panel, int y, int x, int lines, int cols)
|
||||
|
||||
init_widget (&tree->widget, y, x, lines, cols,
|
||||
(callback_fn) tree_callback, (destroy_fn) tree_destroy,
|
||||
(mouse_h) event_callback, NULL);
|
||||
(mouse_h) event_callback);
|
||||
tree->is_panel = is_panel;
|
||||
tree->selected_ptr = 0;
|
||||
|
||||
|
@ -2745,7 +2745,7 @@ view_new (int y, int x, int cols, int lines, int is_panel)
|
||||
init_widget (&view->widget, y, x, lines, cols,
|
||||
(callback_fn) view_callback,
|
||||
(destroy_fn) view_destroy,
|
||||
(mouse_h) real_view_event, NULL);
|
||||
(mouse_h) real_view_event);
|
||||
|
||||
view->hex_mode = default_hex_mode;
|
||||
view->hexedit_mode = default_hexedit_mode;
|
||||
|
48
src/widget.c
48
src/widget.c
@ -210,7 +210,7 @@ button_new (int y, int x, int action, int flags, char *text,
|
||||
|
||||
init_widget (&b->widget, y, x, 1, button_len (text, flags),
|
||||
(callback_fn) button_callback,
|
||||
(destroy_fn) button_destroy, (mouse_h)button_event, tkname);
|
||||
(destroy_fn) button_destroy, (mouse_h)button_event);
|
||||
|
||||
b->action = action;
|
||||
b->flags = flags;
|
||||
@ -362,7 +362,7 @@ radio_new (int y, int x, int count, char **texts, int use_hotkey, char *tkname)
|
||||
}
|
||||
|
||||
init_widget (&r->widget, y, x, count, max, (callback_fn) radio_callback,
|
||||
0, (mouse_h) radio_event, tkname);
|
||||
0, (mouse_h) radio_event);
|
||||
r->state = 1;
|
||||
r->pos = 0;
|
||||
r->sel = 0;
|
||||
@ -457,7 +457,7 @@ check_new (int y, int x, int state, char *text, char *tkname)
|
||||
|
||||
init_widget (&c->widget, y, x, 1, strlen (text),
|
||||
(callback_fn)check_callback,
|
||||
(destroy_fn)check_destroy, (mouse_h) check_event, tkname);
|
||||
(destroy_fn)check_destroy, (mouse_h) check_event);
|
||||
c->state = state ? C_BOOL : 0;
|
||||
c->text = g_strdup (text);
|
||||
c->hotkey = 0;
|
||||
@ -576,7 +576,7 @@ label_new (int y, int x, const char *text, char *tkname)
|
||||
l = g_new (WLabel, 1);
|
||||
init_widget (&l->widget, y, x, 1, width,
|
||||
(callback_fn) label_callback,
|
||||
(destroy_fn) label_destroy, NULL, tkname);
|
||||
(destroy_fn) label_destroy, NULL);
|
||||
l->text = text ? g_strdup (text) : 0;
|
||||
l->auto_adjust_cols = 1;
|
||||
l->transparent = 0;
|
||||
@ -668,7 +668,7 @@ gauge_new (int y, int x, int shown, int max, int current, char *tkname)
|
||||
|
||||
init_widget (&g->widget, y, x, 1, gauge_len,
|
||||
(callback_fn) gauge_callback,
|
||||
(destroy_fn) gauge_destroy, NULL, tkname);
|
||||
(destroy_fn) gauge_destroy, NULL);
|
||||
g->shown = shown;
|
||||
if (max == 0)
|
||||
max = 1; /* I do not like division by zero :) */
|
||||
@ -954,7 +954,7 @@ show_hist (GList *history, int widget_x, int widget_y)
|
||||
query_dlg =
|
||||
create_dlg (y, x, h, w, dialog_colors, NULL, "[History-query]",
|
||||
i18n_htitle (), DLG_COMPACT);
|
||||
query_list = listbox_new (1, 1, w - 2, h - 2, listbox_finish, 0, NULL);
|
||||
query_list = listbox_new (1, 1, w - 2, h - 2, listbox_finish, 0);
|
||||
add_widget (query_dlg, query_list);
|
||||
hi = z;
|
||||
if (y < widget_y) {
|
||||
@ -1606,7 +1606,7 @@ input_new (int y, int x, int color, int len, const char *def_text, char *tkname)
|
||||
|
||||
init_widget (&in->widget, y, x, 1, len,
|
||||
(callback_fn) input_callback,
|
||||
(destroy_fn) input_destroy, (mouse_h) input_event, tkname);
|
||||
(destroy_fn) input_destroy, (mouse_h) input_event);
|
||||
|
||||
/* history setup */
|
||||
in->history = NULL;
|
||||
@ -2089,32 +2089,32 @@ listbox_destroy (WListbox *l)
|
||||
}
|
||||
|
||||
WListbox *
|
||||
listbox_new (int y, int x, int width, int height,
|
||||
int action, lcback callback, char *tkname)
|
||||
listbox_new (int y, int x, int width, int height, int action,
|
||||
lcback callback)
|
||||
{
|
||||
WListbox *l = g_new (WListbox, 1);
|
||||
extern int slow_terminal;
|
||||
|
||||
init_widget (&l->widget, y, x, height, width,
|
||||
(callback_fn)listbox_callback,
|
||||
(destroy_fn) listbox_destroy, (mouse_h)listbox_event, tkname);
|
||||
|
||||
l->list = l->top = l->current = 0;
|
||||
l->pos = 0;
|
||||
l->width = width;
|
||||
init_widget (&l->widget, y, x, height, width,
|
||||
(callback_fn) listbox_callback,
|
||||
(destroy_fn) listbox_destroy, (mouse_h) listbox_event);
|
||||
|
||||
l->list = l->top = l->current = 0;
|
||||
l->pos = 0;
|
||||
l->width = width;
|
||||
if (height <= 0)
|
||||
l->height = 1;
|
||||
l->height = 1;
|
||||
else
|
||||
l->height = height;
|
||||
l->count = 0;
|
||||
l->top = 0;
|
||||
l->current= 0;
|
||||
l->cback = callback;
|
||||
l->height = height;
|
||||
l->count = 0;
|
||||
l->top = 0;
|
||||
l->current = 0;
|
||||
l->cback = callback;
|
||||
l->action = action;
|
||||
l->allow_duplicates = 1;
|
||||
l->scrollbar = slow_terminal ? 0 : 1;
|
||||
widget_want_hotkey (l->widget, 1);
|
||||
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
@ -2291,7 +2291,7 @@ buttonbar_new (int visible)
|
||||
|
||||
init_widget (&bb->widget, LINES-1, 0, 1, COLS,
|
||||
(callback_fn) buttonbar_callback,
|
||||
(destroy_fn) buttonbar_destroy, (mouse_h) buttonbar_event, NULL);
|
||||
(destroy_fn) buttonbar_destroy, (mouse_h) buttonbar_event);
|
||||
|
||||
bb->visible = visible;
|
||||
for (i = 0; i < 10; i++){
|
||||
|
@ -141,8 +141,7 @@ WCheck *check_new (int y, int x, int state, char *text, char *tkname);
|
||||
WInput *input_new (int y, int x, int color, int len, const char *text, char *tkname);
|
||||
WLabel *label_new (int y, int x, const char *text, char *tkname);
|
||||
WGauge *gauge_new (int y, int x, int shown, int max, int current, char *tkname);
|
||||
WListbox *listbox_new (int x, int y, int width, int height, int action,
|
||||
lcback, char *tkname);
|
||||
WListbox *listbox_new (int x, int y, int width, int height, int action, lcback callback);
|
||||
|
||||
/* Input lines */
|
||||
void winput_set_origin (WInput *i, int x, int field_len);
|
||||
|
@ -76,7 +76,7 @@ Listbox *create_listbox_window (int cols, int lines, char *title, char *help)
|
||||
listbox->dlg = create_dlg (ypos, xpos, lines+6, cols+4, dialog_colors,
|
||||
NULL, help, title, DLG_CENTER);
|
||||
|
||||
listbox->list = listbox_new (2, 2, cols, lines, listbox_finish, 0, "li");
|
||||
listbox->list = listbox_new (2, 2, cols, lines, listbox_finish, 0);
|
||||
|
||||
add_widget (listbox->dlg,
|
||||
button_new (lines+3, (cols/2 + 2) - len/2,
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user