* Renamed define_label to buttonbar_set_label.

* Renamed define_label_data to buttonbar_set_label_data.
	* Renamed redraw_labels to buttonbar_redraw.
This commit is contained in:
Roland Illig 2005-02-08 09:53:51 +00:00
parent e501886d58
commit 0d08e8308f
7 changed files with 38 additions and 37 deletions

View File

@ -5,6 +5,7 @@
redraw_labels to buttonbar_redraw. Provided compatibility macros
to enable a smooth transition between the old and the new names.
* widget.c: Likewise.
* help.c, main.c, screen.c, tree.v, view.c: Likewise.
2005-02-08 Roland Illig <roland.illig@gmx.de>

View File

@ -822,19 +822,19 @@ interactive_display (const char *filename, const char *node)
add_widget (whelp, md);
add_widget (whelp, help_bar);
define_label_data (whelp, 1, _("Help"), (buttonbarfn) help_help_cmd,
buttonbar_set_label_data (whelp, 1, _("Help"), (buttonbarfn) help_help_cmd,
whelp);
define_label_data (whelp, 2, _("Index"), (buttonbarfn) help_index_cmd,
buttonbar_set_label_data (whelp, 2, _("Index"), (buttonbarfn) help_index_cmd,
whelp);
define_label_data (whelp, 3, _("Prev"), (buttonbarfn) prev_node_cmd,
buttonbar_set_label_data (whelp, 3, _("Prev"), (buttonbarfn) prev_node_cmd,
whelp);
define_label (whelp, 4, "", 0);
define_label (whelp, 5, "", 0);
define_label (whelp, 6, "", 0);
define_label (whelp, 7, "", 0);
define_label (whelp, 8, "", 0);
define_label (whelp, 9, "", 0);
define_label_data (whelp, 10, _("Quit"), help_quit_cmd, whelp);
buttonbar_set_label (whelp, 4, "", 0);
buttonbar_set_label (whelp, 5, "", 0);
buttonbar_set_label (whelp, 6, "", 0);
buttonbar_set_label (whelp, 7, "", 0);
buttonbar_set_label (whelp, 8, "", 0);
buttonbar_set_label (whelp, 9, "", 0);
buttonbar_set_label_data (whelp, 10, _("Quit"), help_quit_cmd, whelp);
run_dlg (whelp);
interactive_display_finish ();

View File

@ -1204,10 +1204,10 @@ copy_other_tagged (void)
static void
init_labels (void)
{
define_label (midnight_dlg, 1, _("Help"), help_cmd);
define_label (midnight_dlg, 2, _("Menu"), user_file_menu_cmd);
define_label (midnight_dlg, 9, _("PullDn"), menu_cmd);
define_label (midnight_dlg, 10, _("Quit"), quit_cmd);
buttonbar_set_label (midnight_dlg, 1, _("Help"), help_cmd);
buttonbar_set_label (midnight_dlg, 2, _("Menu"), user_file_menu_cmd);
buttonbar_set_label (midnight_dlg, 9, _("PullDn"), menu_cmd);
buttonbar_set_label (midnight_dlg, 10, _("Quit"), quit_cmd);
}
static const key_map ctl_x_map[] = {

View File

@ -2228,15 +2228,15 @@ panel_callback (WPanel *panel, widget_msg_t msg, int parm)
show_dir (panel);
paint_dir (panel);
define_label (h, 1, _("Help"), help_cmd);
define_label (h, 2, _("Menu"), user_file_menu_cmd);
define_label (h, 3, _("View"), view_cmd);
define_label (h, 4, _("Edit"), edit_cmd);
define_label (h, 5, _("Copy"), copy_cmd);
define_label (h, 6, _("RenMov"), ren_cmd);
define_label (h, 7, _("Mkdir"), mkdir_cmd);
define_label (h, 8, _("Delete"), delete_cmd);
redraw_labels (h);
buttonbar_set_label (h, 1, _("Help"), help_cmd);
buttonbar_set_label (h, 2, _("Menu"), user_file_menu_cmd);
buttonbar_set_label (h, 3, _("View"), view_cmd);
buttonbar_set_label (h, 4, _("Edit"), edit_cmd);
buttonbar_set_label (h, 5, _("Copy"), copy_cmd);
buttonbar_set_label (h, 6, _("RenMov"), ren_cmd);
buttonbar_set_label (h, 7, _("Mkdir"), mkdir_cmd);
buttonbar_set_label (h, 8, _("Delete"), delete_cmd);
buttonbar_redraw (h);
return MSG_HANDLED;
case WIDGET_UNFOCUS:

View File

@ -731,7 +731,7 @@ tree_toggle_navig (WTree *tree)
static void
set_navig_label (WTree *tree)
{
define_label_data (tree->widget.parent, 4,
buttonbar_set_label_data (tree->widget.parent, 4,
tree_navigation_flag ? _("Static") : _("Dynamc"),
(buttonbarfn) tree_toggle_navig, tree);
}
@ -973,26 +973,26 @@ tree_callback (WTree *tree, widget_msg_t msg, int parm)
case WIDGET_FOCUS:
tree->active = 1;
define_label (h, 1, _("Help"), (voidfn) tree_help_cmd);
define_label_data (h, 2, _("Rescan"),
buttonbar_set_label (h, 1, _("Help"), (voidfn) tree_help_cmd);
buttonbar_set_label_data (h, 2, _("Rescan"),
(buttonbarfn) tree_rescan_cmd, tree);
define_label_data (h, 3, _("Forget"),
buttonbar_set_label_data (h, 3, _("Forget"),
(buttonbarfn) tree_forget_cmd, tree);
define_label_data (h, 5, _("Copy"), (buttonbarfn) tree_copy_cmd,
buttonbar_set_label_data (h, 5, _("Copy"), (buttonbarfn) tree_copy_cmd,
tree);
define_label_data (h, 6, _("RenMov"), (buttonbarfn) tree_move_cmd,
buttonbar_set_label_data (h, 6, _("RenMov"), (buttonbarfn) tree_move_cmd,
tree);
#if 0
/* FIXME: mkdir is currently defunct */
define_label_data (h, 7, _("Mkdir"), (buttonbarfn) tree_mkdir_cmd,
buttonbar_set_label_data (h, 7, _("Mkdir"), (buttonbarfn) tree_mkdir_cmd,
tree);
#else
define_label (h, 7, "", 0);
buttonbar_set_label (h, 7, "", 0);
#endif
define_label_data (h, 8, _("Rmdir"), (buttonbarfn) tree_rmdir_cmd,
buttonbar_set_label_data (h, 8, _("Rmdir"), (buttonbarfn) tree_rmdir_cmd,
tree);
set_navig_label (tree);
redraw_labels (h);
buttonbar_redraw (h);
/* FIXME: Should find a better way of only displaying the

View File

@ -1225,7 +1225,7 @@ static inline void
my_define (Dlg_head *h, int idx, const char *text, void (*fn) (WView *),
WView *view)
{
define_label_data (h, idx, text, (buttonbarfn) fn, view);
buttonbar_set_label_data (h, idx, text, (buttonbarfn) fn, view);
}
/* If the last parameter is nonzero, it means we want get the count of lines
@ -2275,7 +2275,7 @@ view_labels (WView *view)
{
Dlg_head *h = view->widget.parent;
define_label (h, 1, _("Help"), view_help_cmd);
buttonbar_set_label (h, 1, _("Help"), view_help_cmd);
my_define (h, 10, _("Quit"), view_quit_cmd, view);
my_define (h, 4, view->hex_mode ? _("Ascii") : _("Hex"),
@ -2311,7 +2311,7 @@ view_labels (WView *view)
my_define (h, 3, _("Quit"), view_quit_cmd, view);
}
redraw_labels (h);
buttonbar_redraw (h);
}
/* Check for left and right arrows, possibly with modifiers */

View File

@ -2344,7 +2344,7 @@ buttonbar_set_label_data (Dlg_head *h, int idx, const char *text, buttonbarfn cb
void
buttonbar_set_label (Dlg_head *h, int idx, const char *text, void (*cback) (void))
{
define_label_data (h, idx, text, (buttonbarfn) cback, 0);
buttonbar_set_label_data (h, idx, text, (buttonbarfn) cback, 0);
}
void