1
0
mirror of https://github.com/MidnightCommander/mc synced 2025-04-03 21:52:58 +03:00

Created new function: tty_draw_double_box().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2010-03-18 21:44:35 +03:00
parent be3b0119da
commit cc2f5670ec
4 changed files with 37 additions and 35 deletions

@ -138,35 +138,37 @@ tty_print_one_vline (void)
} }
void void
tty_draw_box (int y, int x, int ys, int xs, gboolean single) tty_draw_box (int y, int x, int ys, int xs)
{ {
if (single) { tty_draw_vline (y, x, mc_tty_ugly_frm[MC_TTY_FRM_grpvert], ys);
tty_draw_vline (y, x, mc_tty_ugly_frm[MC_TTY_FRM_grpvert], ys); tty_draw_vline (y, x + xs - 1, mc_tty_ugly_frm[MC_TTY_FRM_grpvert], ys);
tty_draw_vline (y, x + xs - 1, mc_tty_ugly_frm[MC_TTY_FRM_grpvert], ys); tty_draw_hline (y, x, mc_tty_ugly_frm[MC_TTY_FRM_grphoriz], xs);
tty_draw_hline (y, x, mc_tty_ugly_frm[MC_TTY_FRM_grphoriz], xs); tty_draw_hline (y + ys - 1, x, mc_tty_ugly_frm[MC_TTY_FRM_grphoriz], xs);
tty_draw_hline (y + ys - 1, x, mc_tty_ugly_frm[MC_TTY_FRM_grphoriz], xs); tty_gotoyx (y, x);
tty_gotoyx (y, x); tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_grplefttop], TRUE);
tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_grplefttop], single); tty_gotoyx (y + ys - 1, x);
tty_gotoyx (y + ys - 1, x); tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_grpleftbottom], TRUE);
tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_grpleftbottom], single); tty_gotoyx (y, x + xs - 1);
tty_gotoyx (y, x + xs - 1); tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_grprighttop], TRUE);
tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_grprighttop], single); tty_gotoyx (y + ys - 1, x + xs - 1);
tty_gotoyx (y + ys - 1, x + xs - 1); tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_grprightbottom], TRUE);
tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_grprightbottom], single); }
} else {
tty_draw_vline (y, x, mc_tty_ugly_frm[MC_TTY_FRM_vert], ys); void
tty_draw_vline (y, x + xs - 1, mc_tty_ugly_frm[MC_TTY_FRM_vert], ys); tty_draw_double_box (int y, int x, int ys, int xs)
tty_draw_hline (y, x, mc_tty_ugly_frm[MC_TTY_FRM_horiz], xs); {
tty_draw_hline (y + ys - 1, x, mc_tty_ugly_frm[MC_TTY_FRM_horiz], xs); tty_draw_vline (y, x, mc_tty_ugly_frm[MC_TTY_FRM_vert], ys);
tty_gotoyx (y, x); tty_draw_vline (y, x + xs - 1, mc_tty_ugly_frm[MC_TTY_FRM_vert], ys);
tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_lefttop], single); tty_draw_hline (y, x, mc_tty_ugly_frm[MC_TTY_FRM_horiz], xs);
tty_gotoyx (y + ys - 1, x); tty_draw_hline (y + ys - 1, x, mc_tty_ugly_frm[MC_TTY_FRM_horiz], xs);
tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_leftbottom], single); tty_gotoyx (y, x);
tty_gotoyx (y, x + xs - 1); tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_lefttop], FALSE);
tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_righttop], single); tty_gotoyx (y + ys - 1, x);
tty_gotoyx (y + ys - 1, x + xs - 1); tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_leftbottom], FALSE);
tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_rightbottom], single); tty_gotoyx (y, x + xs - 1);
} tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_righttop], FALSE);
tty_gotoyx (y + ys - 1, x + xs - 1);
tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_rightbottom], FALSE);
} }
char * char *

@ -75,7 +75,8 @@ extern void tty_print_one_vline (void);
extern void tty_print_one_hline (void); extern void tty_print_one_hline (void);
extern void tty_draw_hline (int y, int x, int ch, int len); extern void tty_draw_hline (int y, int x, int ch, int len);
extern void tty_draw_vline (int y, int x, int ch, int len); extern void tty_draw_vline (int y, int x, int ch, int len);
extern void tty_draw_box (int y, int x, int rows, int cols, gboolean single); extern void tty_draw_box (int y, int x, int rows, int cols);
extern void tty_draw_double_box (int y, int x, int rows, int cols);
extern void tty_fill_region (int y, int x, int rows, int cols, unsigned char ch); extern void tty_fill_region (int y, int x, int rows, int cols, unsigned char ch);
extern int mc_tty_ugly_frm[]; extern int mc_tty_ugly_frm[];

@ -65,7 +65,10 @@ static void dlg_broadcast_msg_to (Dlg_head * h, widget_msg_t message,
void void
draw_box (Dlg_head *h, int y, int x, int ys, int xs, gboolean single) draw_box (Dlg_head *h, int y, int x, int ys, int xs, gboolean single)
{ {
tty_draw_box (h->y + y, h->x + x, ys, xs, single); if (single)
tty_draw_box (h->y + y, h->x + x, ys, xs);
else
tty_draw_double_box (h->y + y, h->x + x, ys, xs);
} }
void void

@ -341,11 +341,7 @@ mcview_display_clean (mcview_t * view)
tty_setcolor (NORMAL_COLOR); tty_setcolor (NORMAL_COLOR);
widget_erase ((Widget *) view); widget_erase ((Widget *) view);
if (view->dpy_frame_size != 0) if (view->dpy_frame_size != 0)
{ tty_draw_double_box (view->widget.y, view->widget.x, view->widget.lines, view->widget.cols);
tty_draw_box (view->widget.y, view->widget.x, view->widget.lines, view->widget.cols, FALSE);
/* draw_double_box (view->widget.parent, view->widget.y,
view->widget.x, view->widget.lines, view->widget.cols); */
}
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */