* dlg.c: Don't supply ID of the current widget with any

callbacks.  It's mostly useless and can be found by the
callback.
* layout.c: Likewise.
* widget.c: Likewise.
* chmod.c (chmod_callback): Adjust for the above.
This commit is contained in:
Pavel Roskin 2003-09-10 16:16:34 +00:00
parent 5ed61a33b7
commit e51f170ad9
5 changed files with 19 additions and 10 deletions

View File

@ -1,5 +1,12 @@
2003-09-10 Pavel Roskin <proski@gnu.org>
* dlg.c: Don't supply ID of the current widget with any
callbacks. It's mostly useless and can be found by the
callback.
* layout.c: Likewise.
* widget.c: Likewise.
* chmod.c (chmod_callback): Adjust for the above.
* layout.c (layout_change): Make static.
* screen.c (paint_panel): Likewise.
* cmd.c (dirsizes_cmd): Use dirty flag.

View File

@ -153,11 +153,14 @@ static cb_ret_t
chmod_callback (Dlg_head *h, dlg_msg_t msg, int parm)
{
char buffer[BUF_TINY];
int id;
switch (msg) {
case DLG_ACTION:
if (parm >= BUTTONS - single_set * 2) {
c_stat ^= check_perm[parm - BUTTONS + single_set * 2].mode;
id = h->current->dlg_id - BUTTONS + single_set * 2;
if (id >= 0) {
c_stat ^= check_perm[id].mode;
g_snprintf (buffer, sizeof (buffer), "%o", c_stat);
label_set_text (statl, buffer);
chmod_toggle_select (h);

View File

@ -348,7 +348,7 @@ int dlg_focus (Dlg_head *h)
return 0;
if (send_message (h->current->widget, WIDGET_FOCUS, 0)){
(*h->callback) (h, DLG_FOCUS, h->current->dlg_id);
(*h->callback) (h, DLG_FOCUS, 0);
return 1;
}
return 0;
@ -361,7 +361,7 @@ dlg_unfocus (Dlg_head *h)
return 0;
if (send_message (h->current->widget, WIDGET_UNFOCUS, 0)){
(*h->callback) (h, DLG_UNFOCUS, h->current->dlg_id);
(*h->callback) (h, DLG_UNFOCUS, 0);
return 1;
}
return 0;
@ -755,7 +755,7 @@ void init_dlg (Dlg_head *h)
void dlg_run_done (Dlg_head *h)
{
if (h->current)
(*h->callback) (h, DLG_END, h->current->dlg_id);
(*h->callback) (h, DLG_END, 0);
current_dlg = (Dlg_head *) h->previous_dialog;
}

View File

@ -781,8 +781,7 @@ change_screen_size (void)
setup_panels ();
/* Inform currently running dialog */
(*current_dlg->callback) (current_dlg, DLG_RESIZE,
current_dlg->current->dlg_id);
(*current_dlg->callback) (current_dlg, DLG_RESIZE, 0);
#ifdef RESIZABLE_MENUBAR
menubar_arrange (the_menubar);

View File

@ -290,7 +290,7 @@ radio_callback (WRadio *r, int Msg, int Par)
switch (Par){
case ' ':
r->sel = r->pos;
(*h->callback) (h, DLG_ACTION, h->current->dlg_id);
(*h->callback) (h, DLG_ACTION, 0);
radio_callback (r, WIDGET_FOCUS, ' ');
return 1;
@ -312,7 +312,7 @@ radio_callback (WRadio *r, int Msg, int Par)
return 0;
case WIDGET_CURSOR:
(*h->callback) (h, DLG_ACTION, h->current->dlg_id);
(*h->callback) (h, DLG_ACTION, 0);
radio_callback (r, WIDGET_FOCUS, ' ');
widget_move (&r->widget, r->pos, 1);
break;
@ -417,7 +417,7 @@ check_callback (WCheck *c, int Msg, int Par)
break;
c->state ^= C_BOOL;
c->state ^= C_CHANGE;
(*h->callback) (h, DLG_ACTION, h->current->dlg_id);
(*h->callback) (h, DLG_ACTION, 0);
check_callback (c, WIDGET_FOCUS, ' ');
return 1;