Use plain ASCII chars for lines on Win32 console CTK.

This commit is contained in:
Oliver Schmidt 2013-02-09 02:02:46 +01:00
parent b1eeaf31c9
commit 21b8be3798
2 changed files with 31 additions and 31 deletions

View file

@ -50,11 +50,11 @@ typedef unsigned short uip_stats_t;
#define UIP_CONF_MAX_CONNECTIONS 40
#define UIP_CONF_MAX_LISTENPORTS 40
#define UIP_CONF_BUFFER_SIZE 420
#define UIP_CONF_BUFFER_SIZE 1514
#define UIP_CONF_BYTE_ORDER UIP_LITTLE_ENDIAN
#define UIP_CONF_TCP_SPLIT 1
#if UIP_CONF_IPV6
#define UIP_CONF_IP_FORWARD 0
#define UIP_CONF_IP_FORWARD 0
#define UIP_CONF_DS6_NBR_NBU 100
#define UIP_CONF_DS6_DEFRT_NBU 2
#define UIP_CONF_DS6_PREFIX_NBU 5
@ -74,16 +74,16 @@ typedef unsigned short uip_stats_t;
#include "ctk/ctk-console.h"
#define CH_ULCORNER 0xDA
#define CH_URCORNER 0xBF
#define CH_LLCORNER 0xC0
#define CH_LRCORNER 0xD9
#define CH_ENTER '\r'
#define CH_DEL '\b'
#define CH_CURS_UP -1
#define CH_CURS_LEFT -2
#define CH_CURS_RIGHT -3
#define CH_CURS_DOWN -4
#define CH_ULCORNER '+'
#define CH_URCORNER '+'
#define CH_LLCORNER '+'
#define CH_LRCORNER '+'
#define CH_ENTER '\r'
#define CH_DEL '\b'
#define CH_CURS_UP -1
#define CH_CURS_LEFT -2
#define CH_CURS_RIGHT -3
#define CH_CURS_DOWN -4
#define CTK_CONF_MENU_KEY -5 /* F10 */
#define CTK_CONF_WINDOWSWITCH_KEY -6 /* Ctrl-Tab */

View file

@ -112,8 +112,8 @@ console_init(void)
SetConsoleCtrlHandler(ctrlhandler, TRUE);
atexit(console_exit);
memset(blank, ' ', sizeof(blank));
memset(hline, 0xC4, sizeof(hline));
memset(blank, ' ', sizeof(blank));
memset(hline, '-', sizeof(hline));
}
/*-----------------------------------------------------------------------------------*/
void
@ -159,8 +159,8 @@ static void
setcolor(void)
{
SetConsoleTextAttribute(stdouthandle, (WORD)(reversed? (color & 0x0F) << 4 |
(color & 0xF0) >> 4
: color));
(color & 0xF0) >> 4
: color));
}
/*-----------------------------------------------------------------------------------*/
unsigned char
@ -264,7 +264,7 @@ cvline(unsigned char length)
y = wherey();
for(i = 0; i < length; ++i) {
cputcxy(x, (unsigned char)(y + i), (char)0xB3);
cputcxy(x, (unsigned char)(y + i), '|');
}
}
/*-----------------------------------------------------------------------------------*/
@ -338,25 +338,25 @@ console_readkey(KEY_EVENT_RECORD keyrecord)
if(key == 0) {
switch(keyrecord.wVirtualKeyCode) {
case VK_TAB:
if(keyrecord.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) {
key = CTK_CONF_WINDOWSWITCH_KEY;
}
break;
if(keyrecord.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) {
key = CTK_CONF_WINDOWSWITCH_KEY;
}
break;
case VK_LEFT:
key = CH_CURS_LEFT;
break;
key = CH_CURS_LEFT;
break;
case VK_UP:
key = CH_CURS_UP;
break;
key = CH_CURS_UP;
break;
case VK_RIGHT:
key = CH_CURS_RIGHT;
break;
key = CH_CURS_RIGHT;
break;
case VK_DOWN:
key = CH_CURS_DOWN;
break;
key = CH_CURS_DOWN;
break;
case VK_F10:
key = CTK_CONF_MENU_KEY;
break;
key = CTK_CONF_MENU_KEY;
break;
}
}