* dialog.c (dlg_select_widget): Remove first argument, it's
redundant. Adjust all callers. (dlg_replace_widget): Likewise.
Этот коммит содержится в:
родитель
b5b70bce10
Коммит
9260860bbf
@ -457,7 +457,7 @@ edit_drop_menu_cmd (WEdit *e, int which)
|
||||
}
|
||||
|
||||
edit_menubar->previous_widget = e->widget.parent->current->dlg_id;
|
||||
dlg_select_widget (e->widget.parent, edit_menubar);
|
||||
dlg_select_widget (edit_menubar);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
2005-05-20 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* dialog.c (dlg_select_widget): Remove first argument, it's
|
||||
redundant. Adjust all callers.
|
||||
(dlg_replace_widget): Likewise.
|
||||
|
||||
2005-05-11 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* charsets.c (translate_character): Fixed checking of the return
|
||||
|
@ -121,8 +121,8 @@ display_callback (struct Dlg_head *h, dlg_msg_t msg, int parm)
|
||||
if (tolower (parm) == user_hotkey && dlg_widget_active (user)
|
||||
&& dlg_widget_active (status)) {
|
||||
my_radio->sel = 3;
|
||||
dlg_select_widget (h, my_radio); /* force redraw */
|
||||
dlg_select_widget (h, user);
|
||||
dlg_select_widget (my_radio); /* force redraw */
|
||||
dlg_select_widget (user);
|
||||
return MSG_HANDLED;
|
||||
}
|
||||
return MSG_NOT_HANDLED;
|
||||
|
13
src/dialog.c
13
src/dialog.c
@ -411,7 +411,7 @@ dlg_select_by_id (Dlg_head *h, int id)
|
||||
} while (w != h->current);
|
||||
|
||||
if (w_found)
|
||||
dlg_select_widget(h, w_found);
|
||||
dlg_select_widget(w_found);
|
||||
}
|
||||
|
||||
|
||||
@ -464,9 +464,9 @@ do_select_widget (Dlg_head *h, Widget *w, select_dir_t dir)
|
||||
* Try to select widget in the dialog.
|
||||
*/
|
||||
void
|
||||
dlg_select_widget (Dlg_head *h, void *w)
|
||||
dlg_select_widget (void *w)
|
||||
{
|
||||
do_select_widget (h, w, SELECT_NEXT);
|
||||
do_select_widget (((Widget *) w)->parent, w, SELECT_NEXT);
|
||||
}
|
||||
|
||||
|
||||
@ -830,10 +830,11 @@ void widget_set_size (Widget *widget, int y, int x, int lines, int cols)
|
||||
send_message (widget, WIDGET_RESIZED, 0 /* unused */);
|
||||
}
|
||||
|
||||
/* Replace widget old_w for widget new_w in the dialog h */
|
||||
/* Replace widget old_w for widget new_w in the dialog */
|
||||
void
|
||||
dlg_replace_widget (Dlg_head *h, Widget *old_w, Widget *new_w)
|
||||
dlg_replace_widget (Widget *old_w, Widget *new_w)
|
||||
{
|
||||
Dlg_head *h = old_w->parent;
|
||||
int should_focus = 0;
|
||||
|
||||
if (!h->current)
|
||||
@ -863,7 +864,7 @@ dlg_replace_widget (Dlg_head *h, Widget *old_w, Widget *new_w)
|
||||
send_message (new_w, WIDGET_INIT, 0);
|
||||
|
||||
if (should_focus)
|
||||
dlg_select_widget (h, new_w);
|
||||
dlg_select_widget (new_w);
|
||||
|
||||
send_message (new_w, WIDGET_DRAW, 0);
|
||||
}
|
||||
|
@ -209,14 +209,14 @@ dlg_widget_active (void *w)
|
||||
return (w1->parent->current == w1);
|
||||
}
|
||||
|
||||
void dlg_replace_widget (Dlg_head *h, Widget *old, Widget *new);
|
||||
void dlg_replace_widget (Widget *old, Widget *new);
|
||||
int dlg_overlap (Widget *a, Widget *b);
|
||||
void widget_erase (Widget *);
|
||||
void dlg_erase (Dlg_head *h);
|
||||
void dlg_stop (Dlg_head *h);
|
||||
|
||||
/* Widget selection */
|
||||
void dlg_select_widget (Dlg_head *h, void *widget);
|
||||
void dlg_select_widget (void *widget);
|
||||
void dlg_one_up (Dlg_head *h);
|
||||
void dlg_one_down (Dlg_head *h);
|
||||
int dlg_focus (Dlg_head *h);
|
||||
|
@ -166,7 +166,7 @@ find_parm_callback (struct Dlg_head *h, dlg_msg_t msg, int parm)
|
||||
|
||||
if (regcomp (r, in_with->buffer, flags)) {
|
||||
message (1, MSG_ERROR, _(" Malformed regular expression "));
|
||||
dlg_select_widget (h, in_with);
|
||||
dlg_select_widget (in_with);
|
||||
h->running = 1; /* Don't stop the dialog */
|
||||
}
|
||||
return MSG_HANDLED;
|
||||
@ -290,7 +290,7 @@ find_parameters (char **start_dir, char **pattern, char **content)
|
||||
add_widget (find_dlg, label_new (5, 3, labs[1]));
|
||||
add_widget (find_dlg, label_new (3, 3, labs[0]));
|
||||
|
||||
dlg_select_widget (find_dlg, in_name);
|
||||
dlg_select_widget (in_name);
|
||||
|
||||
run_dlg (find_dlg);
|
||||
|
||||
|
@ -467,9 +467,9 @@ hotlist_callback (Dlg_head *h, dlg_msg_t msg, int parm)
|
||||
|
||||
case DLG_POST_KEY:
|
||||
if (hotlist_state.moving)
|
||||
dlg_select_widget (movelist_dlg, l_movelist);
|
||||
dlg_select_widget (l_movelist);
|
||||
else
|
||||
dlg_select_widget (hotlist_dlg, l_hotlist);
|
||||
dlg_select_widget (l_hotlist);
|
||||
/* always stay on hotlist */
|
||||
/* fall through */
|
||||
|
||||
|
14
src/layout.c
14
src/layout.c
@ -230,8 +230,8 @@ static int b2left_cback (int action)
|
||||
/* Turn equal split off */
|
||||
_equal_split = 0;
|
||||
check_options [6].widget->state = check_options [6].widget->state & ~C_BOOL;
|
||||
dlg_select_widget (layout_dlg, check_options [6].widget);
|
||||
dlg_select_widget (layout_dlg, bleft_widget);
|
||||
dlg_select_widget (check_options [6].widget);
|
||||
dlg_select_widget (bleft_widget);
|
||||
}
|
||||
_first_panel_size++;
|
||||
return 0;
|
||||
@ -245,8 +245,8 @@ static int b2right_cback (int action)
|
||||
/* Turn equal split off */
|
||||
_equal_split = 0;
|
||||
check_options [6].widget->state = check_options [6].widget->state & ~C_BOOL;
|
||||
dlg_select_widget (layout_dlg, check_options [6].widget);
|
||||
dlg_select_widget (layout_dlg, bright_widget);
|
||||
dlg_select_widget (check_options [6].widget);
|
||||
dlg_select_widget (bright_widget);
|
||||
}
|
||||
_first_panel_size--;
|
||||
return 0;
|
||||
@ -977,7 +977,7 @@ void set_display_type (int num, int type)
|
||||
/* We use replace to keep the circular list of the dialog in the */
|
||||
/* same state. Maybe we could just kill it and then replace it */
|
||||
if (midnight_dlg && old_widget){
|
||||
dlg_replace_widget (midnight_dlg, old_widget, panels [num].widget);
|
||||
dlg_replace_widget (old_widget, panels [num].widget);
|
||||
}
|
||||
if (type == view_listing){
|
||||
if (num == 0)
|
||||
@ -1044,9 +1044,9 @@ void swap_panels ()
|
||||
current_panel = panel1;
|
||||
|
||||
if (dlg_widget_active (panels[0].widget))
|
||||
dlg_select_widget (midnight_dlg, (void *) panels [1].widget);
|
||||
dlg_select_widget (panels [1].widget);
|
||||
else if (dlg_widget_active (panels[1].widget))
|
||||
dlg_select_widget (midnight_dlg, (void *) panels [0].widget);
|
||||
dlg_select_widget (panels [0].widget);
|
||||
} else {
|
||||
WPanel *tmp_panel;
|
||||
|
||||
|
@ -121,7 +121,7 @@ _("Please press the %s\n"
|
||||
|
||||
dlg_run_done (d);
|
||||
destroy_dlg (d);
|
||||
dlg_select_widget (learn_dlg, learnkeys [action - B_USER].button);
|
||||
dlg_select_widget (learnkeys [action - B_USER].button);
|
||||
return 0; /* Do not kill learn_dlg */
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ static int learn_move (int right)
|
||||
else
|
||||
i += (totalcols - 1) * ROWS;
|
||||
}
|
||||
dlg_select_widget (learn_dlg, (void *) learnkeys [i].button);
|
||||
dlg_select_widget (learnkeys [i].button);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@ -160,7 +160,7 @@ learn_check_key (int c)
|
||||
if (key_name_conv_tab[i].code != c || learnkeys[i].ok)
|
||||
continue;
|
||||
|
||||
dlg_select_widget (learn_dlg, learnkeys[i].button);
|
||||
dlg_select_widget (learnkeys[i].button);
|
||||
/* TRANSLATORS: This label appears near learned keys. Keep it short. */
|
||||
label_set_text ((WLabel *) learnkeys[i].label, _("OK"));
|
||||
learnkeys[i].ok = 1;
|
||||
|
@ -959,7 +959,7 @@ menu_last_selected_cmd (void)
|
||||
the_menubar->active = 1;
|
||||
the_menubar->dropped = drop_menus;
|
||||
the_menubar->previous_widget = midnight_dlg->current->dlg_id;
|
||||
dlg_select_widget (midnight_dlg, the_menubar);
|
||||
dlg_select_widget (the_menubar);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1664,9 +1664,9 @@ setup_panels_and_run_mc (void)
|
||||
init_labels ();
|
||||
|
||||
if (boot_current_is_left)
|
||||
dlg_select_widget (midnight_dlg, get_panel_widget (0));
|
||||
dlg_select_widget (get_panel_widget (0));
|
||||
else
|
||||
dlg_select_widget (midnight_dlg, get_panel_widget (1));
|
||||
dlg_select_widget (get_panel_widget (1));
|
||||
|
||||
/* Run the Midnight Commander if no file was specified in the command line */
|
||||
run_dlg (midnight_dlg);
|
||||
|
@ -425,7 +425,7 @@ menubar_event (Gpm_Event *event, WMenu *menubar)
|
||||
|
||||
if (!was_active){
|
||||
menubar->selected = new_selection;
|
||||
dlg_select_widget (menubar->widget.parent, menubar);
|
||||
dlg_select_widget (menubar);
|
||||
menubar_drop_compute (menubar);
|
||||
menubar_draw (menubar);
|
||||
return MOU_NORMAL;
|
||||
|
12
src/widget.c
12
src/widget.c
@ -170,7 +170,7 @@ button_event (Gpm_Event *event, WButton *b)
|
||||
{
|
||||
if (event->type & (GPM_DOWN|GPM_UP)){
|
||||
Dlg_head *h=b->widget.parent;
|
||||
dlg_select_widget (h, b);
|
||||
dlg_select_widget (b);
|
||||
if (event->type & GPM_UP){
|
||||
button_callback (b, WIDGET_KEY, ' ');
|
||||
(*h->callback) (h, DLG_POST_KEY, ' ');
|
||||
@ -355,7 +355,7 @@ radio_event (Gpm_Event *event, WRadio *r)
|
||||
Dlg_head *h = r->widget.parent;
|
||||
|
||||
r->pos = event->y - 1;
|
||||
dlg_select_widget (h, r);
|
||||
dlg_select_widget (r);
|
||||
if (event->type & GPM_UP){
|
||||
radio_callback (r, WIDGET_KEY, ' ');
|
||||
radio_callback (r, WIDGET_FOCUS, 0);
|
||||
@ -455,7 +455,7 @@ check_event (Gpm_Event *event, WCheck *c)
|
||||
if (event->type & (GPM_DOWN|GPM_UP)){
|
||||
Dlg_head *h = c->widget.parent;
|
||||
|
||||
dlg_select_widget (h, c);
|
||||
dlg_select_widget (c);
|
||||
if (event->type & GPM_UP){
|
||||
check_callback (c, WIDGET_KEY, ' ');
|
||||
check_callback (c, WIDGET_FOCUS, 0);
|
||||
@ -1594,7 +1594,7 @@ static int
|
||||
input_event (Gpm_Event * event, WInput * in)
|
||||
{
|
||||
if (event->type & (GPM_DOWN | GPM_DRAG)) {
|
||||
dlg_select_widget (in->widget.parent, in);
|
||||
dlg_select_widget (in);
|
||||
|
||||
if (event->x >= in->field_len - HISTORY_BUTTON_WIDTH + 1
|
||||
&& should_show_history_button (in)) {
|
||||
@ -2056,7 +2056,7 @@ listbox_event (Gpm_Event *event, WListbox *l)
|
||||
|
||||
/* Single click */
|
||||
if (event->type & GPM_DOWN)
|
||||
dlg_select_widget (l->widget.parent, l);
|
||||
dlg_select_widget (l);
|
||||
if (!l->list)
|
||||
return MOU_NORMAL;
|
||||
if (event->type & (GPM_DOWN | GPM_DRAG)) {
|
||||
@ -2089,7 +2089,7 @@ listbox_event (Gpm_Event *event, WListbox *l)
|
||||
if (event->y < 1 || event->y > l->height)
|
||||
return MOU_NORMAL;
|
||||
|
||||
dlg_select_widget (l->widget.parent, l);
|
||||
dlg_select_widget (l);
|
||||
listbox_select_entry (l,
|
||||
listbox_select_pos (l, l->top,
|
||||
event->y - 1));
|
||||
|
@ -165,7 +165,7 @@ query_dialog (const char *header, const char *text, int flags, int count, ...)
|
||||
add_widget (query_dlg, label_new (2, 3, text));
|
||||
|
||||
if (defbutton)
|
||||
dlg_select_widget (query_dlg, defbutton);
|
||||
dlg_select_widget (defbutton);
|
||||
|
||||
/* run dialog and make result */
|
||||
run_dlg (query_dlg);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user