| 106 | } |
| 107 | |
| 108 | void Control::AdviceWidget(MyGUI::Widget* _widget) |
| 109 | { |
| 110 | std::string_view command = _widget->getUserString("CommandClick"); |
| 111 | if (!command.empty()) |
| 112 | _widget->eventMouseButtonClick += MyGUI::newDelegate(this, &Control::notifyMouseButtonClick); |
| 113 | |
| 114 | MyGUI::TabControl* tab = _widget->castType<MyGUI::TabControl>(false); |
| 115 | if (tab != nullptr) |
| 116 | { |
| 117 | if (tab->getItemCount() != 0 && !tab->getItemAt(0)->getUserString("CommandActivate").empty()) |
| 118 | tab->eventTabChangeSelect += MyGUI::newDelegate(this, &Control::notifyTabChangeSelect); |
| 119 | } |
| 120 | |
| 121 | MyGUI::Window* window = _widget->castType<MyGUI::Window>(false); |
| 122 | if (window != nullptr && !window->getUserString("CommandClose").empty()) |
| 123 | window->eventWindowButtonPressed += MyGUI::newDelegate(this, &Control::notifyWindowButtonPressed); |
| 124 | |
| 125 | command = _widget->getUserString("CommandAccept"); |
| 126 | if (!command.empty()) |
| 127 | { |
| 128 | MyGUI::EditBox* edit = _widget->castType<MyGUI::EditBox>(false); |
| 129 | if (edit != nullptr) |
| 130 | edit->eventEditSelectAccept += MyGUI::newDelegate(this, &Control::notifyEditSelectAccept); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | void Control::SendCommand(std::string_view _command) |
| 135 | { |
nothing calls this directly
no test coverage detected