#include <stdio.h>
#include <string.h>
-#include <assert.h>
#include "abook.h"
+#include <assert.h>
#include "ui.h"
#include "database.h"
#include "edit.h"
for( line = 0, i = first_list_item ; i <= LAST_LIST_ITEM && i < items;
line++, i++ ) {
- if(i == curitem)
- highlight_line(list, line);
-
- print_list_line(i, line);
-
- wstandend(list);
+ print_list_line(i, line, i == curitem);
}
wrefresh(list);
}
void
-print_list_line(int i, int line)
+print_list_line(int i, int line, int highlight)
{
int extra = extra_column;
char tmp[MAX_EMAILSTR_LEN];
EMAILLEN : COLS - EMAILPOS;
scrollok(list, FALSE);
+ if(highlight)
+ highlight_line(list, line);
if( selected[i] )
mvwaddch(list, line, 0, '*' );
EXTRALEN);
scrollok(list, TRUE);
+ if(highlight)
+ wstandend(list);
}
void
list_headerline()
{
+#ifdef A_BOLD
attrset(A_BOLD);
+#else
+ /* hmm, maybe something here */
+#endif
mvaddstr(2, NAMEPOS, abook_fields[NAME].name);
mvaddstr(2, EMAILPOS, abook_fields[EMAIL].name);
if(extra_column > 0)
mvaddnstr(2, EXTRAPOS, abook_fields[extra_column].name,
COLS-EXTRAPOS);
+#ifdef A_BOLD
attrset(A_NORMAL);
+#endif
}
void