作者itoc, 信區: itoc
標題[功能] menu.c xover.c 變動游標 (系統寫死的)
時間03/08/17
作者: itoc (劃破一度空間的前導) 看板: plan
標題: [功能] menu.c xover.c 變動游標
時間: Mon Mar 25 19:01:12 2002 Updated: 2005/04/12
把游標 > 換成會變的
: menu.c
extern UCACHE *ushm;
+ int cursor_count = 0;
+ char cursor_table[3][3] = {"→", "♂", "♀"};
: menu.c:menu()
move(MENU_XPOS + cc, MENU_YPOS);
mptr = table[cc];
str = mptr->desc;
- prints(COLOR4 "> (%c)%s \033[m", *str, str + 1);
+ prints(COLOR4 "%s(%c)%s \033[m",
+ cursor_table[++cursor_count % 3], *str, str + 1);
cx = cc;
#else /* 沒有 CURSOR_BAR */
if (cx >= 0)
{
move(MENU_XPOS + cx, MENU_YPOS);
- outc(' ');
+ outs(" ");
}
move(MENU_XPOS + cc, MENU_YPOS);
- outc('>');
+ outs(cursor_table[++cursor_count % 3]);
+ move(MENU_XPOS + cc, MENU_YPOS + 1); /* itoc.020105: 避免左鍵全形偵測 */
cx = cc;
#endif
}
else /* 若游標的位置沒有變 */
{
#ifdef CURSOR_BAR
move(MENU_XPOS + cc, MENU_YPOS);
mptr = table[cc];
str = mptr->desc;
- prints(COLOR4 "> (%c)%s \033[m", *str, str + 1);
+ prints(COLOR4 "%s(%c)%s \033[m",
+ cursor_table[++cursor_count % 3], *str, str + 1);
#else
move(MENU_XPOS + cc, MENU_YPOS + 1);
#endif
}
: xover.c
#include "bbs.h"
+ extern int cursor_count;
+ extern char cursor_table[3][3];
...
...
else
{
move(3 + cmd - num, 0);
- outc(' ');
+ outs(" ");
break; /* 只移動游標 */
}
...
...
pos = xo->pos;
if (xo->max > 0) /* Thor:若是無東西就不show了 */
{
num = 3 + pos - xo->top;
move(num, 0);
- outc('>');
+ outs(cursor_table[++cursor_count % 3]);
+ move(num, 1); /* itoc.020105: 避免左鍵全形偵測 */
}
cmd = vkey();
...
...
if (cmd < 0) /* 在本頁找到 match */
{
move(num, 0);
- outc(' ');
+ outs(" ");
/* cmd = XO_NONE; */
/* itoc.010913: 某些搜尋要把 b_lines 填上 feeter */
cmd = cmd == -1 ? XO_NONE : XO_FOOT;
}
--
□ 本文章由 itoc 從 nctu5566.Dorm3.NCTU.edu.tw 發表精華選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻