1 /*
2  * Tlf - contest logging program for amateur radio operators
3  * Copyright (C) 2001-2002-2003 Rein Couperus <pa0rct@amsat.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19 /* ------------------------------------------------------------
20 *          Nicebox draws  a  box with  a header
21 *
22 *--------------------------------------------------------------*/
23 
24 
25 #include "nicebox.h"		// Includes curses.h
26 #include "tlf.h"
27 #include "ui_utils.h"
28 
29 
wnicebox(WINDOW * win,int y,int x,int height,int width,char * boxname)30 void wnicebox(WINDOW *win, int y, int x, int height, int width, char *boxname) {
31 
32     height += 1;
33     width += 1;
34 
35     wattrset(win, modify_attr(COLOR_PAIR(C_BORDER)));
36 
37     mvwaddch(win, y, x, ACS_ULCORNER);
38     whline(win, ACS_HLINE, width);
39     mvwaddch(win, y, x + width, ACS_URCORNER);
40     mvwaddch(win, y + height, x, ACS_LLCORNER);
41     whline(win, ACS_HLINE, width);
42     mvwaddch(win, y + height, x + width, ACS_LRCORNER);
43     mvwvline(win, y + 1, x + width, ACS_VLINE, height - 1);
44     mvwvline(win, y + 1, x, ACS_VLINE, height - 1);
45     mvwprintw(win, y, x + 2, boxname);
46 
47     return;
48 }
49 
nicebox(int y,int x,int height,int width,char * boxname)50 void nicebox(int y, int x, int height, int width, char *boxname) {
51     wnicebox(stdscr, y, x, height, width, boxname);
52 }
53 
54