MCPcopy Create free account
hub / github.com/creatale/node-dv / BuildMenu

Method BuildMenu

deps/tesseract/viewer/svmnode.cpp:121–142  ·  view source on GitHub ↗

Build a menu structure for the server and send the necessary messages. Should be called on the root node. If menu_bar is true, a menu_bar menu is built (e.g. on top of the window), if it is false a popup menu is built which gets shown by right clicking on the window. Deletes itself afterwards.

Source from the content-addressed store, hash-verified

119// built which gets shown by right clicking on the window.
120// Deletes itself afterwards.
121void SVMenuNode::BuildMenu(ScrollView* sv, bool menu_bar) {
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}
143
144#endif // GRAPHICS_DISABLED

Callers 5

DebugDisplayMethod · 0.80
InitIntMatchWindowIfReqdFunction · 0.80
ParamsEditorMethod · 0.80
pgeditor_mainMethod · 0.80
SVPaintMethod · 0.80

Calls 4

MenuItemMethod · 0.80
PopupItemMethod · 0.80
stringMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected