| 850 | if (subItem->_enable) |
| 851 | { |
| 852 | okEnable = true; |
| 853 | } |
| 854 | } |
| 855 | } |
| 856 | item->_visible = okShow; |
| 857 | item->_enable = okEnable; |
| 858 | item->_submenu->_visible = okShow; |
| 859 | item->_submenu->_enable = okEnable; |
| 860 | ret = true; |
| 861 | break; |
| 862 | } |
| 863 | } |
| 864 | } |
| 865 | return ret; |
| 866 | } |
| 867 | |
| 868 | Menu* Menu::FindMenu(int cmd, bool alsoInAtomic) |
| 869 | { |
| 870 | if (!alsoInAtomic) |
| 871 | { |
| 872 | if (!CanBeInMenu(cmd)) |
| 873 | { |
| 874 | return nullptr; |
| 875 | } |
| 876 | if (_atomic) |
| 877 | { |
| 878 | return nullptr; |
| 879 | } |
| 880 | } |
| 881 | for (int i = 0; i < _items.Size(); i++) |
| 882 | { |
| 883 | MenuItem* item = _items[i]; |
| 884 | if (item->_submenu) |
| 885 | { |
| 886 | Menu* found = item->_submenu->FindMenu(cmd, alsoInAtomic); |
| 887 | if (found != nullptr) |
| 888 | { |
| 889 | return found; |
| 890 | } |
| 891 | } |
| 892 | else |
| 893 | { |
| 894 | if (item->_cmd == cmd) |
| 895 | { |
| 896 | return this; |
| 897 | } |
| 898 | } |
| 899 | } |
| 900 | return nullptr; |
| 901 | } |
| 902 | |
| 903 | MenuItem* Menu::Find(int cmd, bool alsoInAtomic) |
| 904 | { |
| 905 | if (!alsoInAtomic) |
| 906 | { |
| 907 | if (!CanBeInMenu(cmd)) |
| 908 | { |
| 909 | return nullptr; |
nothing calls this directly
no test coverage detected