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

Method _getTextWidth

MyGUIEngine/src/MyGUI_TabControl.cpp:435–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433 }
434
435 int TabControl::_getTextWidth(const UString& _text)
436 {
437 if (mItemButton.empty())
438 _createItemButton();
439
440 UString save = mItemButton[0]->getCaption();
441 mItemButton[0]->setCaption(_text);
442
443 ISubWidgetText* text = mItemButton[0]->getSubWidgetText();
444 const IntSize& size = text ? text->getTextSize() : IntSize();
445 const IntCoord& coord = text ? text->getCoord() : IntCoord();
446
447 mItemButton[0]->setCaption(save);
448
449 return size.width + mItemButton[0]->getWidth() - coord.width;
450 }
451
452 void TabControl::_notifyDeleteItem(TabItem* _sheet)
453 {

Callers

nothing calls this directly

Calls 7

getSubWidgetTextMethod · 0.80
IntSizeFunction · 0.50
IntCoordFunction · 0.50
emptyMethod · 0.45
setCaptionMethod · 0.45
getTextSizeMethod · 0.45
getWidthMethod · 0.45

Tested by

no test coverage detected