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

Method addButtonName

Common/MessageBox/MessageBox.h:69–95  ·  view source on GitHub ↗

Create button with specific name*/

Source from the content-addressed store, hash-verified

67
68 /** Create button with specific name*/
69 MessageBoxStyle addButtonName(const UString& _name)
70 {
71 if (mVectorButton.size() >= MessageBoxStyle::_countUserButtons)
72 {
73 MYGUI_LOG(Warning, "Too many buttons in message box, ignored");
74 return MessageBoxStyle::None;
75 }
76 // бит, номер кнопки + смещение до Button1
77 MessageBoxStyle info = MessageBoxStyle(
78 MessageBoxStyle::Enum(MYGUI_FLAG(mVectorButton.size() + MessageBoxStyle::_indexUserButton1)));
79
80 // запоминаем кнопки для отмены и подтверждения
81 if (mVectorButton.empty())
82 mInfoOk = info;
83 mInfoCancel = info;
84
85 Widget* widget =
86 mMainWidget->createWidgetT(mButtonType, mButtonSkin, IntCoord(), Align::Left | Align::Bottom);
87 Button* button = widget->castType<Button>();
88 button->eventMouseButtonClick += newDelegate(this, &Message::notifyButtonClick);
89 button->setCaption(_name);
90 button->_setInternalData(info);
91 mVectorButton.push_back(button);
92
93 updateSize();
94 return info;
95 }
96
97 /** Set smooth message showing*/
98 void setSmoothShow(bool _value)

Callers 1

createMessageBoxMethod · 0.80

Calls 11

MessageBoxStyleClass · 0.85
MYGUI_FLAGFunction · 0.85
newDelegateFunction · 0.85
_setInternalDataMethod · 0.80
EnumEnum · 0.70
IntCoordFunction · 0.50
sizeMethod · 0.45
emptyMethod · 0.45
createWidgetTMethod · 0.45
setCaptionMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected