options_dlg.hh

00001 #ifndef _OPTIONS_DLG_H_
00002 #define _OPTIONS_DLG_H_
00003 
00004 #include <FL/Fl_Window.H>
00005 #include <FL/Fl_Scroll.H>
00006 #include <FL/Fl_Check_Button.H>
00007 #include <FL/Fl_Button.H>
00008 
00009 #include <string>
00010 #include <vector>
00011 #include <set>
00012 
00013 #include "option.hh"
00014 
00015 namespace Stg {
00016 
00017   //class Option;
00018 
00019     class OptionsDlg : public Fl_Window {
00020     public:
00021         enum event_t { NO_EVENT, CHANGE, CHANGE_ALL, CLOSE };
00022         
00023     private:
00024         std::vector<Option*> options;
00025         Option* changedItem;
00026         Option* showAll;
00027         event_t status;
00028         Fl_Scroll* scroll;
00029         Fl_Button* button;
00030         Fl_Check_Button* showAllCheck;
00031         void updateChecks();
00032         
00033         virtual int handle( int event );
00034         static void checkChanged( Fl_Widget* w, void* p );
00035         static void closePress( Fl_Widget* w, void* p );
00036         
00037         // constants
00038         static const int vm = 4;
00039         const int hm;
00040         static const int btnH = 25;
00041         static const int boxH = 30;
00042 
00043     public:
00044         OptionsDlg( int x, int y, int w, int h );
00045         virtual ~OptionsDlg();
00046         
00047         void setOptions( const std::vector<Option*>& opts );
00048         void setOptions( const std::set<Option*, Option::optComp>& opts );
00049         void clearOptions() { options.clear(); }
00050         void showAllOpt( Option* opt );
00051         const event_t event() const { return status; }
00052         Option* changed() { return changedItem; }
00053     };
00054 
00055 }
00056     
00057 #endif
00058 

Generated on Wed Jul 30 11:36:06 2008 for Stage by  doxygen 1.4.7