diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c index 8187cf59f..a9fe4c357 100644 --- a/lib/widget/dialog.c +++ b/lib/widget/dialog.c @@ -2,7 +2,7 @@ Dialog box features module for the Midnight Commander Copyright (C) 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2007, 2009, 2010, 2011 + 2005, 2007, 2009, 2010, 2011, 2013 The Free Software Foundation, Inc. This file is part of the Midnight Commander. @@ -587,17 +587,6 @@ dlg_find_widget_by_id (gconstpointer a, gconstpointer b) /*** public functions ****************************************************************************/ /* --------------------------------------------------------------------------------------------- */ -/** draw box in window */ -void -draw_box (const WDialog * h, int y, int x, int ys, int xs, gboolean single) -{ - const Widget *wh = WIDGET (h); - - tty_draw_box (wh->y + y, wh->x + x, ys, xs, single); -} - -/* --------------------------------------------------------------------------------------------- */ - /** Clean the dialog area, draw the frame and the title */ void dlg_default_repaint (WDialog * h) @@ -613,7 +602,7 @@ dlg_default_repaint (WDialog * h) tty_setcolor (h->color[DLG_COLOR_NORMAL]); dlg_erase (h); - draw_box (h, space, space, wh->lines - 2 * space, wh->cols - 2 * space, FALSE); + tty_draw_box (wh->y + space, wh->x + space, wh->lines - 2 * space, wh->cols - 2 * space, FALSE); if (h->title != NULL) { diff --git a/lib/widget/dialog.h b/lib/widget/dialog.h index eea467251..ebdbd0406 100644 --- a/lib/widget/dialog.h +++ b/lib/widget/dialog.h @@ -124,9 +124,6 @@ extern const global_keymap_t *dialog_map; /*** declarations of public functions ************************************************************/ -/* draw box in window */ -void draw_box (const WDialog * h, int y, int x, int ys, int xs, gboolean single); - /* Creates a dialog head */ WDialog *create_dlg (gboolean modal, int y1, int x1, int lines, int cols, const int *colors, widget_cb_fn callback, mouse_h mouse_handler, diff --git a/lib/widget/groupbox.c b/lib/widget/groupbox.c index 0ff62d119..cb123ae8e 100644 --- a/lib/widget/groupbox.c +++ b/lib/widget/groupbox.c @@ -2,7 +2,7 @@ Widgets for the Midnight Commander Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2009, 2010, 2011 + 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2013 The Free Software Foundation, Inc. Authors: @@ -11,7 +11,7 @@ Jakub Jelinek, 1995 Andrej Borsenkow, 1996 Norbert Warmuth, 1997 - Andrew Borodin , 2009, 2010 + Andrew Borodin , 2009, 2010, 2013 This file is part of the Midnight Commander. @@ -67,16 +67,18 @@ groupbox_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void case MSG_DRAW: { - Widget *wo = WIDGET (w->owner); + gboolean disabled; - gboolean disabled = (w->options & W_DISABLED) != 0; + disabled = (w->options & W_DISABLED) != 0; tty_setcolor (disabled ? DISABLED_COLOR : COLOR_NORMAL); - draw_box (w->owner, w->y - wo->y, w->x - wo->x, w->lines, w->cols, TRUE); + tty_draw_box (w->y, w->x, w->lines, w->cols, TRUE); if (g->title != NULL) { + Widget *wo = WIDGET (w->owner); + tty_setcolor (disabled ? DISABLED_COLOR : COLOR_TITLE); - widget_move (w->owner, w->y - wo->y, w->x - wo->x + 1); + widget_move (wo, w->y - wo->y, w->x - wo->x + 1); tty_print_string (g->title); } return MSG_HANDLED; diff --git a/lib/widget/menu.c b/lib/widget/menu.c index 10f6e0d06..d7399474c 100644 --- a/lib/widget/menu.c +++ b/lib/widget/menu.c @@ -188,7 +188,7 @@ menubar_draw_drop (WMenuBar * menubar) column = w->cols - menu->max_entry_len - 5; tty_setcolor (MENU_ENTRY_COLOR); - draw_box (w->owner, w->y + 1, w->x + column, count + 2, menu->max_entry_len + 5, FALSE); + tty_draw_box (w->y + 1, w->x + column, count + 2, menu->max_entry_len + 5, FALSE); for (i = 0; i < count; i++) menubar_paint_idx (menubar, i, diff --git a/src/filemanager/info.c b/src/filemanager/info.c index 423997b5a..36222f59b 100644 --- a/src/filemanager/info.c +++ b/src/filemanager/info.c @@ -7,6 +7,7 @@ Written by: Slava Zanko , 2013 + Andrew Borodin , 2013 This file is part of the Midnight Commander. @@ -86,7 +87,7 @@ info_box (WInfo * info) tty_set_normal_attrs (); tty_setcolor (NORMAL_COLOR); widget_erase (w); - draw_box (w->owner, w->y, w->x, w->lines, w->cols, FALSE); + tty_draw_box (w->y, w->x, w->lines, w->cols, FALSE); widget_move (w, 0, (w->cols - len - 2) / 2); tty_printf (" %s ", title); diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c index b5c99ec03..8ee076e6a 100644 --- a/src/filemanager/panel.c +++ b/src/filemanager/panel.c @@ -9,6 +9,7 @@ Miguel de Icaza, 1995 Timur Bakeyev, 1997, 1999 Slava Zanko , 2013 + Andrew Borodin , 2013 This file is part of the Midnight Commander. @@ -1247,7 +1248,7 @@ show_dir (WPanel * panel) gchar *tmp; set_colors (panel); - draw_box (w->owner, w->y, w->x, w->lines, w->cols, FALSE); + tty_draw_box (w->y, w->x, w->lines, w->cols, FALSE); if (panels_options.show_mini_info) { diff --git a/src/filemanager/tree.c b/src/filemanager/tree.c index 8ac8096d2..91e813a69 100644 --- a/src/filemanager/tree.c +++ b/src/filemanager/tree.c @@ -15,6 +15,7 @@ Norbert Warmuth, 1997 Miguel de Icaza, 1996, 1999 Slava Zanko , 2013 + Andrew Borodin , 2013 This file is part of the Midnight Commander. @@ -1157,6 +1158,8 @@ tree_frame (WDialog * h, WTree * tree) { Widget *w = WIDGET (tree); + (void) h; + tty_setcolor (NORMAL_COLOR); widget_erase (w); if (tree->is_panel) @@ -1164,7 +1167,7 @@ tree_frame (WDialog * h, WTree * tree) const char *title = _("Directory tree"); const int len = str_term_width1 (title); - draw_box (h, w->y, w->x, w->lines, w->cols, FALSE); + tty_draw_box (w->y, w->x, w->lines, w->cols, FALSE); widget_move (w, 0, (w->cols - len - 2) / 2); tty_printf (" %s ", title);