MCPcopy Create free account
hub / github.com/MyGUI/mygui / AdviceWidget

Method AdviceWidget

Tools/EditorFramework/Control.cpp:108–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 5

newDelegateFunction · 0.85
getUserStringMethod · 0.80
emptyMethod · 0.45
getItemCountMethod · 0.45
getItemAtMethod · 0.45

Tested by

no test coverage detected