From 98eac951f8087b213f5850bd126dcb279db360a8 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Apr 2013 13:14:42 +0200 Subject: tagging ychat-0.6 --- menu.cpp | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100755 menu.cpp (limited to 'menu.cpp') diff --git a/menu.cpp b/menu.cpp new file mode 100755 index 0000000..c2b277b --- /dev/null +++ b/menu.cpp @@ -0,0 +1,115 @@ +#ifndef MENU_CXX +#define MENU_CXX + +#include "menu.h" +#include "s_sock.h" + +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); + + keypad(win, TRUE); +} + +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