Static method for creating message with one command @param _modal if true all other GUI elements will be blocked untill message is closed @param _style any combination of flags from ViewValueInfo @param _button1 ... _button4 specific buttons names */
| 179 | _button1 ... _button4 specific buttons names |
| 180 | */ |
| 181 | static Message* createMessageBox( |
| 182 | //const UString& _skinName, |
| 183 | const UString& _caption, |
| 184 | const UString& _message, |
| 185 | MessageBoxStyle _style = MessageBoxStyle::Ok | MessageBoxStyle::IconDefault, |
| 186 | std::string_view _layer = {}, |
| 187 | bool _modal = true, |
| 188 | std::string_view _button1 = {}, |
| 189 | std::string_view _button2 = {}, |
| 190 | std::string_view _button3 = {}, |
| 191 | std::string_view _button4 = {}) |
| 192 | { |
| 193 | Message* mess = new Message(); |
| 194 | |
| 195 | mess->setCaption(_caption); |
| 196 | mess->setMessageText(_message); |
| 197 | |
| 198 | mess->setSmoothShow(true); |
| 199 | |
| 200 | mess->setMessageStyle(_style); |
| 201 | |
| 202 | if (!_button1.empty()) |
| 203 | { |
| 204 | mess->addButtonName(UString(_button1)); |
| 205 | if (!_button2.empty()) |
| 206 | { |
| 207 | mess->addButtonName(UString(_button2)); |
| 208 | if (!_button3.empty()) |
| 209 | { |
| 210 | mess->addButtonName(UString(_button3)); |
| 211 | } |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | if (_modal) |
| 216 | InputManager::getInstance().addWidgetModal(mess->mMainWidget); |
| 217 | |
| 218 | return mess; |
| 219 | } |
| 220 | |
| 221 | /*events:*/ |
| 222 | /** Event : button on message window pressed.\n |
nothing calls this directly
no test coverage detected