cmenu: use ASCII characters for scrollbars
authorPierre-Alexandre Meyer <pierre@mouraf.org>
Mon, 7 Sep 2009 22:54:57 +0000 (15:54 -0700)
committerPierre-Alexandre Meyer <pierre@mouraf.org>
Mon, 7 Sep 2009 22:54:57 +0000 (15:54 -0700)
Use ^ and v as hints for scrolling. Use \141 from the Special Characters and
Line Drawing Character Set as the scrollbox.

Note: printf "\016\141\017" doesn't seem to work well on xterm, although
it does work on the vga console.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
com32/cmenu/libmenu/menu.c
com32/cmenu/libmenu/menu.h

index 5a33a52..3a761aa 100644 (file)
@@ -327,7 +327,7 @@ static void printmenu(pt_menu menu, int curr, uchar top, uchar left, uchar first
     x = ((numitems - 1) * curr) / (menu->numitems);
     if ((x > 0) && (row == 1)) {
     gotoxy(top + x, left + menuwidth);
-    cprint(SCROLLBOX, ms->normalattr[NOHLITE], 1);
+    csprint("\016\141\017", ms->normalattr[NOHLITE]);
     }
     if (ms->handler)
     ms->handler(ms, menu->items[curr]);
index b373e76..44acb12 100644 (file)
@@ -72,9 +72,8 @@
 #define NOHLITE       0                // The offset into attrib array for non-hilite
 #define HLITE         1                // The offset for Hlite attrib
 
-#define MOREABOVE    24                // char to print when more menu items available above
-#define MOREBELOW    25                // more items available below
-#define SCROLLBOX    176       // Filled char to display
+#define MOREABOVE    '^'               // char to print when more menu items available above
+#define MOREBELOW    'v'               // more items available below
 
 // Attributes of the menu system
 #define MAXMENUS      150      // Maximum number of menu's allowed