From 9cd3ccffd5372dfde3af478e3f832f18db4be3f1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Apr 2013 13:14:41 +0200 Subject: tagging tags --- yhttpd-0.7.0/src/ncur/menu.cpp | 118 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100755 yhttpd-0.7.0/src/ncur/menu.cpp (limited to 'yhttpd-0.7.0/src/ncur/menu.cpp') diff --git a/yhttpd-0.7.0/src/ncur/menu.cpp b/yhttpd-0.7.0/src/ncur/menu.cpp new file mode 100755 index 0000000..c5734a5 --- /dev/null +++ b/yhttpd-0.7.0/src/ncur/menu.cpp @@ -0,0 +1,118 @@ + +#include "menu.h" + +#ifdef NCURSES + +#ifndef MENU_CPP +#define MENU_CPP + + +using namespace std; menu::menu( int i_startx, int i_starty, int i_width, int i_height, char *c_header, char **choices, int i_numchoices, const chtype ch ) +{ + this->i_startx = i_startx; + this->i_starty = i_starty; + this->i_height = i_height; + this->i_width = i_width; + this->c_header = c_header; + this->choices = choices; + this->i_numchoices = i_numchoices; + + initialize( ch ); +} + +menu::~menu() +{ + /* + wborder(win, ' ', ' ', ' ',' ',' ',' ',' ',' '); + wrefresh(win); + delwin(win); + */ +} + +void +menu::initialize( const chtype ch ) +{ + this->i_highlight = 1; + this->i_choice = 0; + + win = newwin( i_height, i_width, i_starty, i_startx ); + wbkgd(win, ch); +} + +void +menu::display() +{ + int x, y, i; + + x = 2; + y = 2; + + box( win, 0, 0 ); + mvwprintw( win, y++, x, "%s", c_header ); + + for( i=0; i