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

Method show

Demos/Demo_ItemBox/ToolTip.cpp:25–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 }
24
25 void ToolTip::show(ItemData* _data)
26 {
27 if ((_data == nullptr) || _data->isEmpty())
28 return;
29
30 mTextCount->setCaption(MyGUI::utility::toString(_data->getCount()));
31 mTextName->setCaption(_data->getInfo()->getItemName());
32 mTextDesc->setCaption(_data->getInfo()->getItemDescription());
33 mImageInfo->setItemResourceInfo(_data->getImage(), "ToolTip", "Normal");
34
35 // вычисляем размер
36 MyGUI::ISubWidgetText* text = mTextDesc->getSubWidgetText();
37 const MyGUI::IntSize& text_size = text ? text->getTextSize() : MyGUI::IntSize();
38 mMainWidget->setSize(mMainWidget->getWidth(), mOffsetHeight + text_size.height);
39
40 mMainWidget->setVisible(true);
41 }
42
43 void ToolTip::hide()
44 {

Callers 1

notifyToolTipMethod · 0.45

Calls 13

toStringFunction · 0.85
isEmptyMethod · 0.80
getInfoMethod · 0.80
setItemResourceInfoMethod · 0.80
getImageMethod · 0.80
getSubWidgetTextMethod · 0.80
IntSizeFunction · 0.50
setCaptionMethod · 0.45
getCountMethod · 0.45
getTextSizeMethod · 0.45
setSizeMethod · 0.45
getWidthMethod · 0.45

Tested by

no test coverage detected