Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Menu.H

00001 /* $Id: Menu.H,v 1.1 2001/01/01 00:25:56 rpav Exp $
00002  *
00003  * SFW - Studio FrameWork
00004  * Copyright (C) 2000  Ryan Pavlik
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019  *
00020  */
00021 
00022 /*
00023  * Menu.H
00024  *
00025  */ 
00026 
00027 #ifndef MENU_H
00028 #define MENU_H
00029 
00030 #include <SFW/Object.H>
00031 #include <SFW/Curses/Curses.H>
00032 #include <SFW/Curses/KeyBinder.H>
00033 
00034 namespace SFW {
00035     namespace Curses {
00036         class Menu : public Object {
00037             Window *w;
00038             int     r,     c;
00039             int     width, height;
00040 
00041             SFW::Vector items;
00042 
00043             int     offs, curs;
00044 
00045             KeyBinder binding;
00046 
00047             bool finished, aborted;
00048 
00049             void delItems();
00050     
00051         public:
00052             TYPE_INFO(SFW::Curses::Menu, SFW::Object);
00053             METHOD_PTR(Menu);
00054     
00055             Menu(Window *w, int r, int c, int width, int height,
00056                  char **items = 0);
00057             ~Menu();
00058 
00059             /* Methods */
00060             void draw(bool noRefresh = false);
00061             void activate();
00062 
00063             void   setItems(char **items);
00064             int    getIndex();
00065             string getItem();
00066 
00067             /* Commands */
00068             Object* select_next(Object*);
00069             Object* select_prev(Object*);
00070             Object* select_item(Object*);
00071             Object* abort_select(Object*);
00072         };
00073     }
00074 }
00075 #endif /* MENU_H */

Generated at Tue Jan 2 15:38:34 2001 for SFW by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000