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;
00047
00048 char message_str[MAX_CHARS + 1];
00049 char prompt_str[MAX_CHARS + 1];
00050 INT16 x_pos;
00051 INT16 y_pos;
00052 char win_name[MAX_CHARS + 1];
00053 static INT16 next_win_x_pos;
00054 static INT16 next_win_y_pos;
00055
00056 protected:
00057 WINDOW fd;
00058 MENU_ROOT *menu_root;
00059
00060
00061 virtual BOOL8 internal_prompt(const char *prompt_str,
00062 char *response);
00063
00064 public:
00065 COMMAND_WINDOW(
00066 const char *name,
00067 MENU_ROOT *menu_ptr);
00068
00069 void event(
00070 GRAPHICS_EVENT &g_event,
00071 INT32 *c_event,
00072 char *new_value);
00073
00074 void msg(
00075 const char *message_string);
00076
00077 void plot();
00078
00079 void plot_msg_area();
00080
00081 void plot_prompt_area();
00082
00083 void press_radio_button(
00084 RADIO_MENU *radio_sub_menu_item,
00085 RADIO_MENU_LEAF *button_menu_item);
00086
00087 void update_menu_tree();
00088
00089 BOOL8 prompt(
00090 const char *prompt_str,
00091 char *response);
00092
00093 void replace_menu_text(
00094 LEAF_MENU_NODE *menu_item,
00095 const char *new_label);
00096
00097 void set_toggle(
00098 TOGGLE_MENU_LEAF *menu_item,
00099 BOOL8 new_value);
00100
00101 WINDOW window() {
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