|
|
1.1 ! root 1: /* ! 2: * Functions for programmable function keys ! 3: * ! 4: * Copyright (c) 1993 by Udo Munk ! 5: */ ! 6: ! 7: #ifdef AIX ! 8: #define NLS ! 9: #endif ! 10: ! 11: #include <curses.h> ! 12: #include "winfun.h" ! 13: ! 14: struct pfkey pfkeys[9]; /* function keys */ ! 15: ! 16: /* ! 17: * display the function key lables in last line ! 18: */ ! 19: print_pfkeys() ! 20: { ! 21: register int i; ! 22: register char *p; ! 23: char empty[PFKLABLEN]; ! 24: char space[80]; ! 25: ! 26: /* compute free space between the labels: */ ! 27: /* 9 labels of size PFKLABLEN and 8 empty spaces */ ! 28: p = space; ! 29: i = (COLS - ((PFKLABLEN + 1) * 9)) / 8; ! 30: while (i--) ! 31: *p++ = ' '; ! 32: *p = '\0'; ! 33: ! 34: /* create the string for one empty label */ ! 35: p = &empty[0]; ! 36: i = PFKLABLEN; ! 37: while (i--) ! 38: *p++ = ' '; ! 39: *p = '\0'; ! 40: ! 41: /* output all labels */ ! 42: move(LINES-1, 0); ! 43: for (i = 1; i <= 9; i++) { ! 44: printw("%1d", i); ! 45: attrset(A_REVERSE); ! 46: if (*pfkeys[i-1].label) ! 47: addstr(pfkeys[i-1].label); ! 48: else ! 49: addstr(empty); ! 50: attrset(A_NORMAL); ! 51: if (i < 9) ! 52: addstr(space); ! 53: } ! 54: ! 55: refreshall(); ! 56: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.