aboutsummaryrefslogtreecommitdiffstats
path: root/com32/cmenu/libmenu/tui.c
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-08-29 20:53:38 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-09-01 11:43:38 -0700
commitf7c2dd07b141050f6401622382be26fe9442d949 (patch)
tree4cd28d3eb45fd8fe102586073fd1ec33359c5bba /com32/cmenu/libmenu/tui.c
parente9a9e808f2705766ef7f80b0970401dbeb690433 (diff)
downloadsyslinux-f7c2dd07b141050f6401622382be26fe9442d949.tar.gz
syslinux-f7c2dd07b141050f6401622382be26fe9442d949.tar.xz
syslinux-f7c2dd07b141050f6401622382be26fe9442d949.zip
cmenu: fix menu separators
Use the alternate character set to draw horizontal lines (menu separator). Refactor the c*print functions in the same time as they were severely broken. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32/cmenu/libmenu/tui.c')
-rw-r--r--com32/cmenu/libmenu/tui.c45
1 files changed, 5 insertions, 40 deletions
diff --git a/com32/cmenu/libmenu/tui.c b/com32/cmenu/libmenu/tui.c
index d4e08286..a8ca1cd5 100644
--- a/com32/cmenu/libmenu/tui.c
+++ b/com32/cmenu/libmenu/tui.c
@@ -212,43 +212,6 @@ void getuserinput(char *stra, unsigned int size, unsigned int password,
free(str);
}
-/* Print a C string (NUL-terminated) */
-void cswprint(const char *str, char attr, char left)
-{
- char page = getdisppage();
- char newattr = 0, cha, chb;
-
- while (*str) {
- switch (*str) {
- case BELL: // Bell Char
- beep();
- break;
- case CHRELATTR: // change attribute (relatively)
- case CHABSATTR: // change attribute (absolute)
- cha = *(str + 1);
- chb = *(str + 2);
- if ((((cha >= '0') && (cha <= '9')) || ((cha >= 'A') && (cha <= 'F'))) && (((chb >= '0') && (chb <= '9')) || ((chb >= 'A') && (chb <= 'F')))) // Next two chars are legal
- {
- if ((cha >= 'A') && (cha <= 'F'))
- cha = cha - 'A' + 10;
- else
- cha = cha - '0';
- if ((chb >= 'A') && (chb <= 'F'))
- chb = chb - 'A' + 10;
- else
- chb = chb - '0';
- newattr = (cha << 4) + chb;
- attr = (*str == CHABSATTR ? newattr : attr ^ newattr);
- str += 2; // Will be incremented again later
- }
- break;
- default:
- cprint(*str, attr, 1, page);
- }
- str++;
- }
-}
-
void clearwindow(char top, char left, char bot, char right, char page,
char fillchar, char fillattr)
{
@@ -345,11 +308,13 @@ void drawhorizline(char top, char left, char right, char page, char attr,
end = right;
}
gotoxy(top, start, page);
- cprint(box_chars[BOX_HORIZ], attr, end - start + 1, page);
+ putchar(SO);
+ cprint(MIDDLE_BORDER, attr, end - start + 1, page);
if (dumb == 0) {
gotoxy(top, left, page);
- cprint(box_chars[BOX_LTRT], attr, 1, page);
+ cprint(MIDDLE_BORDER, attr, 1, page);
gotoxy(top, right, page);
- cprint(box_chars[BOX_RTLT], attr, 1, page);
+ cprint(MIDDLE_BORDER, attr, 1, page);
}
+ putchar(SI);
}