#include <varblmen.h>
Inheritance diagram for BOOL_VAR_MENU_LEAF:
Definition at line 31 of file varblmen.h.
BOOL_VAR_MENU_LEAF::BOOL_VAR_MENU_LEAF | ( | BOOL_VARIABLE * | this_var | ) | [inline] |
Definition at line 55 of file varblmen.h.
References changed, FALSE, and var.
00057 : LEAF_MENU_NODE ("") { 00058 var = this_var; 00059 changed = FALSE; 00060 }
const char* BOOL_VAR_MENU_LEAF::cmp_str | ( | ) | [inline, private, virtual] |
Reimplemented from MENU_NODE.
Definition at line 46 of file varblmen.h.
References BOOL_VARIABLE::name_str(), and var.
void BOOL_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 35 of file varblmen.cpp.
References MENU_NODE::box, changed, BOX::contains(), MAX_CHARS, COMMAND_WINDOW::msg(), BOOL_VARIABLE::set_value(), TRUE, and var.
00040 { 00041 char msg[MAX_CHARS + 1]; 00042 00043 if (box.contains (pt)) { 00044 var->set_value (!(BOOL8) * var); 00045 sprintf (msg, "TOGGLED: %s", var->info_str ()); 00046 cmd_win->msg (msg); 00047 changed = TRUE; 00048 } 00049 }
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 BOOL_VAR_MENU_LEAF::plotx | ( | WINDOW | window | ) | [private, virtual] |
The real plot, positions assumed already calculated.
Reimplemented from LEAF_MENU_NODE.
Definition at line 55 of file varblmen.cpp.
References BLACK, fill_color_index, GREY, LEAF_MENU_NODE::plotx(), text_color_index, var, and WHITE.
00057 { 00058 if ((BOOL8) * var) { 00059 text_color_index(window, BLACK); 00060 fill_color_index(window, WHITE); 00061 } 00062 00063 LEAF_MENU_NODE::plotx(window); 00064 00065 text_color_index(window, WHITE); 00066 fill_color_index(window, GREY); 00067 }
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 BOOL_VAR_MENU_LEAF::write_vars | ( | FILE * | fp, | |
BOOL8 | changes_only | |||
) | [private, virtual] |
Save BOOLEAN config vars to file, option on only changed vars
Reimplemented from MENU_NODE.
Definition at line 73 of file varblmen.cpp.
References changed, BOOL_VARIABLE::info_str(), BOOL_VARIABLE::name_str(), and var.
00076 { 00077 if (!changes_only || changed) { 00078 fprintf (fp, "%-25s %-12s # %s\n", 00079 var->name_str (), 00080 (BOOL8) * var ? "TRUE" : "FALSE", var->info_str ()); 00081 } 00082 }
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(), INT_VAR_MENU_LEAF::event(), DBL_VAR_MENU_LEAF::event(), 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 BOOL_VAR_MENU_LEAF::changed [private] |
Definition at line 35 of file varblmen.h.
Referenced by BOOL_VAR_MENU_LEAF(), event(), 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().
BOOL_VARIABLE* BOOL_VAR_MENU_LEAF::var [private] |
Definition at line 34 of file varblmen.h.
Referenced by BOOL_VAR_MENU_LEAF(), cmp_str(), event(), plotx(), and write_vars().