/****************************************************************************
- * Copyright (c) 2003-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2003-2011,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* authorization. *
****************************************************************************/
/*
- * $Id: demo_forms.c,v 1.36 2010/11/13 20:49:50 tom Exp $
+ * $Id: demo_forms.c,v 1.39 2012/06/09 20:30:32 tom Exp $
*
* Demonstrate a variety of functions from the form library.
* Thomas Dickey - 2003/4/26
set_field_just(f, j_value);
if (d_option) {
if (has_colors()) {
- set_field_fore(f, COLOR_PAIR(2));
+ set_field_fore(f, (chtype) COLOR_PAIR(2));
set_field_back(f, A_UNDERLINE | COLOR_PAIR(3));
} else {
set_field_fore(f, A_BOLD);
char *buffer;
int nbuf;
int field_rows, field_cols, field_max;
+ int currow, curcol;
if (has_colors()) {
- wbkgd(win, COLOR_PAIR(1));
+ wbkgd(win, (chtype) COLOR_PAIR(1));
}
werase(win);
- wprintw(win, "Cursor: %d,%d", form->currow, form->curcol);
+ form_getyx(form, currow, curcol);
+ wprintw(win, "Cursor: %d,%d", currow, curcol);
if (data_ahead(form))
waddstr(win, " ahead");
if (data_behind(form))
}
waddch(win, ' ');
- (void) wattrset(win, field_fore(field));
+ (void) wattrset(win, (int) field_fore(field));
waddstr(win, "fore");
- wattroff(win, field_fore(field));
+ wattroff(win, (int) field_fore(field));
waddch(win, '/');
- (void) wattrset(win, field_back(field));
+ (void) wattrset(win, (int) field_back(field));
waddstr(win, "back");
- wattroff(win, field_back(field));
+ wattroff(win, (int) field_back(field));
wprintw(win, ", pad '%c'",
field_pad(field));
init_pair(1, COLOR_WHITE, COLOR_BLUE);
init_pair(2, COLOR_GREEN, COLOR_BLACK);
init_pair(3, COLOR_CYAN, COLOR_BLACK);
- bkgd(COLOR_PAIR(1));
+ bkgd((chtype) COLOR_PAIR(1));
refresh();
}
endwin();
ExitProgram(EXIT_SUCCESS);
}
+
#else
int
main(void)