#include <varblmen.h>
Inheritance diagram for INT_VAR_MENU_LEAF:
Definition at line 100 of file varblmen.h.
INT_VAR_MENU_LEAF::INT_VAR_MENU_LEAF | ( | INT_VARIABLE * | this_var | ) | [inline] |
Definition at line 121 of file varblmen.h.
References changed, FALSE, and var.
00123 : LEAF_MENU_NODE ("") { 00124 var = this_var; 00125 changed = FALSE; 00126 }
const char* INT_VAR_MENU_LEAF::cmp_str | ( | ) | [inline, private, virtual] |
Reimplemented from MENU_NODE.
Definition at line 112 of file varblmen.h.
References INT_VARIABLE::name_str(), and var.
void INT_VAR_MENU_LEAF::event | ( | COMMAND_WINDOW * | cmd_win, | |
FCOORD | pt, | |||
INT32 * | cmd_event_id, | |||
char * | new_value | |||
) | [private, virtual] |
Event selection, toggle value
Implements MENU_NODE.
Definition at line 154 of file varblmen.cpp.
References MENU_NODE::box, changed, BOX::contains(), INT32FORMAT, COMMAND_WINDOW::internal_prompt(), MAX_CHARS, COMMAND_WINDOW::msg(), TRUE, and var.
00159 { 00160 char ascii_new_value[MAX_CHARS + 1]; 00161 const char *prompt_msg; 00162 INT32 new_value; 00163 00164 if (box.contains (pt)) { 00165 sprintf (ascii_new_value, INT32FORMAT, (INT32) * var); 00166 prompt_msg = var->info_str (); 00167 while (cmd_win->internal_prompt (prompt_msg, ascii_new_value)) { 00168 if (sscanf (ascii_new_value, INT32FORMAT, &new_value) == 1) { 00169 if (new_value != (INT32) * var) { 00170 var->set_value (new_value); 00171 cmd_win->msg ("Value changed"); 00172 changed = TRUE; 00173 return; 00174 } 00175 else { 00176 cmd_win->msg ("Value unchanged"); 00177 return; 00178 } 00179 } 00180 else 00181 prompt_msg = "Invalid value for INT32 - try again or click"; 00182 } 00183 } 00184 }
INT8 LEAF_MENU_NODE::max_num_chars | ( | ) | [inline, protected, virtual, inherited] |
Implements MENU_NODE.
Definition at line 138 of file sbdmenu.h.
References STRING::length(), and MENU_NODE::name.
void MENU_NODE::new_label | ( | const char * | label | ) | [inline, inherited] |
Definition at line 115 of file sbdmenu.h.
References MENU_NODE::name.
Referenced by COMMAND_WINDOW::replace_menu_text().
00116 { 00117 name = label; 00118 }
void MENU_NODE::plot | ( | WINDOW | window | ) | [inherited] |
Initialise, then call plotx to do the real work.
This means that we can initialise plotting once only REGARDLESS of what menu subclass we start plotting.
e.g., we don't always start with a MENU_ROOT.
Definition at line 79 of file sbdmenu.cpp.
References character_height, fill_color_index, GREY, INT_SOLID, interior_style, LIGHT_GREY, perimeter_color_index, MENU_NODE::plotx(), text_color_index, TRUE, and WHITE.
Referenced by COMMAND_WINDOW::plot(), COMMAND_WINDOW::replace_menu_text(), and COMMAND_WINDOW::set_toggle().
00081 { 00082 character_height(window, menu_char_height); 00083 interior_style(window, INT_SOLID, TRUE); 00084 perimeter_color_index(window, LIGHT_GREY); 00085 text_color_index(window, WHITE); 00086 fill_color_index(window, GREY); 00087 plotx(window); 00088 }
void LEAF_MENU_NODE::plotx | ( | WINDOW | window | ) | [protected, virtual, inherited] |
The real plot; positions assumed already calculated.
Implements MENU_NODE.
Reimplemented in TOGGLE_MENU_LEAF, and BOOL_VAR_MENU_LEAF.
Definition at line 52 of file sbdmenu.cpp.
References MENU_NODE::box, FALSE, BOX::left(), MENU_TEXT_X_OFFSET, MENU_TEXT_Y_OFFSET, MENU_NODE::name, BOX::plot(), STRING::string(), text2d, and BOX::top().
Referenced by BOOL_VAR_MENU_LEAF::plotx(), and TOGGLE_MENU_LEAF::plotx().
00054 { 00055 box.plot (window); 00056 00057 text2d (window, 00058 box.left () + MENU_TEXT_X_OFFSET, 00059 box.top () - MENU_TEXT_Y_OFFSET, name.string (), 0, FALSE); 00060 }
SHOULD NEVER BE CALLED.
Compiler needs it as this can't be a pure virtual function as not all classes provide it and the compiler will not let you do "new" on a class which inherits a pure virtual function which it cannot resolve into a real function.
Reimplemented in NON_LEAF_MENU_NODE, and MENU_ROOT.
Definition at line 99 of file sbdmenu.cpp.
References ABORT, MENU_NODE::box, ERRCODE::error(), NULL, and SHOULDNT_BE_CALLED.
00102 { 00103 SHOULDNT_BE_CALLED.error ("MENU_ROOT::recalc_bounding_box", ABORT, NULL); 00104 return box; 00105 }
void INT_VAR_MENU_LEAF::write_vars | ( | FILE * | fp, | |
BOOL8 | changes_only | |||
) | [private, virtual] |
Save INTEGER config vars to file, option on only changed vars
Reimplemented from MENU_NODE.
Definition at line 190 of file varblmen.cpp.
References changed, INT_VARIABLE::info_str(), INT_VARIABLE::name_str(), and var.
00193 { 00194 if (!changes_only || changed) { 00195 fprintf (fp, "%-25s %-12d # %s\n", 00196 var->name_str (), (int) *var, var->info_str ()); 00197 } 00198 }
BOX MENU_NODE::box [protected, inherited] |
Definition at line 77 of file sbdmenu.h.
Referenced by block_space_stat(), VAR_SUB_MENU::event(), STR_VAR_MENU_LEAF::event(), event(), DBL_VAR_MENU_LEAF::event(), BOOL_VAR_MENU_LEAF::event(), VARIABLE_MENU_LEAF::event(), TOGGLE_MENU_LEAF::event(), SIMPLE_MENU_LEAF::event(), RADIO_MENU::event(), NON_LEAF_MENU_NODE::event(), NON_LEAF_MENU_NODE::plotx(), LEAF_MENU_NODE::plotx(), re_scale_and_move_bln_word(), NON_LEAF_MENU_NODE::recalc_bounding_box(), MENU_ROOT::recalc_bounding_box(), MENU_NODE::recalc_bounding_box(), MENU_NODE::recalc_fixed_width_bb(), row_space_stat(), and show_point().
BOOL8 INT_VAR_MENU_LEAF::changed [private] |
Definition at line 104 of file varblmen.h.
Referenced by event(), INT_VAR_MENU_LEAF(), and write_vars().
STRING MENU_NODE::name [protected, inherited] |
Definition at line 76 of file sbdmenu.h.
Referenced by MENU_NODE::cmp_str(), VAR_SUB_MENU::event(), VARIABLE_MENU_LEAF::event(), LEAF_MENU_NODE::max_num_chars(), NON_LEAF_MENU_NODE::max_num_chars(), MENU_NODE::MENU_NODE(), MENU_NODE::new_label(), pgeditor_read_file(), NON_LEAF_MENU_NODE::plotx(), and LEAF_MENU_NODE::plotx().
INT_VARIABLE* INT_VAR_MENU_LEAF::var [private] |
Definition at line 103 of file varblmen.h.
Referenced by cmp_str(), event(), INT_VAR_MENU_LEAF(), and write_vars().