display/cmndwin.h

Go to the documentation of this file.
00001 
00019 #ifndef CMNDWIN_H
00020 #define CMNDWIN_H
00021 
00022 #include <stdio.h>
00023 #include "hosthplb.h"
00024 #include "grphics.h"
00025 #include "evnts.h"
00026 #include "sbdmenu.h"
00027 #include          "notdll.h"
00028 
00029 #define MAX_CHARS     80
00030 
00031 #define UNIDENTIFIED_COMMAND    -1
00032 
00033 #define NULL_COMMAND    0
00034 
00039 class COMMAND_WINDOW
00040 {
00041   friend class VARIABLE_MENU_LEAF;
00042   friend class DBL_VAR_MENU_LEAF;
00043   friend class INT_VAR_MENU_LEAF;
00044   friend class STR_VAR_MENU_LEAF;
00045 
00046   INT16 window_width;            //Displable width
00047                                  //Message display area
00048   char message_str[MAX_CHARS + 1];
00049   char prompt_str[MAX_CHARS + 1];//Prompt display area
00050   INT16 x_pos;                   //Current win pos
00051   INT16 y_pos;                   //Current win pos
00052   char win_name[MAX_CHARS + 1];  //Window name
00053   static INT16 next_win_x_pos;   //Posn of next cmd win
00054   static INT16 next_win_y_pos;   //Posn of next cmd win
00055 
00056   protected:
00057     WINDOW fd;                   //Cmd Window handle
00058     MENU_ROOT *menu_root;        //Root of menu tree
00059 
00060                                  //Prompt user(No plot)
00061     virtual BOOL8 internal_prompt(const char *prompt_str,  //Prompt message
00062                                   char *response);         //Response & Default
00063 
00064   public:
00065     COMMAND_WINDOW(                   //Constructor
00066                    const char *name,  //window name
00067                    MENU_ROOT *menu_ptr);
00068 
00069     void event(                   //Process event //Command event type
00070                GRAPHICS_EVENT &g_event,
00071                INT32 *c_event,
00072                char *new_value);  //of menu item
00073 
00074     void msg(                              //Display message
00075              const char *message_string);  //Text to display
00076 
00077     void plot();  //(re)paint the window
00078 
00079     void plot_msg_area(); 
00080 
00081     void plot_prompt_area(); 
00082 
00083     void press_radio_button(          //Change selected item //of this radio set
00084                             RADIO_MENU *radio_sub_menu_item,  //This button
00085                             RADIO_MENU_LEAF *button_menu_item);
00086 
00087     void update_menu_tree();  //Re calc BBoxes etc
00088 
00089     BOOL8 prompt(                         //Prompt user(& plot)
00090                  const char *prompt_str,  //Prompt message
00091                  char *response);         //Response & Default
00092 
00093     void replace_menu_text(                            //Change & show label
00094                            LEAF_MENU_NODE *menu_item,  //for this item
00095                            const char *new_label);     //New label
00096 
00097     void set_toggle(                              //Change value & show
00098                     TOGGLE_MENU_LEAF *menu_item,  //for this item
00099                     BOOL8 new_value);
00100 
00101     WINDOW window() {  //Return window handle
00102       return fd;
00103     }
00104 };
00105 
00128 extern INT_VAR_H (editor_cmdwin_width, 950,
00129 "CmdWin max non scrollable width");
00130 extern INT_VAR_H (editor_cmdwin_height, 550,
00131 "CmdWin max non scrollable height");
00132 extern INT_VAR_H (editor_cmdwin_xpos1, 20, "X pos of first command window");
00133 extern INT_VAR_H (editor_cmdwin_ypos1, 20, "Y pos of first command window");
00134 extern INT_VAR_H (editor_cmdwin_xoffset, 30, "X offset between command windws");
00135 extern INT_VAR_H (editor_cmdwin_yoffset, 30,"Y offset between command windws");
00137 #endif

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