MENU_ROOT Class Reference

#include <sbdmenu.h>

Inheritance diagram for MENU_ROOT:

NON_LEAF_MENU_NODE MENU_NODE List of all members.

Detailed Description

The root of a menu tree (Command Window).

Definition at line 293 of file sbdmenu.h.

Public Member Functions

Protected Member Functions

Protected Attributes

Private Member Functions


Constructor & Destructor Documentation

MENU_ROOT::MENU_ROOT (  )  [inline]

Definition at line 300 of file sbdmenu.h.

00300                 :NON_LEAF_MENU_NODE ("") {
00301     }


Member Function Documentation

void MENU_ROOT::add_child ( NON_LEAF_MENU_NODE new_child  )  [inline]

Definition at line 304 of file sbdmenu.h.

References NON_LEAF_MENU_NODE::link_child().

Referenced by build_main_var_menu(), and build_menu().

00305                                                   {
00306       link_child(new_child); 
00307     }

void NON_LEAF_MENU_NODE::clear_children (  )  [inline, inherited]

Definition at line 255 of file sbdmenu.h.

References NON_LEAF_MENU_NODE::menu_list.

00255                           { 
00256       menu_list.clear ();
00257     };

virtual const char* MENU_NODE::cmp_str (  )  [inline, virtual, inherited]

Reimplemented in BOOL_VAR_MENU_LEAF, DBL_VAR_MENU_LEAF, INT_VAR_MENU_LEAF, and STR_VAR_MENU_LEAF.

Definition at line 108 of file sbdmenu.h.

References MENU_NODE::name, and STRING::string().

Referenced by menu_item_sorter().

00108                                   { 
00109       return name.string ();
00110     }

void MENU_ROOT::event ( COMMAND_WINDOW cmd_win,
FCOORD  pt,
INT32 cmd_event_id,
char *  new_value 
) [inline, virtual]

Event selection; caused by user interaction.

Reimplemented from NON_LEAF_MENU_NODE.

Definition at line 310 of file sbdmenu.h.

References NON_LEAF_MENU_NODE::event().

Referenced by COMMAND_WINDOW::event().

00314                                 {        //Edited value
00315       NON_LEAF_MENU_NODE::event(cmd_win, pt, cmd_event_id, new_value); 
00316     }

void NON_LEAF_MENU_NODE::link_child ( MENU_NODE new_child  )  [protected, inherited]

Add a child to the end of the menu list.

Definition at line 192 of file sbdmenu.cpp.

References NON_LEAF_MENU_NODE::menu_list.

Referenced by VAR_NON_RADIO_MENU::add_child(), NON_RADIO_MENU::add_child(), add_child(), and RADIO_MENU::add_child().

00193                                                           {
00194   MENU_L_IT it(&menu_list); 
00195 
00196   it.add_to_end (new MENU_L (new_child));
00197 }

void NON_LEAF_MENU_NODE::link_child_link ( MENU_L new_child  )  [protected, inherited]

Add a child to the end of the menu list.

Definition at line 203 of file sbdmenu.cpp.

References NON_LEAF_MENU_NODE::menu_list.

Referenced by VAR_NON_RADIO_MENU::add_child().

00204                                                             {
00205   MENU_L_IT it(&menu_list); 
00206 
00207   it.add_to_end (new_child);
00208 }

INT8 NON_LEAF_MENU_NODE::max_num_chars (  )  [protected, virtual, inherited]

Calculate the max character width of any item of this and its children.

Implements MENU_NODE.

Definition at line 233 of file sbdmenu.cpp.

References STRING::length(), NON_LEAF_MENU_NODE::menu_list, and MENU_NODE::name.

Referenced by NON_LEAF_MENU_NODE::recalc_bounding_box().

00233                                        {  //calc char width
00234   MENU_L_IT it(&menu_list); 
00235   INT8 max_so_far = 0;
00236   INT8 current_char_count = 0;
00237 
00238   max_so_far = name.length ();
00239   for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
00240     current_char_count = it.data ()->ptr->max_num_chars ();
00241     if (current_char_count > max_so_far)
00242       max_so_far = current_char_count;
00243   }
00244   return max_so_far;
00245 }

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 MENU_ROOT::plotx ( WINDOW  window  )  [private, virtual]

The real plot, only called internally after initialisation.

Display the menu recursively. Positions assumed already calculated.

Reimplemented from NON_LEAF_MENU_NODE.

Definition at line 136 of file sbdmenu.cpp.

References NON_LEAF_MENU_NODE::menu_list.

00138                        {
00139   MENU_L_IT it(&menu_list); 
00140 
00141   for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ())
00142     it.data ()->ptr->plotx (window);
00143 }

BOX & MENU_ROOT::recalc_bounding_box ( INT16  tl_x,
INT16  tl_y 
) [virtual]

Calculate the selectable areas of the menu items and hence their display positions.

Reimplemented from NON_LEAF_MENU_NODE.

Definition at line 150 of file sbdmenu.cpp.

References MENU_NODE::box, MENU_COLUMN_SPACING, NON_LEAF_MENU_NODE::menu_list, BOX::move_right_edge(), BOX::right(), and BOX::top().

Referenced by COMMAND_WINDOW::COMMAND_WINDOW(), and COMMAND_WINDOW::update_menu_tree().

00153                                      {
00154   MENU_L_IT it(&menu_list); 
00155 
00156   box = BOX (ICOORD (tl_x, tl_y), ICOORD (tl_x, tl_y));
00157 
00158   for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
00159     box += it.data ()->ptr->recalc_bounding_box (box.right (), box.top ());
00160     box.move_right_edge (MENU_COLUMN_SPACING);
00161   }
00162   box.move_right_edge (-MENU_COLUMN_SPACING);
00163   return box;
00164 }

void MENU_ROOT::write_vars ( FILE *  fp,
BOOL8  changes_only 
) [virtual]

Just propogate down the menu tree.

Reimplemented from MENU_NODE.

Definition at line 170 of file sbdmenu.cpp.

References NON_LEAF_MENU_NODE::menu_list.

Referenced by VARIABLES_WINDOW::write_vars(), and VAR_SUB_MENU::write_vars().

00173                             {
00174   MENU_L_IT it(&menu_list); 
00175 
00176   for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ())
00177     it.data ()->ptr->write_vars (fp, changes_only);
00178 }


Member Data Documentation

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(), 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(), recalc_bounding_box(), MENU_NODE::recalc_bounding_box(), MENU_NODE::recalc_fixed_width_bb(), row_space_stat(), and show_point().

MENU_L_LIST NON_LEAF_MENU_NODE::menu_list [protected, inherited]

Definition at line 257 of file sbdmenu.h.

Referenced by RADIO_MENU::add_child(), NON_LEAF_MENU_NODE::clear_children(), RADIO_MENU::event(), NON_LEAF_MENU_NODE::event(), NON_LEAF_MENU_NODE::link_child(), NON_LEAF_MENU_NODE::link_child_link(), NON_LEAF_MENU_NODE::max_num_chars(), NON_LEAF_MENU_NODE::plotx(), plotx(), RADIO_MENU::press_radio_button(), NON_LEAF_MENU_NODE::recalc_bounding_box(), recalc_bounding_box(), VAR_NON_RADIO_MENU::write_vars(), 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().


The documentation for this class was generated from the following files:
Generated on Wed Feb 28 19:49:32 2007 for Tesseract by  doxygen 1.5.1