Added capability to draw single or double lines.

Fixed tty_print_alt_char() to draw single or double vertical
or horizintal lines.
Added argument to tty_print_one_hline() and tty_print_one_vline()
functions to draw single or double lines.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2010-03-21 11:58:45 +03:00
parent cc2f5670ec
commit 9a145a88ce
7 changed files with 18 additions and 18 deletions

View File

@ -343,9 +343,9 @@ void
tty_print_alt_char (int c, gboolean single)
{
if ((chtype) c == ACS_VLINE)
c = mc_tty_ugly_frm[MC_TTY_FRM_thinvert];
c = mc_tty_ugly_frm[single ? MC_TTY_FRM_thinvert: MC_TTY_FRM_vert];
else if ((chtype) c == ACS_HLINE)
c = mc_tty_ugly_frm[MC_TTY_FRM_thinhoriz];
c = mc_tty_ugly_frm[single ? MC_TTY_FRM_thinhoriz : MC_TTY_FRM_horiz];
else if ((chtype) c == ACS_LTEE)
c = mc_tty_ugly_frm[single ? MC_TTY_FRM_grpleftmiddle : MC_TTY_FRM_leftmiddle];
else if ((chtype) c == ACS_RTEE)

View File

@ -503,10 +503,10 @@ tty_print_alt_char (int c, gboolean single)
: SLsmg_write_char ((unsigned int) y)
switch (c) {
case ACS_VLINE:
DRAW (c, mc_tty_ugly_frm[MC_TTY_FRM_thinvert]);
DRAW (c, mc_tty_ugly_frm[single ? MC_TTY_FRM_thinvert : MC_TTY_FRM_vert]);
break;
case ACS_HLINE:
DRAW (c, mc_tty_ugly_frm[MC_TTY_FRM_thinhoriz]);
DRAW (c, mc_tty_ugly_frm[single ? MC_TTY_FRM_thinhoriz : MC_TTY_FRM_horiz]);
break;
case ACS_LTEE:
DRAW (c, mc_tty_ugly_frm[single ? MC_TTY_FRM_grpleftmiddle : MC_TTY_FRM_leftmiddle]);

View File

@ -126,15 +126,15 @@ tty_got_interrupt (void)
}
void
tty_print_one_hline (void)
tty_print_one_hline (gboolean single)
{
tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_thinhoriz], FALSE);
tty_print_alt_char (ACS_HLINE, single);
}
void
tty_print_one_vline (void)
tty_print_one_vline (gboolean single)
{
tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_thinvert], FALSE);
tty_print_alt_char (ACS_VLINE, single);
}
void

View File

@ -71,8 +71,8 @@ extern void tty_print_anychar (int c);
extern void tty_print_string (const char *s);
extern void tty_printf (const char *s, ...);
extern void tty_print_one_vline (void);
extern void tty_print_one_hline (void);
extern void tty_print_one_vline (gboolean single);
extern void tty_print_one_hline (gboolean single);
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_box (int y, int x, int rows, int cols);

View File

@ -747,7 +747,7 @@ format_file (char *dest, int limit, WPanel * panel, int file_index, int width, i
tty_setcolor (SELECTED_COLOR);
else
tty_setcolor (NORMAL_COLOR);
tty_print_one_vline ();
tty_print_one_vline (TRUE);
length++;
}
}
@ -803,7 +803,7 @@ repaint_file (WPanel * panel, int file_index, int mv, int attr, int isstatus)
else
{
tty_setcolor (NORMAL_COLOR);
tty_print_one_vline ();
tty_print_one_vline (TRUE);
}
}
}
@ -1515,7 +1515,7 @@ paint_frame (WPanel * panel)
if (side)
{
tty_setcolor (NORMAL_COLOR);
tty_print_one_vline ();
tty_print_one_vline (TRUE);
width = panel->widget.cols - panel->widget.cols / 2 - 1;
}
else if (panel->split)
@ -1551,7 +1551,7 @@ paint_frame (WPanel * panel)
else
{
tty_setcolor (NORMAL_COLOR);
tty_print_one_vline ();
tty_print_one_vline (TRUE);
width--;
}
}

View File

@ -199,7 +199,7 @@ mcview_display_hex (mcview_t * view)
{
if (view->data_area.width >= 80 && col < width)
{
tty_print_one_vline ();
tty_print_one_vline (TRUE);
col += 1;
}
if (col < width)

View File

@ -2254,14 +2254,14 @@ listbox_drawscroll (WListbox * l)
/* Are we at the top? */
widget_move (&l->widget, 0, l->widget.cols);
if (l->top == 0)
tty_print_one_vline ();
tty_print_one_vline (TRUE);
else
tty_print_char ('^');
/* Are we at the bottom? */
widget_move (&l->widget, max_line, l->widget.cols);
if ((l->top + l->widget.lines == l->count) || (l->widget.lines >= l->count))
tty_print_one_vline ();
tty_print_one_vline (TRUE);
else
tty_print_char ('v');
@ -2273,7 +2273,7 @@ listbox_drawscroll (WListbox * l)
{
widget_move (&l->widget, i, l->widget.cols);
if (i != line)
tty_print_one_vline ();
tty_print_one_vline (TRUE);
else
tty_print_char ('*');
}