TOGGLE_MENU_LEAF Class Reference

#include <sbdmenu.h>

Inheritance diagram for TOGGLE_MENU_LEAF:

LEAF_MENU_NODE MENU_NODE RADIO_MENU_LEAF List of all members.

Detailed Description

Boolean toggle leaf (Command Window).

Definition at line 173 of file sbdmenu.h.

Public Member Functions

Protected Member Functions

Protected Attributes

Private Member Functions

Private Attributes

Friends


Constructor & Destructor Documentation

TOGGLE_MENU_LEAF::TOGGLE_MENU_LEAF ( const char *  menu_text,
INT32  code,
BOOL8  initial_state 
) [inline]

Definition at line 191 of file sbdmenu.h.

References event_id, and state.

00194                         :LEAF_MENU_NODE (menu_text) {
00195       event_id = code;
00196       state = initial_state;
00197     }


Member Function Documentation

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 TOGGLE_MENU_LEAF::event ( COMMAND_WINDOW cmd_win,
FCOORD  pt,
INT32 cmd_event_id,
char *  new_value 
) [private, virtual]

Event selection.

Implements MENU_NODE.

Definition at line 405 of file sbdmenu.cpp.

References MENU_NODE::box, BOX::contains(), event_id, and state.

00410                               {
00411   if (box.contains (pt)) {
00412     state = !state;
00413     *cmd_event_id = event_id;
00414     strcpy (new_value, state ? "T" : "F");
00415   }
00416 }

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.

00138                          {  //char width reqd
00139       return (INT8) name.length ();
00140     }

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

The real plot.

Positions assumed already calculated.

Reimplemented from LEAF_MENU_NODE.

Definition at line 424 of file sbdmenu.cpp.

References BLACK, fill_color_index, GREY, LEAF_MENU_NODE::plotx(), state, text_color_index, and WHITE.

00426                               {
00427   if (state) {
00428     text_color_index(window, BLACK); 
00429     fill_color_index(window, WHITE); 
00430   }
00431   else {
00432     text_color_index(window, WHITE); 
00433     fill_color_index(window, GREY); 
00434   }
00435 
00436   LEAF_MENU_NODE::plotx(window); 
00437 
00438   text_color_index(window, WHITE); 
00439   fill_color_index(window, GREY); 
00440 }

BOX & MENU_NODE::recalc_bounding_box ( INT16  tl_x,
INT16  tl_y 
) [protected, virtual, inherited]

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 TOGGLE_MENU_LEAF::set_toggle ( BOOL8  value  )  [inline]

Definition at line 199 of file sbdmenu.h.

References state.

Referenced by COMMAND_WINDOW::set_toggle().

00200                                  {
00201       state = value;
00202     }

virtual void MENU_NODE::write_vars ( FILE *  ,
BOOL8   
) [inline, virtual, inherited]

Reimplemented in MENU_ROOT, VAR_SUB_MENU, BOOL_VAR_MENU_LEAF, DBL_VAR_MENU_LEAF, INT_VAR_MENU_LEAF, STR_VAR_MENU_LEAF, and VAR_NON_RADIO_MENU.

Definition at line 120 of file sbdmenu.h.

00122                                    {  //Changed vars only?
00123                                  //default do nothing
00124     }


Friends And Related Function Documentation

friend class RADIO_MENU [friend]

Reimplemented from MENU_NODE.

Definition at line 175 of file sbdmenu.h.


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(), 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().

INT32 TOGGLE_MENU_LEAF::event_id [private]

Definition at line 177 of file sbdmenu.h.

Referenced by event(), and TOGGLE_MENU_LEAF().

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().

BOOL8 TOGGLE_MENU_LEAF::state [private]

Definition at line 178 of file sbdmenu.h.

Referenced by event(), plotx(), set_toggle(), and TOGGLE_MENU_LEAF().


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