src/viewer/svmnode.cpp
void SVMenuNode::BuildMenu(ScrollView *sv, bool menu_bar) {
  if ((parent_ != nullptr) && (menu_bar)) {
    if (is_check_box_entry_) {
      sv->MenuItem(parent_->text_.c_str(), text_.c_str(), cmd_event_, toggle_value_);
    } else {
      sv->MenuItem(parent_->text_.c_str(), text_.c_str(), cmd_event_);
    }
  } else if ((parent_ != nullptr) && (!menu_bar)) {
    if (description_.length() > 0) {
      sv->PopupItem(parent_->text_.c_str(), text_.c_str(), cmd_event_, value_.c_str(),
                    description_.c_str());
    } else {
      sv->PopupItem(parent_->text_.c_str(), text_.c_str());
    }
  }
  if (child_ != nullptr) {
    child_->BuildMenu(sv, menu_bar);
    delete child_;
  }
  if (next_ != nullptr) {
    next_->BuildMenu(sv, menu_bar);
    delete next_;
  }
}
// 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.
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 , if it is false a popup menu is
built which gets shown by right clicking on the window.
Deletes itself afterwards.
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 if it is false a popup menu is built which gets shown by right clicking on the window . Deletes itself afterwards .
void SVMenuNode::BuildMenu(ScrollView *sv, bool menu_bar) {
  if ((parent_ != nullptr) && (menu_bar)) {
    if (is_check_box_entry_) {
      sv->MenuItem(parent_->text_.c_str(), text_.c_str(), cmd_event_, toggle_value_);
    } else {
      sv->MenuItem(parent_->text_.c_str(), text_.c_str(), cmd_event_);
    }
  } else if ((parent_ != nullptr) && (!menu_bar)) {
    if (description_.length() > 0) {
      sv->PopupItem(parent_->text_.c_str(), text_.c_str(), cmd_event_, value_.c_str(),
                    description_.c_str());
    } else {
      sv->PopupItem(parent_->text_.c_str(), text_.c_str());
    }
  }
  if (child_ != nullptr) {
    child_->BuildMenu(sv, menu_bar);
    delete child_;
  }
  if (next_ != nullptr) {
    next_->BuildMenu(sv, menu_bar);
    delete next_;
  }
}
void SVMenuNode :: BuildMenu ( ScrollView * sv , bool menu_bar ) { if ( ( parent_ != nullptr ) && ( menu_bar ) ) { if ( is_check_box_entry_ ) { sv -> MenuItem ( parent_ -> text_ . c_str ( ) , text_ . c_str ( ) , cmd_event_ , toggle_value_ ) ; } else { sv -> MenuItem ( parent_ -> text_ . c_str ( ) , text_ . c_str ( ) , cmd_event_ ) ; } } else if ( ( parent_ != nullptr ) && ( ! menu_bar ) ) { if ( description_ . length ( ) > 0 ) { sv -> PopupItem ( parent_ -> text_ . c_str ( ) , text_ . c_str ( ) , cmd_event_ , value_ . c_str ( ) , description_ . c_str ( ) ) ; } else { sv -> PopupItem ( parent_ -> text_ . c_str ( ) , text_ . c_str ( ) ) ; } } if ( child_ != nullptr ) { child_ -> BuildMenu ( sv , menu_bar ) ; delete child_ ; } if ( next_ != nullptr ) { next_ -> BuildMenu ( sv , menu_bar ) ; delete next_ ; } }
Build a menu structure for the server and send the necessary messages.
Build a menu structure for the server and send the necessary messages .