tesseract  4.00.00dev
SVMenuNode Class Reference

#include <svmnode.h>

Public Member Functions

 SVMenuNode ()
 
 ~SVMenuNode ()
 
SVMenuNodeAddChild (const char *txt)
 
void AddChild (const char *txt, int command_event)
 
void AddChild (const char *txt, int command_event, int tv)
 
void AddChild (const char *txt, int command_event, const char *val)
 
void AddChild (const char *txt, int command_event, const char *val, const char *desc)
 
void BuildMenu (ScrollView *sv, bool menu_bar=true)
 

Detailed Description

Definition at line 35 of file svmnode.h.

Constructor & Destructor Documentation

◆ SVMenuNode()

SVMenuNode::SVMenuNode ( )

Definition at line 45 of file svmnode.cpp.

45  {
46  cmd_event_ = -1;
47  child_ = NULL;
48  next_ = NULL;
49  parent_ = NULL;
50  toggle_value_ = false;
51  is_check_box_entry_ = false;
52 }

◆ ~SVMenuNode()

SVMenuNode::~SVMenuNode ( )

Definition at line 54 of file svmnode.cpp.

54  {
55 }

Member Function Documentation

◆ AddChild() [1/5]

SVMenuNode * SVMenuNode::AddChild ( const char *  txt)

Definition at line 59 of file svmnode.cpp.

59  {
60  SVMenuNode* s = new SVMenuNode(-1, txt, false, false, NULL, NULL);
61  this->AddChild(s);
62  return s;
63 }
SVMenuNode()
Definition: svmnode.cpp:45
SVMenuNode * AddChild(const char *txt)
Definition: svmnode.cpp:59

◆ AddChild() [2/5]

void SVMenuNode::AddChild ( const char *  txt,
int  command_event 
)

Definition at line 66 of file svmnode.cpp.

66  {
67  this->AddChild(new SVMenuNode(command_event, txt, false, false, NULL, NULL));
68 }
SVMenuNode()
Definition: svmnode.cpp:45
SVMenuNode * AddChild(const char *txt)
Definition: svmnode.cpp:59

◆ AddChild() [3/5]

void SVMenuNode::AddChild ( const char *  txt,
int  command_event,
int  tv 
)

Definition at line 84 of file svmnode.cpp.

84  {
85  this->AddChild(new SVMenuNode(command_event, txt, tv, true, NULL, NULL));
86 }
SVMenuNode()
Definition: svmnode.cpp:45
SVMenuNode * AddChild(const char *txt)
Definition: svmnode.cpp:59

◆ AddChild() [4/5]

void SVMenuNode::AddChild ( const char *  txt,
int  command_event,
const char *  val 
)

Definition at line 72 of file svmnode.cpp.

73  {
74  this->AddChild(new SVMenuNode(command_event, txt, false, false, val, NULL));
75 }
SVMenuNode()
Definition: svmnode.cpp:45
SVMenuNode * AddChild(const char *txt)
Definition: svmnode.cpp:59

◆ AddChild() [5/5]

void SVMenuNode::AddChild ( const char *  txt,
int  command_event,
const char *  val,
const char *  desc 
)

Definition at line 78 of file svmnode.cpp.

79  {
80  this->AddChild(new SVMenuNode(command_event, txt, false, false, val, desc));
81 }
SVMenuNode()
Definition: svmnode.cpp:45
SVMenuNode * AddChild(const char *txt)
Definition: svmnode.cpp:59

◆ BuildMenu()

void SVMenuNode::BuildMenu ( ScrollView sv,
bool  menu_bar = true 
)

Definition at line 121 of file svmnode.cpp.

121  {
122  if ((parent_ != NULL) && (menu_bar)) {
123  if (is_check_box_entry_) {
124  sv->MenuItem(parent_->text_.string(), text_.string(), cmd_event_,
125  toggle_value_);
126  } else {
127  sv->MenuItem(parent_->text_.string(), text_.string(), cmd_event_); }
128  } else if ((parent_ != NULL) && (!menu_bar)) {
129  if (description_.length() > 0) {
130  sv->PopupItem(parent_->text_.string(), text_.string(), cmd_event_,
131  value_.string(), description_.string());
132  } else {
133  sv->PopupItem(parent_->text_.string(), text_.string());
134  }
135  }
136  if (child_ != NULL) {
137  child_->BuildMenu(sv, menu_bar); delete child_;
138  }
139  if (next_ != NULL) {
140  next_->BuildMenu(sv, menu_bar); delete next_;
141  }
142 }
void MenuItem(const char *parent, const char *name)
Definition: scrollview.cpp:686
const char * string() const
Definition: strngs.cpp:198
inT32 length() const
Definition: strngs.cpp:193
void PopupItem(const char *parent, const char *name)
Definition: scrollview.cpp:692
void BuildMenu(ScrollView *sv, bool menu_bar=true)
Definition: svmnode.cpp:121

The documentation for this class was generated from the following files: