display/varblwin.h

Go to the documentation of this file.
00001 
00019 #ifndef VARBLWIN_H
00020 #define VARBLWIN_H
00021 
00022 #include          "sbdmenu.h"
00023 #include          "notdll.h"
00024 #include          "notdll.h"
00025 
00026 #define KILL_WINDOW_CMD   1
00027 #define WRITE_ALL_CMD   2
00028 #define WRITE_CHANGED_CMD 3
00029 
00030 class VARIABLES_WINDOW;          //Fwd Decl
00031 
00037 class ASSOC:public ELIST_LINK
00038 {
00039   friend class ASSOCIATION_LIST;
00040 
00041   WINDOW fd;                     //Window handle
00042   VARIABLES_WINDOW *var_win;     //Associated var windw
00043 
00044   public:
00045     ASSOC() { 
00046     }                            //contstructor
00047 
00048     ASSOC(                //contstructor
00049           WINDOW new_fd,  //Window handle //Associated var windw
00050           VARIABLES_WINDOW *new_var_win) {
00051       fd = new_fd;
00052       var_win = new_var_win;
00053     }
00054 };
00055 
00056 ELISTIZEH (ASSOC)
00062 class ASSOCIATION_LIST
00063 {
00064   ASSOC_LIST associations;       //List of pairs
00065 
00066   public:
00067     ASSOCIATION_LIST() { 
00068     };
00069 
00070     void add(WINDOW new_fd,  //Window handle //Associated var windw
00071              VARIABLES_WINDOW *new_var_win);
00072 
00073                                  //Window handle
00074     VARIABLES_WINDOW *lookup(WINDOW fd); 
00075 
00076     void plot_all();  //Redisplay all wins
00077 
00078     void remove(WINDOW fd);  //Window handle
00079 
00080     void turn_off_interrupts();  //for all windws listd
00081 
00082     void turn_on_interrupts(  //for all windws listd //handler
00083                             EVENT_HANDLER interrupt_proc);
00084 };
00085 
00093 class VARIABLES_WINDOW:public COMMAND_WINDOW
00094 {
00095   private:
00096                                  //fd -> var win assocs
00097     static ASSOCIATION_LIST win_assocs;
00098     VAR_SUB_MENU *my_creator;    //tell it when I die
00099 
00100     void write_vars(                      //Build config file
00101                     char *filename,       // in this file
00102                     BOOL8 changes_only);  // Changed vars only?
00103 
00104                                  //for all windows
00105     static void interrupt_handler(GRAPHICS_EVENT *g_event); 
00106 
00107     void v_event(  //for specified window
00108                  GRAPHICS_EVENT &g_event);
00109 
00110   public:
00111     VARIABLES_WINDOW(                   //constructor
00112                      const char *name,  //window name
00113                      MENU_ROOT *menu_root,
00114                      VAR_SUB_MENU *creator);
00115 
00116     BOOL8 internal_prompt(                         //Prompt user(No plot)
00117                           const char *prompt_str,  //Prompt message
00118                           char *response);         //Response & Default
00119 
00120     static void plot_all() {  //Redisplay all vars
00121       win_assocs.plot_all ();
00122     }
00123 };
00124 #endif

Generated on Wed Feb 28 19:49:11 2007 for Tesseract by  doxygen 1.5.1