| 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 | { |
no test coverage detected