mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Use tty_draw_box instead of draw_box() to draw frames.
* (draw_box): remove. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
a35ee6aebc
commit
6d31d85f0d
@ -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)
|
||||
{
|
||||
|
@ -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,
|
||||
|
@ -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 <aborodin@vmail.ru>, 2009, 2010
|
||||
Andrew Borodin <aborodin@vmail.ru>, 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;
|
||||
|
@ -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,
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
Written by:
|
||||
Slava Zanko <slavazanko@gmail.com>, 2013
|
||||
Andrew Borodin <aborodin@vmail.ru>, 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);
|
||||
|
@ -9,6 +9,7 @@
|
||||
Miguel de Icaza, 1995
|
||||
Timur Bakeyev, 1997, 1999
|
||||
Slava Zanko <slavazanko@gmail.com>, 2013
|
||||
Andrew Borodin <aborodin@vmail.ru>, 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)
|
||||
{
|
||||
|
@ -15,6 +15,7 @@
|
||||
Norbert Warmuth, 1997
|
||||
Miguel de Icaza, 1996, 1999
|
||||
Slava Zanko <slavazanko@gmail.com>, 2013
|
||||
Andrew Borodin <aborodin@vmail.ru>, 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);
|
||||
|
Loading…
Reference in New Issue
Block a user